mock

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 14 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) AddListGroupWithName added in v1.53.0

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

func (*CognitoIdentityProviderClientStub) AddMultipleActiveUsers added in v1.30.0

func (m *CognitoIdentityProviderClientStub) AddMultipleActiveUsers(activeusersCount, inactiveusersCount int)

Generates the required number of users in the system

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) AddUserWithAttributes added in v1.53.0

func (m *CognitoIdentityProviderClientStub) AddUserWithAttributes(id, forename, lastname, email, password string, isConfirmed bool)

func (*CognitoIdentityProviderClientStub) AddUserWithEmail added in v1.12.0

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

func (*CognitoIdentityProviderClientStub) AddUserWithForename added in v1.52.0

func (m *CognitoIdentityProviderClientStub) AddUserWithForename(username, email, forename 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) GenerateListGroup added in v1.53.0

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)

func (*CognitoIdentityProviderClientStub) UpdateGroup added in v1.28.0

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
	AddUserToGroupfunc            func(ctx context.Context, group models.Group, userId string) (*models.UsersList, *models.ErrorResponse)
	AdminAddUserToGroupFunc       func(input *cognitoidentityprovider.AdminAddUserToGroupInput) (*cognitoidentityprovider.AdminAddUserToGroupOutput, error)
	AdminConfirmSignUpFunc        func(input *cognitoidentityprovider.AdminConfirmSignUpInput) (*cognitoidentityprovider.AdminConfirmSignUpOutput, error)
	AdminCreateUserFunc           func(userInput *cognitoidentityprovider.AdminCreateUserInput) (*cognitoidentityprovider.AdminCreateUserOutput, error)
	AdminDeleteUserFunc           func(input *cognitoidentityprovider.AdminDeleteUserInput) (*cognitoidentityprovider.AdminDeleteUserOutput, error)
	AdminDisableUserFunc          func(input *cognitoidentityprovider.AdminDisableUserInput) (*cognitoidentityprovider.AdminDisableUserOutput, error)
	AdminEnableUserFunc           func(input *cognitoidentityprovider.AdminEnableUserInput) (*cognitoidentityprovider.AdminEnableUserOutput, error)
	AdminGetUserFunc              func(input *cognitoidentityprovider.AdminGetUserInput) (*cognitoidentityprovider.AdminGetUserOutput, error)
	AdminRemoveUserFromGroupFunc  func(input *cognitoidentityprovider.AdminRemoveUserFromGroupInput) (*cognitoidentityprovider.AdminRemoveUserFromGroupOutput, error)
	AdminSetUserPasswordFunc      func(input *cognitoidentityprovider.AdminSetUserPasswordInput) (*cognitoidentityprovider.AdminSetUserPasswordOutput, error)
	AdminUpdateUserAttributesFunc func(input *cognitoidentityprovider.AdminUpdateUserAttributesInput) (*cognitoidentityprovider.AdminUpdateUserAttributesOutput, error)
	AdminUserGlobalSignOutFunc    func(adminUserGlobalSignOutInput *cognitoidentityprovider.AdminUserGlobalSignOutInput) (*cognitoidentityprovider.AdminUserGlobalSignOutOutput, error)
	ConfirmForgotPasswordFunc     func(input *cognitoidentityprovider.ConfirmForgotPasswordInput) (*cognitoidentityprovider.ConfirmForgotPasswordOutput, error)
	CreateGroupFunc               func(input *cognitoidentityprovider.CreateGroupInput) (*cognitoidentityprovider.CreateGroupOutput, error)
	DeleteGroupFunc               func(input *cognitoidentityprovider.DeleteGroupInput) (*cognitoidentityprovider.DeleteGroupOutput, error)
	DescribeUserPoolClientFunc    func(input *cognitoidentityprovider.DescribeUserPoolClientInput) (*cognitoidentityprovider.DescribeUserPoolClientOutput, error)
	DescribeUserPoolFunc          func(poolInputData *cognitoidentityprovider.DescribeUserPoolInput) (*cognitoidentityprovider.DescribeUserPoolOutput, error)
	ForgotPasswordFunc            func(input *cognitoidentityprovider.ForgotPasswordInput) (*cognitoidentityprovider.ForgotPasswordOutput, error)
	GetGroupFunc                  func(input *cognitoidentityprovider.GetGroupInput) (*cognitoidentityprovider.GetGroupOutput, error)
	GlobalSignOutFunc             func(signOutInput *cognitoidentityprovider.GlobalSignOutInput) (*cognitoidentityprovider.GlobalSignOutOutput, error)
	InitiateAuthFunc              func(authInput *cognitoidentityprovider.InitiateAuthInput) (*cognitoidentityprovider.InitiateAuthOutput, error)
	ListGroupsForUserFunc         func(input *cognitoidentityprovider.AdminListGroupsForUserInput) (*cognitoidentityprovider.AdminListGroupsForUserOutput, error)
	//ListGroupsUsersFunc           func(input *cognitoidentityprovider.ListGroupsOutput) (*[]models.ListGroupUsersType, error)
	ListGroupsFunc             func(input *cognitoidentityprovider.ListGroupsInput) (*cognitoidentityprovider.ListGroupsOutput, error)
	ListUsersFunc              func(usersInput *cognitoidentityprovider.ListUsersInput) (*cognitoidentityprovider.ListUsersOutput, error)
	ListUsersInGroupFunc       func(input *cognitoidentityprovider.ListUsersInGroupInput) (*cognitoidentityprovider.ListUsersInGroupOutput, error)
	RemoveUserFromGroupfunc    func(ctx context.Context, group models.Group, userId string) (*models.UsersList, *models.ErrorResponse)
	RespondToAuthChallengeFunc func(input *cognitoidentityprovider.RespondToAuthChallengeInput) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error)
	SetGroupUsersfunc          func(ctx context.Context, group models.Group, users models.UsersList) (*models.UsersList, *models.ErrorResponse)
	UpdateGroupFunc            func(input *cognitoidentityprovider.UpdateGroupInput) (*cognitoidentityprovider.UpdateGroupOutput, error)
	ValidateAddRemoveUserFunc  func(ctx context.Context, userId string) error
}

func (*MockCognitoIdentityProviderClient) AddUserToGroup added in v1.40.0

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 (m *MockCognitoIdentityProviderClient) ListGroupsUsers(input *cognitoidentityprovider.ListGroupsOutput) (*[]models.ListGroupUsersType, error) {
	return m.ListGroupsUsersFunc(input)
}

func (*MockCognitoIdentityProviderClient) ListUsers added in v1.7.0

func (*MockCognitoIdentityProviderClient) ListUsersInGroup added in v1.15.0

func (*MockCognitoIdentityProviderClient) RemoveUserFromGroup added in v1.40.0

func (m *MockCognitoIdentityProviderClient) RemoveUserFromGroup(ctx context.Context, group models.Group, userId string) (*models.UsersList, *models.ErrorResponse)

func (*MockCognitoIdentityProviderClient) RespondToAuthChallenge added in v1.10.0

func (*MockCognitoIdentityProviderClient) SetGroupUsers added in v1.40.0

func (*MockCognitoIdentityProviderClient) UpdateGroup added in v1.28.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