mock

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRepo

type MockRepo struct {
	// contains filtered or unexported fields
}

func NewMockRepo

func NewMockRepo() *MockRepo

func (*MockRepo) ConsumePasskeyChallenge added in v0.9.0

func (m *MockRepo) ConsumePasskeyChallenge(ctx context.Context, token string) (*passkey.PasskeyChallenge, error)

func (*MockRepo) Create

func (m *MockRepo) Create(ctx context.Context, tf *twofactor.TwoFactor) error

func (*MockRepo) CreateAccount

func (m *MockRepo) CreateAccount(ctx context.Context, params *dto.CreateAccountParams) error

Account Methods

func (*MockRepo) CreatePasskey added in v0.9.0

func (m *MockRepo) CreatePasskey(ctx context.Context, pk *entity.Passkey) error

func (*MockRepo) CreateSession

func (m *MockRepo) CreateSession(ctx context.Context, sessionCtx *dto.CreateSessionParams) (*entity.Session, error)

Session Methods

func (*MockRepo) CreateUser

func (m *MockRepo) CreateUser(ctx context.Context, params *dto.CreateUserParams) (*entity.User, error)

User Methods

func (*MockRepo) CreateVerificationToken

func (m *MockRepo) CreateVerificationToken(ctx context.Context, token *entity.VerificationToken) error

Verification Token Methods

func (*MockRepo) DeleteByUserID

func (m *MockRepo) DeleteByUserID(ctx context.Context, userID string) error

func (*MockRepo) DeleteChallenge added in v0.7.0

func (m *MockRepo) DeleteChallenge(ctx context.Context, token string) error

func (*MockRepo) DeleteOTPChallenge

func (m *MockRepo) DeleteOTPChallenge(ctx context.Context, key string) error

func (*MockRepo) DeletePasskey added in v0.9.0

func (m *MockRepo) DeletePasskey(ctx context.Context, id string) error

func (*MockRepo) DeletePasskeyChallenge added in v0.9.0

func (m *MockRepo) DeletePasskeyChallenge(ctx context.Context, token string) error

func (*MockRepo) DeletePasskeysByUserID added in v0.9.0

func (m *MockRepo) DeletePasskeysByUserID(ctx context.Context, userID string) error

func (*MockRepo) DeleteSession

func (m *MockRepo) DeleteSession(ctx context.Context, token string) error

func (*MockRepo) DeleteSessionsByUserID added in v0.8.0

func (m *MockRepo) DeleteSessionsByUserID(ctx context.Context, userID string) error

func (*MockRepo) DeleteTrustDevice added in v0.7.0

func (m *MockRepo) DeleteTrustDevice(ctx context.Context, userID, deviceID string) error

func (*MockRepo) DeleteTrustDevicesByUserID added in v0.7.0

func (m *MockRepo) DeleteTrustDevicesByUserID(ctx context.Context, userID string) error

func (*MockRepo) DeleteUser added in v0.8.0

func (m *MockRepo) DeleteUser(ctx context.Context, id string) error

func (*MockRepo) DeleteVerificationToken

func (m *MockRepo) DeleteVerificationToken(ctx context.Context, token string) error

func (*MockRepo) FindByUserID

func (m *MockRepo) FindByUserID(ctx context.Context, userID string) (*twofactor.TwoFactor, error)

func (*MockRepo) FindTrustDevice added in v0.7.0

func (m *MockRepo) FindTrustDevice(ctx context.Context, userID, deviceID string) (*twofactor.TrustDeviceRecord, error)

func (*MockRepo) GetAccountByUserIDAndProvider

func (m *MockRepo) GetAccountByUserIDAndProvider(ctx context.Context, userID, provider string) (*entity.Account, error)

func (*MockRepo) GetChallenge added in v0.7.0

func (m *MockRepo) GetChallenge(ctx context.Context, token string) (*twofactor.ChallengeRecord, error)

func (*MockRepo) GetOTPChallenge

func (m *MockRepo) GetOTPChallenge(ctx context.Context, key string) (*twofactor.OTPChallenge, error)

func (*MockRepo) GetPasskeyByCredentialID added in v0.9.0

func (m *MockRepo) GetPasskeyByCredentialID(ctx context.Context, credentialID string) (*entity.Passkey, error)

func (*MockRepo) GetPasskeyByID added in v0.9.0

func (m *MockRepo) GetPasskeyByID(ctx context.Context, id string) (*entity.Passkey, error)

func (*MockRepo) GetPasskeyChallenge added in v0.9.0

func (m *MockRepo) GetPasskeyChallenge(ctx context.Context, token string) (*passkey.PasskeyChallenge, error)

func (*MockRepo) GetSessionByToken

func (m *MockRepo) GetSessionByToken(ctx context.Context, token string) (*entity.Session, error)

func (*MockRepo) GetTOTPSecret

func (m *MockRepo) GetTOTPSecret(ctx context.Context, userID string) (string, error)

func (*MockRepo) GetUserByEmail

func (m *MockRepo) GetUserByEmail(ctx context.Context, email string) (*entity.User, error)

func (*MockRepo) GetUserByID

func (m *MockRepo) GetUserByID(ctx context.Context, id string) (*entity.User, error)

func (*MockRepo) GetVerificationToken

func (m *MockRepo) GetVerificationToken(ctx context.Context, token string) (*entity.VerificationToken, error)

func (*MockRepo) LinkCredentialAccount added in v0.8.0

func (m *MockRepo) LinkCredentialAccount(ctx context.Context, userID, passwordHash string) error

func (*MockRepo) ListPasskeysByUserID added in v0.9.0

func (m *MockRepo) ListPasskeysByUserID(ctx context.Context, userID string) ([]*entity.Passkey, error)

func (*MockRepo) ListSessionsByUserID added in v0.8.0

func (m *MockRepo) ListSessionsByUserID(ctx context.Context, userID string) ([]*entity.Session, error)

func (*MockRepo) ListUsers added in v0.8.0

func (m *MockRepo) ListUsers(ctx context.Context, filter admin.ListUsersFilter) ([]*entity.User, int64, error)

func (*MockRepo) SaveChallenge added in v0.7.0

func (m *MockRepo) SaveChallenge(ctx context.Context, challenge *twofactor.ChallengeRecord) error

Challenge Methods

func (*MockRepo) SaveOTPChallenge

func (m *MockRepo) SaveOTPChallenge(ctx context.Context, challenge *twofactor.OTPChallenge) error

func (*MockRepo) SavePasskeyChallenge added in v0.9.0

func (m *MockRepo) SavePasskeyChallenge(ctx context.Context, challenge *passkey.PasskeyChallenge) error

func (*MockRepo) SaveTOTPSecret

func (m *MockRepo) SaveTOTPSecret(ctx context.Context, userID string, secret string) error

2FA TOTP Methods

func (*MockRepo) SaveTrustDevice added in v0.7.0

func (m *MockRepo) SaveTrustDevice(ctx context.Context, record *twofactor.TrustDeviceRecord) error

Trusted Devices Methods

func (*MockRepo) Update

func (m *MockRepo) Update(ctx context.Context, tf *twofactor.TwoFactor) error

func (*MockRepo) UpdateAccountPassword

func (m *MockRepo) UpdateAccountPassword(ctx context.Context, accountID, hashedPassword string) error

func (*MockRepo) UpdatePasskey added in v0.9.0

func (m *MockRepo) UpdatePasskey(ctx context.Context, pk *entity.Passkey) error

func (*MockRepo) UpdatePasskeyCounter added in v0.9.0

func (m *MockRepo) UpdatePasskeyCounter(ctx context.Context, id string, newCounter uint32) error

func (*MockRepo) UpdateUser

func (m *MockRepo) UpdateUser(ctx context.Context, u *entity.User) error

Jump to

Keyboard shortcuts

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