mfa

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TOTPPeriod = 3

TOTPPeriod must match TOTP_PERIOD in docker-compose.yml (3s for fast tests)

Variables

This section is empty.

Functions

func CreateUserWithMFARequiredRole

func CreateUserWithMFARequiredRole(t *testing.T, admin *setup.UserClient, name string) *setup.UserClient

CreateUserWithMFARequiredRole creates a user assigned to an MFA-required role (not logged in)

func EnableMFA

func EnableMFA(t *testing.T, client *sdk.HTTPClient) *sdk.MFASetupResponse

EnableMFA completes setup + enable in a single call

func GenerateTOTPCode

func GenerateTOTPCode(t *testing.T, secret string) string

GenerateTOTPCode generates a TOTP code using the 3-second test period

func VerifyMFACodeWithSecret

func VerifyMFACodeWithSecret(t *testing.T, client *sdk.HTTPClient, challengeToken, secret string) *sdk.LoginResponse

VerifyMFACodeWithSecret generates a TOTP code and verifies MFA

func WaitForNewTOTPWindow

func WaitForNewTOTPWindow(t *testing.T)

WaitForNewTOTPWindow waits until the next TOTP window to avoid replay detection

Types

This section is empty.

Jump to

Keyboard shortcuts

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