mock

package
v1.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BulkGenerateUsers added in v1.19.0

func BulkGenerateUsers(userCount int, userNames []string) *cognitoidentityprovider.ListUsersOutput

BulkGenerateUsers - bulk generate 'n' users for testing purposes

if usernames array is nil or length is different, will auto-assign UUIDs

func GenerateMockIDToken added in v1.7.0

func GenerateMockIDToken(email string) string

Types

type CognitoIdentityProviderClientStub added in v1.5.0

type CognitoIdentityProviderClientStub struct {
	cognitoidentityprovideriface.CognitoIdentityProviderAPI
	UserPools  []string
	Users      []*User
	Sessions   []Session
	Groups     []*Group
	GroupsList []cognitoidentityprovider.ListGroupsOutput
}

func (*CognitoIdentityProviderClientStub) AddGroupWithName added in v1.13.0

func (m *CognitoIdentityProviderClientStub) AddGroupWithName(name string) error

func (*CognitoIdentityProviderClientStub) AddGroupWithNameAndDescription added in v1.13.0

func (m *CognitoIdentityProviderClientStub) AddGroupWithNameAndDescription(name, description string) error

func (*CognitoIdentityProviderClientStub) AddGroupWithNameAndPrecedence added in v1.13.0

func (m *CognitoIdentityProviderClientStub) AddGroupWithNameAndPrecedence(name string, precedence int64) error

func (*CognitoIdentityProviderClientStub) AddMultipleUsers added in v1.20.0

func (m *CognitoIdentityProviderClientStub) AddMultipleUsers(usersCount int)

Generates the required number of users in the system

func (*CognitoIdentityProviderClientStub) AddUserToGroup added in v1.16.0

func (m *CognitoIdentityProviderClientStub) AddUserToGroup(username string, groupName string) error

func (*CognitoIdentityProviderClientStub) AddUserWithEmail added in v1.12.0

func (m *CognitoIdentityProviderClientStub) AddUserWithEmail(email, password string, isConfirmed bool)

func (*CognitoIdentityProviderClientStub) AddUserWithUsername added in v1.6.0

func (m *CognitoIdentityProviderClientStub) AddUserWithUsername(username, email string, isConfirmed bool)

func (*CognitoIdentityProviderClientStub) AdminAddUserToGroup added in v1.15.0

func (*CognitoIdentityProviderClientStub) AdminConfirmSignUp added in v1.17.0

Added to fully implement interface but only used in the local dummy data builder

func (*CognitoIdentityProviderClientStub) AdminCreateUser added in v1.7.0

func (*CognitoIdentityProviderClientStub) AdminDeleteUser added in v1.17.0

Added to fully implement interface but only used in the local dummy data builder

func (*CognitoIdentityProviderClientStub) AdminDisableUser added in v1.15.0

func (*CognitoIdentityProviderClientStub) AdminEnableUser added in v1.15.0

func (*CognitoIdentityProviderClientStub) AdminGetUser added in v1.12.0

func (*CognitoIdentityProviderClientStub) AdminListGroupsForUser added in v1.21.0

func (*CognitoIdentityProviderClientStub) AdminRemoveUserFromGroup added in v1.16.0

func (*CognitoIdentityProviderClientStub) AdminSetUserPassword added in v1.17.0

Added to fully implement interface but only used in the local dummy data builder

func (*CognitoIdentityProviderClientStub) AdminUpdateUserAttributes added in v1.13.0

func (*CognitoIdentityProviderClientStub) AdminUserGlobalSignOut added in v1.7.0

func (*CognitoIdentityProviderClientStub) BulkGenerateGroups added in v1.21.0

func (m *CognitoIdentityProviderClientStub) BulkGenerateGroups(groupCount int)

func (*CognitoIdentityProviderClientStub) BulkGenerateGroupsList added in v1.25.0

func (m *CognitoIdentityProviderClientStub) BulkGenerateGroupsList(groupCount int)

func (*CognitoIdentityProviderClientStub) ConfirmForgotPassword added in v1.14.0

func (*CognitoIdentityProviderClientStub) CreateGroup added in v1.13.0

func (*CognitoIdentityProviderClientStub) CreateIdTokenForEmail added in v1.7.0

func (m *CognitoIdentityProviderClientStub) CreateIdTokenForEmail(email string) string

func (*CognitoIdentityProviderClientStub) CreateSessionWithAccessToken added in v1.5.0

func (m *CognitoIdentityProviderClientStub) CreateSessionWithAccessToken(accessToken string)

func (*CognitoIdentityProviderClientStub) DeleteGroup added in v1.17.0

Added to fully implement interface but only used in the local dummy data builder

func (*CognitoIdentityProviderClientStub) DescribeUserPool added in v1.5.0

func (*CognitoIdentityProviderClientStub) DescribeUserPoolClient added in v1.22.0

func (*CognitoIdentityProviderClientStub) ForgotPassword added in v1.11.0

func (*CognitoIdentityProviderClientStub) GenerateGroup added in v1.13.0

func (m *CognitoIdentityProviderClientStub) GenerateGroup(name, description string, precedence int64) (*Group, error)

func (*CognitoIdentityProviderClientStub) GenerateSession added in v1.5.0

func (m *CognitoIdentityProviderClientStub) GenerateSession(accessToken string, idToken string, refreshToken string) Session

func (*CognitoIdentityProviderClientStub) GenerateUser added in v1.6.0

func (m *CognitoIdentityProviderClientStub) GenerateUser(id, email, password, givenName, familyName string, isConfirmed bool) *User

func (*CognitoIdentityProviderClientStub) GetGroup added in v1.15.0

func (*CognitoIdentityProviderClientStub) GlobalSignOut added in v1.5.0

func (*CognitoIdentityProviderClientStub) InitiateAuth added in v1.6.0

func (*CognitoIdentityProviderClientStub) ListGroups added in v1.25.0

func (*CognitoIdentityProviderClientStub) ListUsers added in v1.7.0

func (*CognitoIdentityProviderClientStub) ListUsersInGroup added in v1.15.0

func (*CognitoIdentityProviderClientStub) MakeUserMember added in v1.21.0

func (m *CognitoIdentityProviderClientStub) MakeUserMember(userName string)

func (*CognitoIdentityProviderClientStub) ReadGroup added in v1.15.0

func (m *CognitoIdentityProviderClientStub) ReadGroup(groupName string) *Group

func (*CognitoIdentityProviderClientStub) ReadUser added in v1.15.0

func (m *CognitoIdentityProviderClientStub) ReadUser(username string) *User

func (*CognitoIdentityProviderClientStub) RespondToAuthChallenge added in v1.10.0

func (*CognitoIdentityProviderClientStub) SetUserActiveState added in v1.15.0

func (m *CognitoIdentityProviderClientStub) SetUserActiveState(username, active string)

type Group added in v1.13.0

type Group struct {
	Name        string
	Description string
	Precedence  int64
	Created     time.Time
	Members     []*User
}

type MockCognitoIdentityProviderClient

type MockCognitoIdentityProviderClient struct {
	cognitoidentityprovideriface.CognitoIdentityProviderAPI
	DescribeUserPoolFunc          func(poolInputData *cognitoidentityprovider.DescribeUserPoolInput) (*cognitoidentityprovider.DescribeUserPoolOutput, error)
	AdminCreateUserFunc           func(userInput *cognitoidentityprovider.AdminCreateUserInput) (*cognitoidentityprovider.AdminCreateUserOutput, error)
	GlobalSignOutFunc             func(signOutInput *cognitoidentityprovider.GlobalSignOutInput) (*cognitoidentityprovider.GlobalSignOutOutput, error)
	ListUsersFunc                 func(usersInput *cognitoidentityprovider.ListUsersInput) (*cognitoidentityprovider.ListUsersOutput, error)
	InitiateAuthFunc              func(authInput *cognitoidentityprovider.InitiateAuthInput) (*cognitoidentityprovider.InitiateAuthOutput, error)
	AdminUserGlobalSignOutFunc    func(adminUserGlobalSignOutInput *cognitoidentityprovider.AdminUserGlobalSignOutInput) (*cognitoidentityprovider.AdminUserGlobalSignOutOutput, error)
	RespondToAuthChallengeFunc    func(input *cognitoidentityprovider.RespondToAuthChallengeInput) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error)
	ConfirmForgotPasswordFunc     func(input *cognitoidentityprovider.ConfirmForgotPasswordInput) (*cognitoidentityprovider.ConfirmForgotPasswordOutput, error)
	ForgotPasswordFunc            func(input *cognitoidentityprovider.ForgotPasswordInput) (*cognitoidentityprovider.ForgotPasswordOutput, error)
	AdminGetUserFunc              func(input *cognitoidentityprovider.AdminGetUserInput) (*cognitoidentityprovider.AdminGetUserOutput, error)
	CreateGroupFunc               func(input *cognitoidentityprovider.CreateGroupInput) (*cognitoidentityprovider.CreateGroupOutput, error)
	GetGroupFunc                  func(input *cognitoidentityprovider.GetGroupInput) (*cognitoidentityprovider.GetGroupOutput, error)
	AdminUpdateUserAttributesFunc func(input *cognitoidentityprovider.AdminUpdateUserAttributesInput) (*cognitoidentityprovider.AdminUpdateUserAttributesOutput, error)
	AdminEnableUserFunc           func(input *cognitoidentityprovider.AdminEnableUserInput) (*cognitoidentityprovider.AdminEnableUserOutput, error)
	AdminDisableUserFunc          func(input *cognitoidentityprovider.AdminDisableUserInput) (*cognitoidentityprovider.AdminDisableUserOutput, error)
	AdminAddUserToGroupFunc       func(input *cognitoidentityprovider.AdminAddUserToGroupInput) (*cognitoidentityprovider.AdminAddUserToGroupOutput, error)
	ListUsersInGroupFunc          func(input *cognitoidentityprovider.ListUsersInGroupInput) (*cognitoidentityprovider.ListUsersInGroupOutput, error)
	AdminRemoveUserFromGroupFunc  func(input *cognitoidentityprovider.AdminRemoveUserFromGroupInput) (*cognitoidentityprovider.AdminRemoveUserFromGroupOutput, error)
	AdminConfirmSignUpFunc        func(input *cognitoidentityprovider.AdminConfirmSignUpInput) (*cognitoidentityprovider.AdminConfirmSignUpOutput, error)
	AdminDeleteUserFunc           func(input *cognitoidentityprovider.AdminDeleteUserInput) (*cognitoidentityprovider.AdminDeleteUserOutput, error)
	DeleteGroupFunc               func(input *cognitoidentityprovider.DeleteGroupInput) (*cognitoidentityprovider.DeleteGroupOutput, error)
	AdminSetUserPasswordFunc      func(input *cognitoidentityprovider.AdminSetUserPasswordInput) (*cognitoidentityprovider.AdminSetUserPasswordOutput, error)
	ListGroupsForUserFunc         func(input *cognitoidentityprovider.AdminListGroupsForUserInput) (*cognitoidentityprovider.AdminListGroupsForUserOutput, error)
	DescribeUserPoolClientFunc    func(input *cognitoidentityprovider.DescribeUserPoolClientInput) (*cognitoidentityprovider.DescribeUserPoolClientOutput, error)
	ListGroupsFunc                func(input *cognitoidentityprovider.ListGroupsInput) (*cognitoidentityprovider.ListGroupsOutput, error)
}

func (*MockCognitoIdentityProviderClient) AdminAddUserToGroup added in v1.15.0

func (*MockCognitoIdentityProviderClient) AdminConfirmSignUp added in v1.17.0

func (*MockCognitoIdentityProviderClient) AdminCreateUser added in v1.7.0

AdminCreateUser function

func (*MockCognitoIdentityProviderClient) AdminDeleteUser added in v1.17.0

func (*MockCognitoIdentityProviderClient) AdminDisableUser added in v1.15.0

func (*MockCognitoIdentityProviderClient) AdminEnableUser added in v1.15.0

func (*MockCognitoIdentityProviderClient) AdminGetUser added in v1.12.0

func (*MockCognitoIdentityProviderClient) AdminListGroupsForUser added in v1.21.0

func (*MockCognitoIdentityProviderClient) AdminRemoveUserFromGroup added in v1.16.0

func (*MockCognitoIdentityProviderClient) AdminSetUserPassword added in v1.17.0

func (*MockCognitoIdentityProviderClient) AdminUpdateUserAttributes added in v1.13.0

func (*MockCognitoIdentityProviderClient) AdminUserGlobalSignOut added in v1.7.0

func (*MockCognitoIdentityProviderClient) ConfirmForgotPassword added in v1.14.0

func (*MockCognitoIdentityProviderClient) CreateGroup added in v1.13.0

func (*MockCognitoIdentityProviderClient) DeleteGroup added in v1.17.0

func (*MockCognitoIdentityProviderClient) DescribeUserPool

func (*MockCognitoIdentityProviderClient) DescribeUserPoolClient added in v1.22.0

func (*MockCognitoIdentityProviderClient) ForgotPassword added in v1.11.0

func (*MockCognitoIdentityProviderClient) GetGroup added in v1.13.0

func (*MockCognitoIdentityProviderClient) GlobalSignOut added in v1.5.0

func (*MockCognitoIdentityProviderClient) InitiateAuth added in v1.7.0

func (*MockCognitoIdentityProviderClient) ListGroups added in v1.25.0

func (*MockCognitoIdentityProviderClient) ListUsers added in v1.7.0

func (*MockCognitoIdentityProviderClient) ListUsersInGroup added in v1.15.0

func (*MockCognitoIdentityProviderClient) RespondToAuthChallenge added in v1.10.0

type Session added in v1.5.0

type Session struct {
	AccessToken  string
	IdToken      string
	RefreshToken string
}

type User added in v1.6.0

type User struct {
	ID          string
	Email       string
	Password    string
	GivenName   string
	FamilyName  string
	Groups      []*Group
	Status      string
	Active      bool
	StatusNotes string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL