Documentation
¶
Overview ¶
Package mock provides mock implementations for AWS Cognito Provider
Index ¶
- Variables
- func CompareAttributeValues(val1, val2 types.AttributeValue) int
- func ExtractKeys(key map[string]types.AttributeValue, primaryKey, sortKey string) (string, string, error)
- func IsEqual(av1, av2 types.AttributeValue) bool
- func PrintAttributeValueMap(av map[string]types.AttributeValue)
- func PrintMap(data map[string]interface{}, indent string)
- func SorN(av types.AttributeValue) *string
- type AuthSession
- type AwsMetadata
- type AwsNodeShadow
- type AwsShadowState
- type Certificate
- type CognitoIdentityMock
- func (m *CognitoIdentityMock) AddCredentialsMapping(identityId string, credentials *types.Credentials)
- func (m *CognitoIdentityMock) AddTokenMapping(token, identityId string)
- func (m *CognitoIdentityMock) GetCredentialsForIdentity(ctx context.Context, params *cognitoidentity.GetCredentialsForIdentityInput, ...) (*cognitoidentity.GetCredentialsForIdentityOutput, error)
- func (m *CognitoIdentityMock) GetId(ctx context.Context, params *cognitoidentity.GetIdInput, ...) (*cognitoidentity.GetIdOutput, error)
- func (m *CognitoIdentityMock) GetLastGetCredentialsInput() *cognitoidentity.GetCredentialsForIdentityInput
- type CognitoProviderMock
- func (m *CognitoProviderMock) AddTestUserDirect(userPoolID, username, email, password string, confirmed bool) *UserState
- func (m *CognitoProviderMock) AddTestUserPoolDirect(userPoolID, clientID string)
- func (m *CognitoProviderMock) AdminCreateUser(ctx context.Context, params *cognitoidentityprovider.AdminCreateUserInput, ...) (*cognitoidentityprovider.AdminCreateUserOutput, error)
- func (m *CognitoProviderMock) AdminGetUser(ctx context.Context, params *cognitoidentityprovider.AdminGetUserInput, ...) (*cognitoidentityprovider.AdminGetUserOutput, error)
- func (m *CognitoProviderMock) AdminSetUserPassword(ctx context.Context, params *cognitoidentityprovider.AdminSetUserPasswordInput, ...) (*cognitoidentityprovider.AdminSetUserPasswordOutput, error)
- func (m *CognitoProviderMock) AdminUpdateUserAttributes(ctx context.Context, ...) (*cognitoidentityprovider.AdminUpdateUserAttributesOutput, error)
- func (m *CognitoProviderMock) ChangePassword(ctx context.Context, params *cognitoidentityprovider.ChangePasswordInput, ...) (*cognitoidentityprovider.ChangePasswordOutput, error)
- func (m *CognitoProviderMock) ConfirmForgotPassword(ctx context.Context, ...) (*cognitoidentityprovider.ConfirmForgotPasswordOutput, error)
- func (m *CognitoProviderMock) ConfirmSignUp(ctx context.Context, params *cognitoidentityprovider.ConfirmSignUpInput, ...) (*cognitoidentityprovider.ConfirmSignUpOutput, error)
- func (m *CognitoProviderMock) DescribeUserPoolClient(ctx context.Context, ...) (*cognitoidentityprovider.DescribeUserPoolClientOutput, error)
- func (m *CognitoProviderMock) ForgotPassword(ctx context.Context, params *cognitoidentityprovider.ForgotPasswordInput, ...) (*cognitoidentityprovider.ForgotPasswordOutput, error)
- func (m *CognitoProviderMock) GetSessionByRefreshToken(refreshToken string) *AuthSession
- func (m *CognitoProviderMock) GetSessionByToken(token string) *AuthSession
- func (m *CognitoProviderMock) GetUser(ctx context.Context, params *cognitoidentityprovider.GetUserInput, ...) (*cognitoidentityprovider.GetUserOutput, error)
- func (m *CognitoProviderMock) GetUserByUsername(userPoolID, username string) *UserState
- func (m *CognitoProviderMock) GlobalSignOut(ctx context.Context, params *cognitoidentityprovider.GlobalSignOutInput, ...) (*cognitoidentityprovider.GlobalSignOutOutput, error)
- func (m *CognitoProviderMock) InitiateAuth(ctx context.Context, params *cognitoidentityprovider.InitiateAuthInput, ...) (*cognitoidentityprovider.InitiateAuthOutput, error)
- func (m *CognitoProviderMock) RegisterSessionForToken(accessToken, userPoolID, clientID, username string) error
- func (m *CognitoProviderMock) ResendConfirmationCode(ctx context.Context, ...) (*cognitoidentityprovider.ResendConfirmationCodeOutput, error)
- func (m *CognitoProviderMock) RespondToAuthChallenge(ctx context.Context, ...) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error)
- func (m *CognitoProviderMock) RevokeToken(ctx context.Context, params *cognitoidentityprovider.RevokeTokenInput, ...) (*cognitoidentityprovider.RevokeTokenOutput, error)
- func (m *CognitoProviderMock) SetErrorForMethod(method string, err error)
- func (m *CognitoProviderMock) SignUp(ctx context.Context, params *cognitoidentityprovider.SignUpInput, ...) (*cognitoidentityprovider.SignUpOutput, error)
- func (m *CognitoProviderMock) UpdateUserPoolClient(ctx context.Context, params *cognitoidentityprovider.UpdateUserPoolClientInput, ...) (*cognitoidentityprovider.UpdateUserPoolClientOutput, error)
- type DBItem
- type DynamoDBMock
- func (m *DynamoDBMock) AddSecondaryIndex(indexName, tableName, primaryKey, sortKey string) error
- func (m *DynamoDBMock) AddTable(name, primaryKey string, sortKey string)
- func (m *DynamoDBMock) BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, ...) (*dynamodb.BatchGetItemOutput, error)
- func (m *DynamoDBMock) BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, ...) (*dynamodb.BatchWriteItemOutput, error)
- func (m *DynamoDBMock) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, ...) (*dynamodb.DeleteItemOutput, error)
- func (m *DynamoDBMock) DescribeTable(_ context.Context, in *dynamodb.DescribeTableInput, ...) (*dynamodb.DescribeTableOutput, error)
- func (m *DynamoDBMock) ForEachRow(table string, fn func(map[string]types.AttributeValue) error) error
- func (m *DynamoDBMock) GSIStatus(table, indexName string) types.IndexStatus
- func (m *DynamoDBMock) GetDirect(tableName, pkey, skey string, out interface{}) error
- func (m *DynamoDBMock) GetItem(ctx context.Context, params *dynamodb.GetItemInput, ...) (*dynamodb.GetItemOutput, error)
- func (m *DynamoDBMock) GetKeys(item interface{}) (string, string, string, error)
- func (m *DynamoDBMock) HasGSI(table, indexName string) bool
- func (m *DynamoDBMock) Print()
- func (m *DynamoDBMock) ProfileGet() Profile
- func (m *DynamoDBMock) ProfileReset()
- func (m *DynamoDBMock) PutDirect(tableName, pkey, skey string, item interface{}) error
- func (m *DynamoDBMock) PutItem(ctx context.Context, params *dynamodb.PutItemInput, ...) (*dynamodb.PutItemOutput, error)
- func (m *DynamoDBMock) Query(ctx context.Context, params *dynamodb.QueryInput, ...) (*dynamodb.QueryOutput, error)
- func (m *DynamoDBMock) QueryInternal(input *dynamodb.QueryInput) (*dynamodb.QueryOutput, error)
- func (m *DynamoDBMock) Scan(ctx context.Context, params *dynamodb.ScanInput, ...) (*dynamodb.ScanOutput, error)
- func (m *DynamoDBMock) ScanInternal(input *dynamodb.ScanInput) (*dynamodb.ScanOutput, error)
- func (m *DynamoDBMock) SetIndexProjection(indexName string, projection types.ProjectionType, nonKeyAttributes ...string) error
- func (m *DynamoDBMock) UpdateItem(ctx context.Context, input *dynamodb.UpdateItemInput, ...) (*dynamodb.UpdateItemOutput, error)
- func (m *DynamoDBMock) UpdateTable(_ context.Context, in *dynamodb.UpdateTableInput, _ ...func(*dynamodb.Options)) (*dynamodb.UpdateTableOutput, error)
- func (m *DynamoDBMock) WithGSI(table, indexName, hashKey, sortKey string, status types.IndexStatus) *DynamoDBMock
- func (m *DynamoDBMock) WithGSIDescription(table string, gsi types.GlobalSecondaryIndexDescription) *DynamoDBMock
- func (m *DynamoDBMock) WithTable(name string, status types.TableStatus) *DynamoDBMock
- type ECSClientMock
- type HandlerFunc
- type IndexDetails
- type IoTClientMock
- func (m *IoTClientMock) AddThingToThingGroup(ctx context.Context, params *iot.AddThingToThingGroupInput, ...) (*iot.AddThingToThingGroupOutput, error)
- func (m *IoTClientMock) AttachPolicy(ctx context.Context, params *iot.AttachPolicyInput, ...) (*iot.AttachPolicyOutput, error)
- func (m *IoTClientMock) AttachThingPrincipal(ctx context.Context, params *iot.AttachThingPrincipalInput, ...) (*iot.AttachThingPrincipalOutput, error)
- func (m *IoTClientMock) CreateThing(ctx context.Context, params *iot.CreateThingInput, ...) (*iot.CreateThingOutput, error)
- func (m *IoTClientMock) CreateThingGroup(ctx context.Context, params *iot.CreateThingGroupInput, ...) (*iot.CreateThingGroupOutput, error)
- func (m *IoTClientMock) DeleteCertificate(ctx context.Context, params *iot.DeleteCertificateInput, ...) (*iot.DeleteCertificateOutput, error)
- func (m *IoTClientMock) DeleteThing(ctx context.Context, params *iot.DeleteThingInput, ...) (*iot.DeleteThingOutput, error)
- func (m *IoTClientMock) DescribeCertificate(ctx context.Context, params *iot.DescribeCertificateInput, ...) (*iot.DescribeCertificateOutput, error)
- func (m *IoTClientMock) DescribeThing(ctx context.Context, params *iot.DescribeThingInput, ...) (*iot.DescribeThingOutput, error)
- func (m *IoTClientMock) DescribeThingGroup(ctx context.Context, params *iot.DescribeThingGroupInput, ...) (*iot.DescribeThingGroupOutput, error)
- func (m *IoTClientMock) DetachThingPrincipal(ctx context.Context, params *iot.DetachThingPrincipalInput, ...) (*iot.DetachThingPrincipalOutput, error)
- func (m *IoTClientMock) FindCertificateByPEMDirect(certPEM string) (*Certificate, string, bool)
- func (m *IoTClientMock) GetAttachedPolicies(target string) []string
- func (m *IoTClientMock) GetCertificateDirect(certID string) (*Certificate, bool)
- func (m *IoTClientMock) GetCertificatesDirect() map[string]Certificate
- func (m *IoTClientMock) GetThingAttributeDirect(thingName, attributeKey string) (string, bool)
- func (m *IoTClientMock) GetThingDirect(thingName string) (*Things, bool)
- func (m *IoTClientMock) GetThingGroupsDirect(thingName string) []string
- func (m *IoTClientMock) GetThingsDirect() map[string]Things
- func (m *IoTClientMock) GetTopicRule(ctx context.Context, params *iot.GetTopicRuleInput, ...) (*iot.GetTopicRuleOutput, error)
- func (m *IoTClientMock) GetTopicRuleDirect(ruleName string) (*types.TopicRulePayload, bool)
- func (m *IoTClientMock) ListThingGroups(ctx context.Context, params *iot.ListThingGroupsInput, ...) (*iot.ListThingGroupsOutput, error)
- func (m *IoTClientMock) ListThingPrincipals(ctx context.Context, params *iot.ListThingPrincipalsInput, ...) (*iot.ListThingPrincipalsOutput, error)
- func (m *IoTClientMock) Print()
- func (m *IoTClientMock) RegisterCertificateWithoutCA(ctx context.Context, params *iot.RegisterCertificateWithoutCAInput, ...) (*iot.RegisterCertificateWithoutCAOutput, error)
- func (m *IoTClientMock) ReplaceTopicRule(ctx context.Context, params *iot.ReplaceTopicRuleInput, ...) (*iot.ReplaceTopicRuleOutput, error)
- func (m *IoTClientMock) SetTopicRuleDirect(ruleName string, payload *types.TopicRulePayload)
- func (m *IoTClientMock) UpdateCertificate(ctx context.Context, params *iot.UpdateCertificateInput, ...) (*iot.UpdateCertificateOutput, error)
- func (m *IoTClientMock) UpdateThing(ctx context.Context, params *iot.UpdateThingInput, ...) (*iot.UpdateThingOutput, error)
- func (m *IoTClientMock) VerifyCertificateActive(certPEM string) bool
- func (m *IoTClientMock) VerifyCertificateExists(certPEM string) bool
- func (m *IoTClientMock) VerifyThingExists(thingName string) bool
- func (m *IoTClientMock) VerifyThingHasCertificate(thingName string, certPEM string) bool
- func (m *IoTClientMock) VerifyThingInGroup(thingName string, groupName string) bool
- func (m *IoTClientMock) VerifyThingInGroups(thingName string, groupNames []string) bool
- type IoTDataPlaneMock
- func (m *IoTDataPlaneMock) AddDirect(thingName, shadowName string, payload []byte)
- func (m *IoTDataPlaneMock) DeleteThingShadow(ctx context.Context, params *iotdataplane.DeleteThingShadowInput, ...) (*iotdataplane.DeleteThingShadowOutput, error)
- func (m *IoTDataPlaneMock) GetDirect(thingName, shadowName string) ([]byte, error)
- func (m *IoTDataPlaneMock) GetNamedShadowNames(thingName string) []string
- func (m *IoTDataPlaneMock) GetThingShadow(ctx context.Context, params *iotdataplane.GetThingShadowInput, ...) (*iotdataplane.GetThingShadowOutput, error)
- func (m *IoTDataPlaneMock) Print()
- func (m *IoTDataPlaneMock) Publish(ctx context.Context, params *iotdataplane.PublishInput, ...) (*iotdataplane.PublishOutput, error)
- func (m *IoTDataPlaneMock) UpdateThingShadow(ctx context.Context, params *iotdataplane.UpdateThingShadowInput, ...) (*iotdataplane.UpdateThingShadowOutput, error)
- func (m *IoTDataPlaneMock) VerifyTags(nodeID string, adminTags, deviceTags, userTags map[string]string) bool
- type KVSClientMock
- func (m *KVSClientMock) CreateSignalingChannel(ctx context.Context, params *kinesisvideo.CreateSignalingChannelInput, ...) (*kinesisvideo.CreateSignalingChannelOutput, error)
- func (m *KVSClientMock) DescribeSignalingChannel(ctx context.Context, params *kinesisvideo.DescribeSignalingChannelInput, ...) (*kinesisvideo.DescribeSignalingChannelOutput, error)
- func (m *KVSClientMock) GetChannelDirect(channelName string) (*SignalingChannel, bool)
- type LambdaHandler
- type LambdaMock
- func (m *LambdaMock) AddPermission(ctx context.Context, params *lambda.AddPermissionInput, ...) (*lambda.AddPermissionOutput, error)
- func (m *LambdaMock) Invoke(ctx context.Context, params *lambda.InvokeInput, ...) (*lambda.InvokeOutput, error)
- func (m *LambdaMock) RemovePermission(ctx context.Context, params *lambda.RemovePermissionInput, ...) (*lambda.RemovePermissionOutput, error)
- type Mexpression
- type MockHTTPClient
- func (c *MockHTTPClient) Do(req *http.Request) (*http.Response, error)
- func (c *MockHTTPClient) Get(url string) (*http.Response, error)
- func (c *MockHTTPClient) Head(url string) (*http.Response, error)
- func (c *MockHTTPClient) Post(url string, bodyType string, body io.Reader) (*http.Response, error)
- func (c *MockHTTPClient) PostForm(url string, values url.Values) (*http.Response, error)
- func (c *MockHTTPClient) RegisterResponse(url, method string, statusCode int, responseBody interface{}) error
- type MockKMS
- func (m *MockKMS) AddKey(keyID string) *ecdsa.PrivateKey
- func (m *MockKMS) AddRSAKeyWith(keyID string, key *rsa.PrivateKey) *rsa.PrivateKey
- func (m *MockKMS) GetPublicKey(ctx context.Context, params *kms.GetPublicKeyInput, ...) (*kms.GetPublicKeyOutput, error)
- func (m *MockKMS) Sign(ctx context.Context, params *kms.SignInput, optFns ...func(*kms.Options)) (*kms.SignOutput, error)
- type MockS3PresignClient
- type MockSES
- func (m *MockSES) CreateEmailIdentity(ctx context.Context, params *sesv2.CreateEmailIdentityInput, ...) (*sesv2.CreateEmailIdentityOutput, error)
- func (m *MockSES) DeleteEmailIdentity(ctx context.Context, params *sesv2.DeleteEmailIdentityInput, ...) (*sesv2.DeleteEmailIdentityOutput, error)
- func (m *MockSES) GetAccount(ctx context.Context, params *sesv2.GetAccountInput, ...) (*sesv2.GetAccountOutput, error)
- func (m *MockSES) GetEmailIdentity(ctx context.Context, params *sesv2.GetEmailIdentityInput, ...) (*sesv2.GetEmailIdentityOutput, error)
- func (m *MockSES) ListEmailIdentities(ctx context.Context, params *sesv2.ListEmailIdentitiesInput, ...) (*sesv2.ListEmailIdentitiesOutput, error)
- func (m *MockSES) PutAccountDetails(ctx context.Context, params *sesv2.PutAccountDetailsInput, ...) (*sesv2.PutAccountDetailsOutput, error)
- func (m *MockSES) SendEmail(ctx context.Context, params *sesv2.SendEmailInput, ...) (*sesv2.SendEmailOutput, error)
- func (m *MockSES) SetVerified(identity string)
- type MockSSM
- func (m *MockSSM) DeleteParameter(ctx context.Context, params *ssm.DeleteParameterInput, ...) (*ssm.DeleteParameterOutput, error)
- func (m *MockSSM) GetParameter(ctx context.Context, params *ssm.GetParameterInput, ...) (*ssm.GetParameterOutput, error)
- func (m *MockSSM) GetParametersByPath(ctx context.Context, params *ssm.GetParametersByPathInput, ...) (*ssm.GetParametersByPathOutput, error)
- func (m *MockSSM) PutParameter(ctx context.Context, params *ssm.PutParameterInput, ...) (*ssm.PutParameterOutput, error)
- type Profile
- func (p *Profile) AddAction(table string, action string, operation string, details string, size int)
- func (p *Profile) AddRead(table string, operation string, details string, size int)
- func (p *Profile) AddWrite(table string, operation string, details string, size int)
- func (p *Profile) Print(w io.Writer)
- func (p *Profile) Reset()
- func (p *Profile) TotalCounts() (int, int)
- type ProfileOperation
- type S3ClientMock
- func (m *S3ClientMock) CreateBucketDirect(bucketName string)
- func (m *S3ClientMock) GetObject(ctx context.Context, input *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
- func (m *S3ClientMock) GetPresignClient() awscommon.S3PresignClientInterface
- func (m *S3ClientMock) ListBuckets(ctx context.Context, input *s3.ListBucketsInput, optFns ...func(*s3.Options)) (*s3.ListBucketsOutput, error)
- func (m *S3ClientMock) PutObject(ctx context.Context, input *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
- type SNSMock
- func (m *SNSMock) ClearPublishedMessages()
- func (m *SNSMock) CreatePlatformApplication(ctx context.Context, params *sns.CreatePlatformApplicationInput, ...) (*sns.CreatePlatformApplicationOutput, error)
- func (m *SNSMock) CreatePlatformEndpoint(ctx context.Context, params *sns.CreatePlatformEndpointInput, ...) (*sns.CreatePlatformEndpointOutput, error)
- func (m *SNSMock) DeleteEndpoint(ctx context.Context, params *sns.DeleteEndpointInput, ...) (*sns.DeleteEndpointOutput, error)
- func (m *SNSMock) DeletePlatformApplication(ctx context.Context, params *sns.DeletePlatformApplicationInput, ...) (*sns.DeletePlatformApplicationOutput, error)
- func (m *SNSMock) GetCreatePlatformApplicationCalls() []*sns.CreatePlatformApplicationInput
- func (m *SNSMock) GetCreatePlatformEndpointCalls() []*sns.CreatePlatformEndpointInput
- func (m *SNSMock) GetDeleteEndpointCalls() []*sns.DeleteEndpointInput
- func (m *SNSMock) GetDeletePlatformApplicationCalls() []*sns.DeletePlatformApplicationInput
- func (m *SNSMock) GetListPlatformApplicationsCalls() []*sns.ListPlatformApplicationsInput
- func (m *SNSMock) GetPlatformApplicationAttributes(ctx context.Context, params *sns.GetPlatformApplicationAttributesInput, ...) (*sns.GetPlatformApplicationAttributesOutput, error)
- func (m *SNSMock) GetPublishedMessages() []*sns.PublishInput
- func (m *SNSMock) GetSetPlatformApplicationAttributesCalls() []*sns.SetPlatformApplicationAttributesInput
- func (m *SNSMock) ListPlatformApplications(ctx context.Context, params *sns.ListPlatformApplicationsInput, ...) (*sns.ListPlatformApplicationsOutput, error)
- func (m *SNSMock) Publish(ctx context.Context, params *sns.PublishInput, optFns ...func(*sns.Options)) (*sns.PublishOutput, error)
- func (m *SNSMock) SetListPlatformApplicationsError(err error)
- func (m *SNSMock) SetMockPlatformApplications(apps []types.PlatformApplication)
- func (m *SNSMock) SetPlatformApplicationAttributes(ctx context.Context, params *sns.SetPlatformApplicationAttributesInput, ...) (*sns.SetPlatformApplicationAttributesOutput, error)
- func (m *SNSMock) SetPublishError(err error)
- type STSMock
- func (m *STSMock) AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error)
- func (m *STSMock) GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, ...) (*sts.GetCallerIdentityOutput, error)
- func (m *STSMock) GetLastAssumeRoleInput() *sts.AssumeRoleInput
- type SignalingChannel
- type TableDetails
- type Things
- type UpdateOp
- type UserState
Constants ¶
This section is empty.
Variables ¶
var HandlerMap = map[string]HandlerFunc{
"test_bulk_container": testBulkContainerHandler,
}
var LambdaHandlerMap = make(map[string]LambdaHandler)
var MockLambdaClient = &LambdaMock{}
Functions ¶
func CompareAttributeValues ¶
func CompareAttributeValues(val1, val2 types.AttributeValue) int
CompareAttributeValues compares two DynamoDB attribute values Returns: -1 if val1 < val2, 0 if equal, 1 if val1 > val2
func ExtractKeys ¶
func IsEqual ¶
func IsEqual(av1, av2 types.AttributeValue) bool
IsEqual checks if two DynamoDB attribute values are equal
func PrintAttributeValueMap ¶
func PrintAttributeValueMap(av map[string]types.AttributeValue)
func SorN ¶
func SorN(av types.AttributeValue) *string
Types ¶
type AuthSession ¶
type AuthSession struct {
Username string
UserPoolID string
ClientID string
AccessToken string
RefreshToken string
IDToken string
ExpiresAt time.Time
}
AuthSession represents an active authentication session
type AwsMetadata ¶
type AwsNodeShadow ¶
type AwsNodeShadow struct {
State *AwsShadowState `json:"state,omitempty"`
Metadata *AwsMetadata `json:"metadata,omitempty"`
Version *int `json:"version,omitempty"`
Timestamp *int `json:"timestamp,omitempty"`
}
type AwsShadowState ¶
type Certificate ¶
type Certificate struct {
Arn string
Status types.CertificateStatus
Cert string
}
type CognitoIdentityMock ¶
type CognitoIdentityMock struct {
// Map of Cognito tokens to Identity IDs
TokenToIdentityMap map[string]string
// Map of Identity IDs to Credentials
IdentityToCredentialsMap map[string]*types.Credentials
// Store the last GetId input for testing
LastGetIdInput *cognitoidentity.GetIdInput
// Store the last GetCredentialsForIdentity input for testing
LastGetCredentialsInput *cognitoidentity.GetCredentialsForIdentityInput
// contains filtered or unexported fields
}
func NewCognitoIdentityMock ¶
func NewCognitoIdentityMock() *CognitoIdentityMock
func (*CognitoIdentityMock) AddCredentialsMapping ¶
func (m *CognitoIdentityMock) AddCredentialsMapping(identityId string, credentials *types.Credentials)
Helper method to set up identity to credentials mappings for testing
func (*CognitoIdentityMock) AddTokenMapping ¶
func (m *CognitoIdentityMock) AddTokenMapping(token, identityId string)
Helper method to set up token to identity mappings for testing
func (*CognitoIdentityMock) GetCredentialsForIdentity ¶
func (m *CognitoIdentityMock) GetCredentialsForIdentity(ctx context.Context, params *cognitoidentity.GetCredentialsForIdentityInput, optFns ...func(*cognitoidentity.Options)) (*cognitoidentity.GetCredentialsForIdentityOutput, error)
func (*CognitoIdentityMock) GetId ¶
func (m *CognitoIdentityMock) GetId(ctx context.Context, params *cognitoidentity.GetIdInput, optFns ...func(*cognitoidentity.Options)) (*cognitoidentity.GetIdOutput, error)
func (*CognitoIdentityMock) GetLastGetCredentialsInput ¶
func (m *CognitoIdentityMock) GetLastGetCredentialsInput() *cognitoidentity.GetCredentialsForIdentityInput
GetLastGetCredentialsInput returns the last GetCredentialsForIdentityInput used in a GetCredentialsForIdentity call
type CognitoProviderMock ¶
type CognitoProviderMock struct {
// Pool and client management
Pools map[string]map[string]cognitoidentityprovider.UpdateUserPoolClientInput // key: user_pool_id -> client_id
// User state management
Sessions map[string]map[string]map[string]*AuthSession // key: user_pool_id -> client_id -> access_token
// Alias indexes for O(1) lookups (supporting Cognito aliases)
Users map[string]map[string]*UserState // key: user_pool_id -> username
UsersByEmail map[string]map[string]*UserState // key: user_pool_id -> email -> user
UsersByPhone map[string]map[string]*UserState // key: user_pool_id -> phone -> user
// Error injection for testing
DescribeUserPoolClientError error
UpdateUserPoolClientError error
SignUpError error
ConfirmSignUpError error
InitiateAuthError error
IDTokenMinter func(user *UserState) string
RespondToAuthChallengeError error
ForgotPasswordError error
ConfirmForgotPasswordError error
ChangePasswordError error
RevokeTokenError error
GetUserError error
GlobalSignOutError error
AdminGetUserError error
AdminCreateUserError error
AdminSetUserPasswordError error
AdminUpdateUserAttributesError error
ResendConfirmationCodeError error
// Configuration
DefaultConfirmationCode string
DefaultResetCode string
TokenExpirationMinutes int
DefaultUserPoolID string
// contains filtered or unexported fields
}
func NewCognitoProviderMock ¶
func NewCognitoProviderMock() *CognitoProviderMock
NewCognitoProviderMock creates a new stateful Cognito provider mock
func (*CognitoProviderMock) AddTestUserDirect ¶
func (m *CognitoProviderMock) AddTestUserDirect(userPoolID, username, email, password string, confirmed bool) *UserState
AddTestUserDirect adds a pre-configured user for testing
func (*CognitoProviderMock) AddTestUserPoolDirect ¶
func (m *CognitoProviderMock) AddTestUserPoolDirect(userPoolID, clientID string)
func (*CognitoProviderMock) AdminCreateUser ¶
func (m *CognitoProviderMock) AdminCreateUser(ctx context.Context, params *cognitoidentityprovider.AdminCreateUserInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.AdminCreateUserOutput, error)
AdminCreateUser creates a new user in Cognito user pool using admin privileges
func (*CognitoProviderMock) AdminGetUser ¶
func (m *CognitoProviderMock) AdminGetUser(ctx context.Context, params *cognitoidentityprovider.AdminGetUserInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.AdminGetUserOutput, error)
AdminGetUser retrieves user information using admin privileges
func (*CognitoProviderMock) AdminSetUserPassword ¶
func (m *CognitoProviderMock) AdminSetUserPassword(ctx context.Context, params *cognitoidentityprovider.AdminSetUserPasswordInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.AdminSetUserPasswordOutput, error)
AdminSetUserPassword sets a permanent password for a user using admin privileges
func (*CognitoProviderMock) AdminUpdateUserAttributes ¶
func (m *CognitoProviderMock) AdminUpdateUserAttributes(ctx context.Context, params *cognitoidentityprovider.AdminUpdateUserAttributesInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.AdminUpdateUserAttributesOutput, error)
AdminUpdateUserAttributes updates user attributes using admin privileges
func (*CognitoProviderMock) ChangePassword ¶
func (m *CognitoProviderMock) ChangePassword(ctx context.Context, params *cognitoidentityprovider.ChangePasswordInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.ChangePasswordOutput, error)
ChangePassword changes user password with stateful validation
func (*CognitoProviderMock) ConfirmForgotPassword ¶
func (m *CognitoProviderMock) ConfirmForgotPassword(ctx context.Context, params *cognitoidentityprovider.ConfirmForgotPasswordInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.ConfirmForgotPasswordOutput, error)
ConfirmForgotPassword completes password reset with stateful validation
func (*CognitoProviderMock) ConfirmSignUp ¶
func (m *CognitoProviderMock) ConfirmSignUp(ctx context.Context, params *cognitoidentityprovider.ConfirmSignUpInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.ConfirmSignUpOutput, error)
ConfirmSignUp confirms user signup with stateful validation Supports username, email, or phone as identifier (alias support)
func (*CognitoProviderMock) DescribeUserPoolClient ¶
func (m *CognitoProviderMock) DescribeUserPoolClient(ctx context.Context, params *cognitoidentityprovider.DescribeUserPoolClientInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.DescribeUserPoolClientOutput, error)
func (*CognitoProviderMock) ForgotPassword ¶
func (m *CognitoProviderMock) ForgotPassword(ctx context.Context, params *cognitoidentityprovider.ForgotPasswordInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.ForgotPasswordOutput, error)
ForgotPassword initiates password reset with stateful code generation
func (*CognitoProviderMock) GetSessionByRefreshToken ¶
func (m *CognitoProviderMock) GetSessionByRefreshToken(refreshToken string) *AuthSession
GetSessionByRefreshToken retrieves a session by refresh token
func (*CognitoProviderMock) GetSessionByToken ¶
func (m *CognitoProviderMock) GetSessionByToken(token string) *AuthSession
GetSessionByToken retrieves a session by access token
func (*CognitoProviderMock) GetUser ¶
func (m *CognitoProviderMock) GetUser(ctx context.Context, params *cognitoidentityprovider.GetUserInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.GetUserOutput, error)
GetUser retrieves user information using access token with stateful validation
func (*CognitoProviderMock) GetUserByUsername ¶
func (m *CognitoProviderMock) GetUserByUsername(userPoolID, username string) *UserState
GetUserByUsername retrieves a user by username from a specific user pool
func (*CognitoProviderMock) GlobalSignOut ¶
func (m *CognitoProviderMock) GlobalSignOut(ctx context.Context, params *cognitoidentityprovider.GlobalSignOutInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.GlobalSignOutOutput, error)
GlobalSignOut signs out user from all devices by deleting all their sessions
func (*CognitoProviderMock) InitiateAuth ¶
func (m *CognitoProviderMock) InitiateAuth(ctx context.Context, params *cognitoidentityprovider.InitiateAuthInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.InitiateAuthOutput, error)
InitiateAuth handles authentication with stateful session management Supports both USER_PASSWORD_AUTH and REFRESH_TOKEN_AUTH flows
func (*CognitoProviderMock) RegisterSessionForToken ¶
func (m *CognitoProviderMock) RegisterSessionForToken(accessToken, userPoolID, clientID, username string) error
RegisterSessionForToken creates a session for a given access token This is useful for test scenarios where JWT tokens are created directly without going through InitiateAuth
func (*CognitoProviderMock) ResendConfirmationCode ¶
func (m *CognitoProviderMock) ResendConfirmationCode(ctx context.Context, params *cognitoidentityprovider.ResendConfirmationCodeInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.ResendConfirmationCodeOutput, error)
func (*CognitoProviderMock) RespondToAuthChallenge ¶
func (m *CognitoProviderMock) RespondToAuthChallenge(ctx context.Context, params *cognitoidentityprovider.RespondToAuthChallengeInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error)
RespondToAuthChallenge handles authentication challenges with stateful tracking
func (*CognitoProviderMock) RevokeToken ¶
func (m *CognitoProviderMock) RevokeToken(ctx context.Context, params *cognitoidentityprovider.RevokeTokenInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.RevokeTokenOutput, error)
RevokeToken revokes a refresh token by deleting the session
func (*CognitoProviderMock) SetErrorForMethod ¶
func (m *CognitoProviderMock) SetErrorForMethod(method string, err error)
SetErrorForMethod sets an error to be returned by a specific method
func (*CognitoProviderMock) SignUp ¶
func (m *CognitoProviderMock) SignUp(ctx context.Context, params *cognitoidentityprovider.SignUpInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.SignUpOutput, error)
SignUp creates a new user in the mock with stateful tracking
func (*CognitoProviderMock) UpdateUserPoolClient ¶
func (m *CognitoProviderMock) UpdateUserPoolClient(ctx context.Context, params *cognitoidentityprovider.UpdateUserPoolClientInput, optFns ...func(*cognitoidentityprovider.Options)) (*cognitoidentityprovider.UpdateUserPoolClientOutput, error)
type DBItem ¶
type DBItem map[string]types.AttributeValue
type DynamoDBMock ¶
type DynamoDBMock struct {
PutItemErr error
// MaxPageItems caps how many items one Query returns, standing in for the service's 1 MB
// page cap so tests can exercise a multi-page read. Zero (the default) means unlimited.
MaxPageItems int
// Returned once on the next matching call, then cleared.
NextDescribeError error
NextUpdateError error
NextGetItemError error
// If > 0, the next BatchGetItem call returns the last N keys as UnprocessedKeys
// instead of processing them, then resets to 0.
NextBatchGetUnprocessedCount int
// If > 0, the next BatchWriteItem call returns the last N requests as UnprocessedItems
// instead of applying them, then decrements by one so a caller that retries eventually
// drains. The real service answers 200 with UnprocessedItems when it throttles part of a
// batch, so without this the mock cannot express a partially-applied batch write and a
// caller that discards the response looks correct.
NextBatchWriteUnprocessedCount int
// contains filtered or unexported fields
}
DynamoDBMock is a mock implementation of the DynamoDB interface
func NewDynamoDBMock ¶
func NewDynamoDBMock() *DynamoDBMock
func (*DynamoDBMock) AddSecondaryIndex ¶
func (m *DynamoDBMock) AddSecondaryIndex(indexName, tableName, primaryKey, sortKey string) error
func (*DynamoDBMock) AddTable ¶
func (m *DynamoDBMock) AddTable(name, primaryKey string, sortKey string)
func (*DynamoDBMock) BatchGetItem ¶
func (m *DynamoDBMock) BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
func (*DynamoDBMock) BatchWriteItem ¶
func (m *DynamoDBMock) BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
func (*DynamoDBMock) DeleteItem ¶
func (m *DynamoDBMock) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
func (*DynamoDBMock) DescribeTable ¶
func (m *DynamoDBMock) DescribeTable(_ context.Context, in *dynamodb.DescribeTableInput, _ ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
func (*DynamoDBMock) ForEachRow ¶
func (m *DynamoDBMock) ForEachRow(table string, fn func(map[string]types.AttributeValue) error) error
ForEachRow iterates over all the rows in the DynamoDBMock and executes the closure fn
func (*DynamoDBMock) GSIStatus ¶
func (m *DynamoDBMock) GSIStatus(table, indexName string) types.IndexStatus
func (*DynamoDBMock) GetDirect ¶
func (m *DynamoDBMock) GetDirect(tableName, pkey, skey string, out interface{}) error
GetDirect returns the item from the DynamoDBMock without going through the GetItem API
func (*DynamoDBMock) GetItem ¶
func (m *DynamoDBMock) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
func (*DynamoDBMock) GetKeys ¶
func (m *DynamoDBMock) GetKeys(item interface{}) (string, string, string, error)
func (*DynamoDBMock) HasGSI ¶
func (m *DynamoDBMock) HasGSI(table, indexName string) bool
func (*DynamoDBMock) ProfileGet ¶
func (m *DynamoDBMock) ProfileGet() Profile
func (*DynamoDBMock) ProfileReset ¶
func (m *DynamoDBMock) ProfileReset()
func (*DynamoDBMock) PutDirect ¶
func (m *DynamoDBMock) PutDirect(tableName, pkey, skey string, item interface{}) error
PutDirect puts the item into the DynamoDBMock without going through the PutItem API
func (*DynamoDBMock) PutItem ¶
func (m *DynamoDBMock) PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
func (*DynamoDBMock) Query ¶
func (m *DynamoDBMock) Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
func (*DynamoDBMock) QueryInternal ¶
func (m *DynamoDBMock) QueryInternal(input *dynamodb.QueryInput) (*dynamodb.QueryOutput, error)
func (*DynamoDBMock) Scan ¶
func (m *DynamoDBMock) Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
func (*DynamoDBMock) ScanInternal ¶
func (m *DynamoDBMock) ScanInternal(input *dynamodb.ScanInput) (*dynamodb.ScanOutput, error)
The real service leaves Scan order unspecified, but a cursor needs a stable position to resume from, so the mock scans in key order. Treat that order as an implementation detail: assert on the set a Scan returns, never on its sequence.
func (*DynamoDBMock) SetIndexProjection ¶
func (m *DynamoDBMock) SetIndexProjection(indexName string, projection types.ProjectionType, nonKeyAttributes ...string) error
SetIndexProjection narrows what a query through the index returns. Indexes default to ALL, so a test only calls this when the real index is KEYS_ONLY or INCLUDE and the code under test must not see the unprojected attributes.
func (*DynamoDBMock) UpdateItem ¶
func (m *DynamoDBMock) UpdateItem(ctx context.Context, input *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
func (*DynamoDBMock) UpdateTable ¶
func (m *DynamoDBMock) UpdateTable(_ context.Context, in *dynamodb.UpdateTableInput, _ ...func(*dynamodb.Options)) (*dynamodb.UpdateTableOutput, error)
func (*DynamoDBMock) WithGSI ¶
func (m *DynamoDBMock) WithGSI(table, indexName, hashKey, sortKey string, status types.IndexStatus) *DynamoDBMock
WithGSI: sortKey == "" for hash-only; projection is ALL. Use WithGSIDescription for non-default projection / NonKeyAttributes.
func (*DynamoDBMock) WithGSIDescription ¶
func (m *DynamoDBMock) WithGSIDescription(table string, gsi types.GlobalSecondaryIndexDescription) *DynamoDBMock
func (*DynamoDBMock) WithTable ¶
func (m *DynamoDBMock) WithTable(name string, status types.TableStatus) *DynamoDBMock
type ECSClientMock ¶
type ECSClientMock struct{}
func NewECSClientMock ¶
func NewECSClientMock() *ECSClientMock
func (*ECSClientMock) RunTask ¶
func (m *ECSClientMock) RunTask(ctx context.Context, params *ecs.RunTaskInput, optFns ...func(*ecs.Options)) (*ecs.RunTaskOutput, error)
type HandlerFunc ¶
type HandlerFunc func() error
type IndexDetails ¶
type IndexDetails struct {
TableName string
PrimaryKey string
SortKey string
// Projection defaults to ALL; SetIndexProjection narrows it to what the real index would carry.
Projection types.ProjectionType
NonKeyAttributes []string
}
IndexDetails is the key schema of a secondary index. The sort key can differ from the base table's, so a query through the index has to order and paginate by these, not by the table's.
type IoTClientMock ¶
type IoTClientMock struct {
// Key is the thing name
Things map[string]Things
// Key is the certificate ID
Certificates map[string]Certificate
// Track thing group memberships - Key is group name, value is list of thing names
ThingGroups map[string][]string
// Track thing group parent relationships - Key is child group name, value is parent group name
ThingGroupParents map[string]string
// Track policy attachments - Key is target (cert ARN), value is list of policy names
AttachedPolicies map[string][]string
// Track topic-rule payloads for the GetTopicRule / ReplaceTopicRule mock — Key is rule name
TopicRules map[string]*types.TopicRulePayload
// Error forcing flags
ForceThingCreationError bool
ForcePolicyAttachmentError bool
ForceGroupAdditionError bool
ForceGroupCreationError bool
ForceCertificateError bool
ForceCertAttachmentError bool
// contains filtered or unexported fields
}
func NewIoTClientMock ¶
func NewIoTClientMock() *IoTClientMock
func (*IoTClientMock) AddThingToThingGroup ¶
func (m *IoTClientMock) AddThingToThingGroup(ctx context.Context, params *iot.AddThingToThingGroupInput, optFns ...func(*iot.Options)) (*iot.AddThingToThingGroupOutput, error)
func (*IoTClientMock) AttachPolicy ¶
func (m *IoTClientMock) AttachPolicy(ctx context.Context, params *iot.AttachPolicyInput, optFns ...func(*iot.Options)) (*iot.AttachPolicyOutput, error)
func (*IoTClientMock) AttachThingPrincipal ¶
func (m *IoTClientMock) AttachThingPrincipal(ctx context.Context, params *iot.AttachThingPrincipalInput, optFns ...func(*iot.Options)) (*iot.AttachThingPrincipalOutput, error)
func (*IoTClientMock) CreateThing ¶
func (m *IoTClientMock) CreateThing(ctx context.Context, params *iot.CreateThingInput, optFns ...func(*iot.Options)) (*iot.CreateThingOutput, error)
func (*IoTClientMock) CreateThingGroup ¶
func (m *IoTClientMock) CreateThingGroup(ctx context.Context, params *iot.CreateThingGroupInput, optFns ...func(*iot.Options)) (*iot.CreateThingGroupOutput, error)
func (*IoTClientMock) DeleteCertificate ¶
func (m *IoTClientMock) DeleteCertificate(ctx context.Context, params *iot.DeleteCertificateInput, optFns ...func(*iot.Options)) (*iot.DeleteCertificateOutput, error)
func (*IoTClientMock) DeleteThing ¶
func (m *IoTClientMock) DeleteThing(ctx context.Context, params *iot.DeleteThingInput, optFns ...func(*iot.Options)) (*iot.DeleteThingOutput, error)
func (*IoTClientMock) DescribeCertificate ¶
func (m *IoTClientMock) DescribeCertificate(ctx context.Context, params *iot.DescribeCertificateInput, optFns ...func(*iot.Options)) (*iot.DescribeCertificateOutput, error)
func (*IoTClientMock) DescribeThing ¶
func (m *IoTClientMock) DescribeThing(ctx context.Context, params *iot.DescribeThingInput, optFns ...func(*iot.Options)) (*iot.DescribeThingOutput, error)
func (*IoTClientMock) DescribeThingGroup ¶
func (m *IoTClientMock) DescribeThingGroup(ctx context.Context, params *iot.DescribeThingGroupInput, optFns ...func(*iot.Options)) (*iot.DescribeThingGroupOutput, error)
func (*IoTClientMock) DetachThingPrincipal ¶
func (m *IoTClientMock) DetachThingPrincipal(ctx context.Context, params *iot.DetachThingPrincipalInput, optFns ...func(*iot.Options)) (*iot.DetachThingPrincipalOutput, error)
func (*IoTClientMock) FindCertificateByPEMDirect ¶
func (m *IoTClientMock) FindCertificateByPEMDirect(certPEM string) (*Certificate, string, bool)
FindCertificateByPEMDirect finds a certificate by its PEM content
func (*IoTClientMock) GetAttachedPolicies ¶
func (m *IoTClientMock) GetAttachedPolicies(target string) []string
GetAttachedPolicies returns the list of policy names attached to a target (cert ARN).
func (*IoTClientMock) GetCertificateDirect ¶
func (m *IoTClientMock) GetCertificateDirect(certID string) (*Certificate, bool)
GetCertificateDirect retrieves a certificate by ID directly from the mock
func (*IoTClientMock) GetCertificatesDirect ¶
func (m *IoTClientMock) GetCertificatesDirect() map[string]Certificate
GetCertificatesDirect returns all certificates in the mock
func (*IoTClientMock) GetThingAttributeDirect ¶
func (m *IoTClientMock) GetThingAttributeDirect(thingName, attributeKey string) (string, bool)
GetThingAttributeDirect retrieves a specific attribute value for a thing
func (*IoTClientMock) GetThingDirect ¶
func (m *IoTClientMock) GetThingDirect(thingName string) (*Things, bool)
GetThingDirect retrieves a thing directly from the mock
func (*IoTClientMock) GetThingGroupsDirect ¶
func (m *IoTClientMock) GetThingGroupsDirect(thingName string) []string
GetThingGroupsDirect returns the groups that a thing belongs to
func (*IoTClientMock) GetThingsDirect ¶
func (m *IoTClientMock) GetThingsDirect() map[string]Things
GetThingsDirect returns all things in the mock
func (*IoTClientMock) GetTopicRule ¶
func (m *IoTClientMock) GetTopicRule(ctx context.Context, params *iot.GetTopicRuleInput, optFns ...func(*iot.Options)) (*iot.GetTopicRuleOutput, error)
func (*IoTClientMock) GetTopicRuleDirect ¶
func (m *IoTClientMock) GetTopicRuleDirect(ruleName string) (*types.TopicRulePayload, bool)
GetTopicRuleDirect retrieves a stored topic rule payload by name.
func (*IoTClientMock) ListThingGroups ¶
func (m *IoTClientMock) ListThingGroups(ctx context.Context, params *iot.ListThingGroupsInput, optFns ...func(*iot.Options)) (*iot.ListThingGroupsOutput, error)
func (*IoTClientMock) ListThingPrincipals ¶
func (m *IoTClientMock) ListThingPrincipals(ctx context.Context, params *iot.ListThingPrincipalsInput, optFns ...func(*iot.Options)) (*iot.ListThingPrincipalsOutput, error)
func (*IoTClientMock) Print ¶
func (m *IoTClientMock) Print()
func (*IoTClientMock) RegisterCertificateWithoutCA ¶
func (m *IoTClientMock) RegisterCertificateWithoutCA(ctx context.Context, params *iot.RegisterCertificateWithoutCAInput, optFns ...func(*iot.Options)) (*iot.RegisterCertificateWithoutCAOutput, error)
func (*IoTClientMock) ReplaceTopicRule ¶
func (m *IoTClientMock) ReplaceTopicRule(ctx context.Context, params *iot.ReplaceTopicRuleInput, optFns ...func(*iot.Options)) (*iot.ReplaceTopicRuleOutput, error)
func (*IoTClientMock) SetTopicRuleDirect ¶
func (m *IoTClientMock) SetTopicRuleDirect(ruleName string, payload *types.TopicRulePayload)
SetTopicRuleDirect stores a topic rule payload by name for tests of the IoT-event-mode admin API.
func (*IoTClientMock) UpdateCertificate ¶
func (m *IoTClientMock) UpdateCertificate(ctx context.Context, params *iot.UpdateCertificateInput, optFns ...func(*iot.Options)) (*iot.UpdateCertificateOutput, error)
func (*IoTClientMock) UpdateThing ¶
func (m *IoTClientMock) UpdateThing(ctx context.Context, params *iot.UpdateThingInput, optFns ...func(*iot.Options)) (*iot.UpdateThingOutput, error)
func (*IoTClientMock) VerifyCertificateActive ¶
func (m *IoTClientMock) VerifyCertificateActive(certPEM string) bool
VerifyCertificateActive checks if a certificate is active in the mock by PEM content
func (*IoTClientMock) VerifyCertificateExists ¶
func (m *IoTClientMock) VerifyCertificateExists(certPEM string) bool
VerifyCertificateExists checks if a certificate exists in the mock by PEM content
func (*IoTClientMock) VerifyThingExists ¶
func (m *IoTClientMock) VerifyThingExists(thingName string) bool
VerifyThingExists checks if a thing exists in the mock
func (*IoTClientMock) VerifyThingHasCertificate ¶
func (m *IoTClientMock) VerifyThingHasCertificate(thingName string, certPEM string) bool
VerifyThingHasCertificate checks if a thing has a certificate attached
func (*IoTClientMock) VerifyThingInGroup ¶
func (m *IoTClientMock) VerifyThingInGroup(thingName string, groupName string) bool
VerifyThingInGroup checks if a thing is in a specific group
func (*IoTClientMock) VerifyThingInGroups ¶
func (m *IoTClientMock) VerifyThingInGroups(thingName string, groupNames []string) bool
VerifyThingInGroups checks if a thing is in all the specified groups
type IoTDataPlaneMock ¶
type IoTDataPlaneMock struct {
// Shadows stores the shadow data for each thing
// The first key is the thing name, the second key is the shadow name
Shadows map[string]map[string][]byte
// PublishCalls stores the parameters of Publish calls
PublishCalls []iotdataplane.PublishInput
// contains filtered or unexported fields
}
IoTDataPlaneMock is a mock implementation of the IoT Data Plane client
func NewIoTDataPlaneMock ¶
func NewIoTDataPlaneMock() *IoTDataPlaneMock
NewIoTDataPlaneMock creates a new IoTDataPlaneMock
func (*IoTDataPlaneMock) AddDirect ¶
func (m *IoTDataPlaneMock) AddDirect(thingName, shadowName string, payload []byte)
AddDirect directly adds a shadow to the mock storage
func (*IoTDataPlaneMock) DeleteThingShadow ¶
func (m *IoTDataPlaneMock) DeleteThingShadow(ctx context.Context, params *iotdataplane.DeleteThingShadowInput, optFns ...func(*iotdataplane.Options)) (*iotdataplane.DeleteThingShadowOutput, error)
func (*IoTDataPlaneMock) GetDirect ¶
func (m *IoTDataPlaneMock) GetDirect(thingName, shadowName string) ([]byte, error)
GetDirect directly retrieves a shadow from the mock storage
func (*IoTDataPlaneMock) GetNamedShadowNames ¶
func (m *IoTDataPlaneMock) GetNamedShadowNames(thingName string) []string
func (*IoTDataPlaneMock) GetThingShadow ¶
func (m *IoTDataPlaneMock) GetThingShadow(ctx context.Context, params *iotdataplane.GetThingShadowInput, optFns ...func(*iotdataplane.Options)) (*iotdataplane.GetThingShadowOutput, error)
GetThingShadow mocks the GetThingShadow operation
func (*IoTDataPlaneMock) Print ¶
func (m *IoTDataPlaneMock) Print()
func (*IoTDataPlaneMock) Publish ¶
func (m *IoTDataPlaneMock) Publish(ctx context.Context, params *iotdataplane.PublishInput, optFns ...func(*iotdataplane.Options)) (*iotdataplane.PublishOutput, error)
Publish mocks the Publish operation
func (*IoTDataPlaneMock) UpdateThingShadow ¶
func (m *IoTDataPlaneMock) UpdateThingShadow(ctx context.Context, params *iotdataplane.UpdateThingShadowInput, optFns ...func(*iotdataplane.Options)) (*iotdataplane.UpdateThingShadowOutput, error)
UpdateThingShadow mocks the UpdateThingShadow operation
func (*IoTDataPlaneMock) VerifyTags ¶
func (m *IoTDataPlaneMock) VerifyTags(nodeID string, adminTags, deviceTags, userTags map[string]string) bool
type KVSClientMock ¶
type KVSClientMock struct {
// Key is the channel name
Channels map[string]SignalingChannel
// Error forcing flags
ForceCreateError bool
ForceDescribeError bool
// contains filtered or unexported fields
}
func NewKVSClientMock ¶
func NewKVSClientMock() *KVSClientMock
func (*KVSClientMock) CreateSignalingChannel ¶
func (m *KVSClientMock) CreateSignalingChannel(ctx context.Context, params *kinesisvideo.CreateSignalingChannelInput, optFns ...func(*kinesisvideo.Options)) (*kinesisvideo.CreateSignalingChannelOutput, error)
func (*KVSClientMock) DescribeSignalingChannel ¶
func (m *KVSClientMock) DescribeSignalingChannel(ctx context.Context, params *kinesisvideo.DescribeSignalingChannelInput, optFns ...func(*kinesisvideo.Options)) (*kinesisvideo.DescribeSignalingChannelOutput, error)
func (*KVSClientMock) GetChannelDirect ¶
func (m *KVSClientMock) GetChannelDirect(channelName string) (*SignalingChannel, bool)
GetChannelDirect retrieves a channel directly from the mock for testing
type LambdaMock ¶
type LambdaMock struct {
AddPermissionError error
RemovePermissionError error
Permissions map[string]lambda.AddPermissionInput
InvokeError error
InvokeCalls []lambda.InvokeInput
}
func NewLambdaMock ¶
func NewLambdaMock() *LambdaMock
func (*LambdaMock) AddPermission ¶
func (m *LambdaMock) AddPermission(ctx context.Context, params *lambda.AddPermissionInput, optFns ...func(*lambda.Options)) (*lambda.AddPermissionOutput, error)
func (*LambdaMock) Invoke ¶
func (m *LambdaMock) Invoke(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error)
func (*LambdaMock) RemovePermission ¶
func (m *LambdaMock) RemovePermission(ctx context.Context, params *lambda.RemovePermissionInput, optFns ...func(*lambda.Options)) (*lambda.RemovePermissionOutput, error)
type Mexpression ¶
type Mexpression struct {
// This could be a KeyCondition, Filter, UpdateExpr or a Projection :-/ maybe we need to split this up
Expr *string
Names map[string]string
Values map[string]types.AttributeValue
// contains filtered or unexported fields
}
We simply need to define ways to 'evaluate' the expression for a given AttributeValue
func NewMexpression ¶
func NewMexpression(Expr *string, Names map[string]string, Values map[string]types.AttributeValue) *Mexpression
NewMexpression creates a new mock expression
func (*Mexpression) Evaluate ¶
func (e *Mexpression) Evaluate(av map[string]types.AttributeValue) (bool, error)
Evaluate reports whether the item satisfies the condition. An expression the parser cannot handle is an error, never a silent true: a predicate that matches every row turns a filtered read into an unfiltered one that still looks successful.
func (*Mexpression) GetNamesList ¶
func (e *Mexpression) GetNamesList() []string
GetNamesList returns the list of names in the expression, if the expression is a NamesList
func (*Mexpression) PinsPartitionKey ¶
func (e *Mexpression) PinsPartitionKey(partitionKey string) bool
PinsPartitionKey reports whether the key condition fixes the partition key with "=", which DynamoDB requires of every Query. Without it a Query would be a scan, and the service rejects the request rather than running it.
func (*Mexpression) ProcessUpdate ¶
func (e *Mexpression) ProcessUpdate(f func(UpdateOp, string, types.AttributeValue)) error
ProcessUpdate processes the update expression, if the expression is an UpdateExpr The function f is called for each update operation, with the operation type, the name of the attribute and the value In the case of 'Set', the function is repeatedly called for every attribute being set, and a 'SetDone' is called to indicate that all 'Set' operations are done
syntax:
update-expression ::=
[ SET action [, action] ... ] [ REMOVE action [, action] ...] [ ADD action [, action] ... ] [ DELETE action [, action] ...]
type MockHTTPClient ¶
MockHTTPClient is a mock implementation of the HTTPClient interface
func NewMockHTTPClient ¶
func NewMockHTTPClient() *MockHTTPClient
NewMockHTTPClient creates a new instance of MockHTTPClient with an empty response map
func (*MockHTTPClient) Get ¶
func (c *MockHTTPClient) Get(url string) (*http.Response, error)
Get is a dummy implementation for the Get method
func (*MockHTTPClient) Head ¶
func (c *MockHTTPClient) Head(url string) (*http.Response, error)
Head is a dummy implementation for the Head method
func (*MockHTTPClient) RegisterResponse ¶
func (c *MockHTTPClient) RegisterResponse(url, method string, statusCode int, responseBody interface{}) error
RegisterResponse registers a response for a specific URL and HTTP method
type MockKMS ¶
type MockKMS struct {
// Call capture, so tests can assert the signing parameters rather than
// trusting that the right algorithm was requested.
SignCalls []kms.SignInput
SignError error
GetPublicKeyError error
// contains filtered or unexported fields
}
MockKMS emulates the two KMS calls the signers use, backed by a real in-memory key per key ID: P-256 for certificates, RSA for tokens.
It signs for real rather than returning a canned blob: the issuer's output is an X.509 certificate, and a certificate signed with a fake signature cannot be verified. Real signing lets tests assert what actually matters — that the issued chain verifies — instead of only that some bytes were produced.
func NewMockKMS ¶
func NewMockKMS() *MockKMS
func NewMockRSAKMS ¶
func NewMockRSAKMS(keyID string) (*MockKMS, *rsa.PrivateKey)
NewMockRSAKMS returns a mock holding one freshly generated RSA key under keyID, alongside the key itself so a caller can build the JWKS this mock will sign against.
func (*MockKMS) AddKey ¶
func (m *MockKMS) AddKey(keyID string) *ecdsa.PrivateKey
AddKey creates an ECDSA P-256 key under keyID and returns it, so a test can independently verify signatures the mock produced.
func (*MockKMS) AddRSAKeyWith ¶
func (m *MockKMS) AddRSAKeyWith(keyID string, key *rsa.PrivateKey) *rsa.PrivateKey
AddRSAKeyWith registers an RSA key under keyID, generating one when key is nil. A caller that passes its own key can verify signatures against a JWKS it already holds.
func (*MockKMS) GetPublicKey ¶
func (m *MockKMS) GetPublicKey(ctx context.Context, params *kms.GetPublicKeyInput, optFns ...func(*kms.Options)) (*kms.GetPublicKeyOutput, error)
type MockS3PresignClient ¶
type MockS3PresignClient struct {
}
MockS3PresignClient is a mock implementation of the S3PresignClientInterface
func NewS3PresignClientMock ¶
func NewS3PresignClientMock() *MockS3PresignClient
func (*MockS3PresignClient) PresignGetObject ¶
func (m *MockS3PresignClient) PresignGetObject(ctx context.Context, input *s3.GetObjectInput, optFns ...func(*s3.PresignOptions)) (*v4.PresignedHTTPRequest, error)
PresignGetObject mocks the PresignGetObject method. Unlike the put path it does not touch the object store — signing a download URL is a read-only operation and does not require the object to already exist in the mock.
func (*MockS3PresignClient) PresignPutObject ¶
func (m *MockS3PresignClient) PresignPutObject(ctx context.Context, input *s3.PutObjectInput, optFns ...func(*s3.PresignOptions)) (*v4.PresignedHTTPRequest, error)
PresignPutObject mocks the PresignPutObject method
type MockSES ¶
type MockSES struct {
Identities map[string]types.IdentityInfo
SentEmails []*sesv2.SendEmailInput
ProductionAccessEnabled bool
ReviewPending bool
SendEmailError error
CreateEmailIdentityError error
GetEmailIdentityError error
ListEmailIdentitiesError error
DeleteEmailIdentityError error
GetAccountError error
PutAccountDetailsError error
// contains filtered or unexported fields
}
MockSES is an in-memory SESClientInterface for tests; SendEmail is a no-op recorder.
func NewMockSES ¶
func NewMockSES() *MockSES
func (*MockSES) CreateEmailIdentity ¶
func (m *MockSES) CreateEmailIdentity(ctx context.Context, params *sesv2.CreateEmailIdentityInput, optFns ...func(*sesv2.Options)) (*sesv2.CreateEmailIdentityOutput, error)
func (*MockSES) DeleteEmailIdentity ¶
func (m *MockSES) DeleteEmailIdentity(ctx context.Context, params *sesv2.DeleteEmailIdentityInput, optFns ...func(*sesv2.Options)) (*sesv2.DeleteEmailIdentityOutput, error)
func (*MockSES) GetAccount ¶
func (m *MockSES) GetAccount(ctx context.Context, params *sesv2.GetAccountInput, optFns ...func(*sesv2.Options)) (*sesv2.GetAccountOutput, error)
func (*MockSES) GetEmailIdentity ¶
func (m *MockSES) GetEmailIdentity(ctx context.Context, params *sesv2.GetEmailIdentityInput, optFns ...func(*sesv2.Options)) (*sesv2.GetEmailIdentityOutput, error)
func (*MockSES) ListEmailIdentities ¶
func (m *MockSES) ListEmailIdentities(ctx context.Context, params *sesv2.ListEmailIdentitiesInput, optFns ...func(*sesv2.Options)) (*sesv2.ListEmailIdentitiesOutput, error)
func (*MockSES) PutAccountDetails ¶
func (m *MockSES) PutAccountDetails(ctx context.Context, params *sesv2.PutAccountDetailsInput, optFns ...func(*sesv2.Options)) (*sesv2.PutAccountDetailsOutput, error)
func (*MockSES) SendEmail ¶
func (m *MockSES) SendEmail(ctx context.Context, params *sesv2.SendEmailInput, optFns ...func(*sesv2.Options)) (*sesv2.SendEmailOutput, error)
func (*MockSES) SetVerified ¶
SetVerified simulates the owner following SES's verification link.
type MockSSM ¶
type MockSSM struct {
Parameters map[string]*types.Parameter
DeletedParameters []string
PutParameterError error
// GetParameterError fails every read; GetParameterErrors fails only the named parameters, for
// tests that must break one read while leaving the rest of a handler's SSM reads working.
GetParameterError error
GetParameterErrors map[string]error
GetParametersByPathError error
DeleteParameterError error
// contains filtered or unexported fields
}
func NewMockSSM ¶
func NewMockSSM() *MockSSM
func (*MockSSM) DeleteParameter ¶
func (m *MockSSM) DeleteParameter(ctx context.Context, params *ssm.DeleteParameterInput, optFns ...func(*ssm.Options)) (*ssm.DeleteParameterOutput, error)
func (*MockSSM) GetParameter ¶
func (m *MockSSM) GetParameter(ctx context.Context, params *ssm.GetParameterInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterOutput, error)
func (*MockSSM) GetParametersByPath ¶
func (m *MockSSM) GetParametersByPath(ctx context.Context, params *ssm.GetParametersByPathInput, optFns ...func(*ssm.Options)) (*ssm.GetParametersByPathOutput, error)
func (*MockSSM) PutParameter ¶
func (m *MockSSM) PutParameter(ctx context.Context, params *ssm.PutParameterInput, optFns ...func(*ssm.Options)) (*ssm.PutParameterOutput, error)
type Profile ¶
type Profile struct {
// For every table, the read/write counts and the operations performed on it
Accesses map[string]struct {
ReadCount int
WriteCount int
Operations []ProfileOperation
}
// contains filtered or unexported fields
}
func NewProfile ¶
func NewProfile() *Profile
func (*Profile) TotalCounts ¶
type ProfileOperation ¶
type S3ClientMock ¶
type S3ClientMock struct {
PresignClient awscommon.S3PresignClientInterface
Buckets map[string]map[string]any //map of bucket name to map of key to object
// ForcePutObjectErr, when non-nil, makes every PutObject return it.
// Lets tests exercise write-failure paths (e.g. the container's
// non-fatal failed-nodes CSV write) without an HTTP layer.
ForcePutObjectErr error
}
func NewS3ClientMock ¶
func NewS3ClientMock() *S3ClientMock
func (*S3ClientMock) CreateBucketDirect ¶
func (m *S3ClientMock) CreateBucketDirect(bucketName string)
func (*S3ClientMock) GetObject ¶
func (m *S3ClientMock) GetObject(ctx context.Context, input *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
func (*S3ClientMock) GetPresignClient ¶
func (m *S3ClientMock) GetPresignClient() awscommon.S3PresignClientInterface
GetPresignClient returns a mock presign client
func (*S3ClientMock) ListBuckets ¶
func (m *S3ClientMock) ListBuckets(ctx context.Context, input *s3.ListBucketsInput, optFns ...func(*s3.Options)) (*s3.ListBucketsOutput, error)
func (*S3ClientMock) PutObject ¶
func (m *S3ClientMock) PutObject(ctx context.Context, input *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
type SNSMock ¶
type SNSMock struct {
PublishedMessages []*sns.PublishInput
CreatePlatformApplicationCalls []*sns.CreatePlatformApplicationInput
CreatedPlatformEndpointCalls []*sns.CreatePlatformEndpointInput
DeleteEndpointCalls []*sns.DeleteEndpointInput
ListPlatformApplicationsCalls []*sns.ListPlatformApplicationsInput
SetPlatformApplicationAttributesCalls []*sns.SetPlatformApplicationAttributesInput
DeletePlatformApplicationCalls []*sns.DeletePlatformApplicationInput
GetPlatformApplicationAttributesCalls []*sns.GetPlatformApplicationAttributesInput
PublishError error
CreatePlatformApplicationError error
CreatePlatformEndpointError error
DeleteEndpointError error
ListPlatformApplicationsError error
SetPlatformApplicationAttributesError error
DeletePlatformApplicationError error
GetPlatformApplicationAttributesError error
MockPlatformApplications []types.PlatformApplication
PlatformAttributes map[string]map[string]string
// contains filtered or unexported fields
}
SNSMock is a mock implementation of the SNS client
func (*SNSMock) ClearPublishedMessages ¶
func (m *SNSMock) ClearPublishedMessages()
ClearPublishedMessages clears all published messages
func (*SNSMock) CreatePlatformApplication ¶
func (m *SNSMock) CreatePlatformApplication(ctx context.Context, params *sns.CreatePlatformApplicationInput, optFns ...func(*sns.Options)) (*sns.CreatePlatformApplicationOutput, error)
CreatePlatformApplication mocks the CreatePlatformApplication method of the SNS client
func (*SNSMock) CreatePlatformEndpoint ¶
func (m *SNSMock) CreatePlatformEndpoint(ctx context.Context, params *sns.CreatePlatformEndpointInput, optFns ...func(*sns.Options)) (*sns.CreatePlatformEndpointOutput, error)
CreatePlatformEndpoint mocks the CreatePlatformEndpoint method of the SNS client
func (*SNSMock) DeleteEndpoint ¶
func (m *SNSMock) DeleteEndpoint(ctx context.Context, params *sns.DeleteEndpointInput, optFns ...func(*sns.Options)) (*sns.DeleteEndpointOutput, error)
DeleteEndpoint mocks the DeleteEndpoint method of the SNS client
func (*SNSMock) DeletePlatformApplication ¶
func (m *SNSMock) DeletePlatformApplication(ctx context.Context, params *sns.DeletePlatformApplicationInput, optFns ...func(*sns.Options)) (*sns.DeletePlatformApplicationOutput, error)
DeletePlatformApplication mocks the DeletePlatformApplication method of the SNS client
func (*SNSMock) GetCreatePlatformApplicationCalls ¶
func (m *SNSMock) GetCreatePlatformApplicationCalls() []*sns.CreatePlatformApplicationInput
GetCreatePlatformApplicationCalls returns all CreatePlatformApplication calls
func (*SNSMock) GetCreatePlatformEndpointCalls ¶
func (m *SNSMock) GetCreatePlatformEndpointCalls() []*sns.CreatePlatformEndpointInput
GetCreatePlatformEndpointCalls returns all CreatePlatformEndpoint calls
func (*SNSMock) GetDeleteEndpointCalls ¶
func (m *SNSMock) GetDeleteEndpointCalls() []*sns.DeleteEndpointInput
GetDeleteEndpointCalls returns all DeleteEndpoint calls
func (*SNSMock) GetDeletePlatformApplicationCalls ¶
func (m *SNSMock) GetDeletePlatformApplicationCalls() []*sns.DeletePlatformApplicationInput
GetDeletePlatformApplicationCalls returns all DeletePlatformApplication calls
func (*SNSMock) GetListPlatformApplicationsCalls ¶
func (m *SNSMock) GetListPlatformApplicationsCalls() []*sns.ListPlatformApplicationsInput
GetListPlatformApplicationsCalls returns all ListPlatformApplications calls
func (*SNSMock) GetPlatformApplicationAttributes ¶
func (m *SNSMock) GetPlatformApplicationAttributes(ctx context.Context, params *sns.GetPlatformApplicationAttributesInput, optFns ...func(*sns.Options)) (*sns.GetPlatformApplicationAttributesOutput, error)
GetPlatformApplicationAttributes mocks the GetPlatformApplicationAttributes method of the SNS client
func (*SNSMock) GetPublishedMessages ¶
func (m *SNSMock) GetPublishedMessages() []*sns.PublishInput
GetPublishedMessages returns all published messages
func (*SNSMock) GetSetPlatformApplicationAttributesCalls ¶
func (m *SNSMock) GetSetPlatformApplicationAttributesCalls() []*sns.SetPlatformApplicationAttributesInput
GetSetPlatformApplicationAttributesCalls returns all SetPlatformApplicationAttributes calls
func (*SNSMock) ListPlatformApplications ¶
func (m *SNSMock) ListPlatformApplications(ctx context.Context, params *sns.ListPlatformApplicationsInput, optFns ...func(*sns.Options)) (*sns.ListPlatformApplicationsOutput, error)
ListPlatformApplications mocks the ListPlatformApplications method of the SNS client
func (*SNSMock) Publish ¶
func (m *SNSMock) Publish(ctx context.Context, params *sns.PublishInput, optFns ...func(*sns.Options)) (*sns.PublishOutput, error)
Publish mocks the Publish method of the SNS client
func (*SNSMock) SetListPlatformApplicationsError ¶
SetListPlatformApplicationsError sets an error to be returned by ListPlatformApplications
func (*SNSMock) SetMockPlatformApplications ¶
func (m *SNSMock) SetMockPlatformApplications(apps []types.PlatformApplication)
SetMockPlatformApplications sets the mock platform applications to be returned
func (*SNSMock) SetPlatformApplicationAttributes ¶
func (m *SNSMock) SetPlatformApplicationAttributes(ctx context.Context, params *sns.SetPlatformApplicationAttributesInput, optFns ...func(*sns.Options)) (*sns.SetPlatformApplicationAttributesOutput, error)
SetPlatformApplicationAttributes mocks the SetPlatformApplicationAttributes method of the SNS client
func (*SNSMock) SetPublishError ¶
SetPublishError sets an error to be returned by Publish
type STSMock ¶
type STSMock struct {
AccountID string
// AssumeRoleError, when set, is returned by AssumeRole instead of creds —
// used to exercise a handler's AssumeRole error path.
AssumeRoleError error
// contains filtered or unexported fields
}
func NewSTSMock ¶
func NewSTSMock() *STSMock
func (*STSMock) AssumeRole ¶
func (m *STSMock) AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error)
func (*STSMock) GetCallerIdentity ¶
func (m *STSMock) GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error)
func (*STSMock) GetLastAssumeRoleInput ¶
func (m *STSMock) GetLastAssumeRoleInput() *sts.AssumeRoleInput
GetLastAssumeRoleInput returns the last AssumeRoleInput used in an AssumeRole call
type SignalingChannel ¶
type SignalingChannel struct {
ChannelName string
ChannelARN string
ChannelType kvs_types.ChannelType
}
type TableDetails ¶
type TableDetails struct {
PrimaryKey string
SortKey string
Status types.TableStatus
GSIs map[string]*types.GlobalSecondaryIndexDescription
}
type UserState ¶
type UserState struct {
Username string
Email string
PhoneNumber string
Password string
UserSub string
UserPoolID string
IsConfirmed bool
IsEnabled bool
CreatedAt time.Time
LastLoginAt *time.Time
Attributes map[string]string
ConfirmationCode string
ResetCode string
}
UserState represents the current state of a user in the mock