mfa

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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