tests

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CookieFromRecorder

func CookieFromRecorder(w *httptest.ResponseRecorder, name string) *http.Cookie

CookieFromRecorder returns the named Set-Cookie value from the recorder, or nil.

func NewNoopEventBus

func NewNoopEventBus() *internaltests.MockEventBus

NewNoopEventBus returns a MockEventBus that silently accepts all Publish calls.

func NewPluginConfig

func NewPluginConfig() *types.TOTPPluginConfig

Types

type MockTOTPRepo

type MockTOTPRepo struct {
	mock.Mock
}

func (*MockTOTPRepo) CompareAndSwapBackupCodes

func (m *MockTOTPRepo) CompareAndSwapBackupCodes(ctx context.Context, userID, expected, next string) (bool, error)

func (*MockTOTPRepo) Create

func (m *MockTOTPRepo) Create(ctx context.Context, userID, secret, backupCodes string) (*types.TOTPRecord, error)

func (*MockTOTPRepo) CreateTrustedDevice

func (m *MockTOTPRepo) CreateTrustedDevice(ctx context.Context, userID, token, userAgent string, expiresAt time.Time) (*types.TrustedDevice, error)

func (*MockTOTPRepo) DeleteByUserID

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

func (*MockTOTPRepo) DeleteTrustedDevicesByUserID

func (m *MockTOTPRepo) DeleteTrustedDevicesByUserID(ctx context.Context, userID string) error

func (*MockTOTPRepo) GetByUserID

func (m *MockTOTPRepo) GetByUserID(ctx context.Context, userID string) (*types.TOTPRecord, error)

func (*MockTOTPRepo) SetEnabled

func (m *MockTOTPRepo) SetEnabled(ctx context.Context, userID string, enabled bool) error

func (*MockTOTPRepo) UpdateBackupCodes

func (m *MockTOTPRepo) UpdateBackupCodes(ctx context.Context, userID, backupCodes string) error

Jump to

Keyboard shortcuts

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