Documentation
¶
Index ¶
- func CookieFromRecorder(w *httptest.ResponseRecorder, name string) *http.Cookie
- func NewNoopEventBus() *internaltests.MockEventBus
- func NewPluginConfig() *types.TOTPPluginConfig
- type MockTOTPRepo
- func (m *MockTOTPRepo) CompareAndSwapBackupCodes(ctx context.Context, userID, expected, next string) (bool, error)
- func (m *MockTOTPRepo) Create(ctx context.Context, userID, secret, backupCodes string) (*types.TOTPRecord, error)
- func (m *MockTOTPRepo) CreateTrustedDevice(ctx context.Context, userID, token, userAgent string, expiresAt time.Time) (*types.TrustedDevice, error)
- func (m *MockTOTPRepo) DeleteByUserID(ctx context.Context, userID string) error
- func (m *MockTOTPRepo) DeleteTrustedDevicesByUserID(ctx context.Context, userID string) error
- func (m *MockTOTPRepo) GetByUserID(ctx context.Context, userID string) (*types.TOTPRecord, error)
- func (m *MockTOTPRepo) SetEnabled(ctx context.Context, userID string, enabled bool) error
- func (m *MockTOTPRepo) UpdateBackupCodes(ctx context.Context, userID, backupCodes string) error
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 ¶
func (*MockTOTPRepo) CompareAndSwapBackupCodes ¶
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 (*MockTOTPRepo) UpdateBackupCodes ¶
func (m *MockTOTPRepo) UpdateBackupCodes(ctx context.Context, userID, backupCodes string) error
Click to show internal directories.
Click to hide internal directories.