Versions in this module Expand all Collapse all v0 v0.3.0 Oct 22, 2026 v0.2.0 Sep 25, 2026 Changes in this version + const InteractionCode + const InteractionPoll + var ErrInvalidResponse = errors.New("invalid mfa response") + var ErrNotEnrolled = errors.New("mfa method not enrolled") + var ErrUnknownMethod = errors.New("unknown mfa method") + func EnrolledMethods(ctx context.Context, s Store, userID string) ([]string, error) + func MethodAMR(m Method) []string + func MethodBackup(m Method) bool + func MethodExclusive(m Method) bool + func MethodInteraction(m Method) string + func Register(name string, d Driver) + type AMRProvider interface + AMR func() []string + type AsyncMethod interface + Async func() bool + type BackupMethod interface + Backup func() bool + type CallbackHandler interface + HandleCallback func(ctx *azugo.Context) error + type Driver interface + Open func(store Store, cfg *contract.MFAMethodConfig) (Method, error) + type Enrollment struct + CreatedAt time.Time + ID string + Label string + LastUsedAt *time.Time + Method string + Secret []byte + UserID string + func Enrolled(ctx context.Context, s Store, userID, method string) ([]*Enrollment, error) + type EnrollmentData struct + Data map[string]any + State []byte + type ExclusiveMethod interface + Exclusive func() bool + type Method interface + BeginEnroll func(ctx context.Context, userID string, info contract.UserInfo) (EnrollmentData, error) + BeginVerify func(ctx context.Context, userID string) (challengeID string, data map[string]any, err error) + FinishEnroll func(ctx context.Context, userID string, state []byte, response map[string]any) ([]byte, error) + Verify func(ctx context.Context, userID, challengeID string, response map[string]any) (Verification, error) + type Registry interface + Get func(ctx context.Context, name string) (Method, error) + Names func(ctx context.Context) ([]string, error) + func NewConfigRegistry(config *contract.Configuration, store Store) Registry + type Store interface + CompareAndSwap func(ctx context.Context, userID, id string, expected, replacement []byte) (bool, error) + Enroll func(ctx context.Context, e *Enrollment) error + List func(ctx context.Context, userID string) ([]*Enrollment, error) + Revoke func(ctx context.Context, userID, id string) error + Touch func(ctx context.Context, userID, id string, at time.Time) error + func NewMemoryStore() Store + type Verification struct + EnrollmentID string + Result VerifyResult + type VerifyResult string + const VerifyApproved + const VerifyDenied + const VerifyPending