Help us shape the future of Go! Take the 2026 Go Developer Survey

mfatest

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mfatest provides a backend-agnostic conformance suite for the mfa.Store interface. Every backend (memory, sqlite, postgres, mongo) is expected to pass the same contract, so behavioral drift between them is caught here rather than in production.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformance

func RunConformance(t *testing.T, newFixture Factory, skip ...string)

RunConformance runs every contract test against fixtures from newFixture.

Types

type Factory

type Factory func(t *testing.T) Fixture

Factory builds a fresh, empty, migrated fixture for a single test.

type Fixture

type Fixture struct {
	Store  mfa.Store
	AppID  id.AppID
	UserID id.UserID
	// OtherUserID is a second user under the same app, used to prove that
	// enrollments and recovery codes are scoped to one user.
	OtherUserID id.UserID
}

Fixture is one backend ready to test, plus the users its rows hang off.

Jump to

Keyboard shortcuts

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