google2fa

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	GetSetupInfo(ctx context.Context, bizID string) (secretKey, qrCode string, status bizuserinters.Status)
	DoSetup(ctx context.Context, bizID, code string) (status bizuserinters.Status)

	Verify(ctx context.Context, bizID, code string) (status bizuserinters.Status)
}

func NewAuthenticator

func NewAuthenticator(model Model, issuer string) Authenticator

func NewAuthenticatorEx

func NewAuthenticatorEx(model Model, issuer string, dc *DebugConfig) Authenticator

type DebugConfig

type DebugConfig struct {
	FakeQrURL     string
	FakeSecretKey string
}

type Model

type Model interface {
	authenticator.Model

	GetGoogle2FASecretKey(ctx context.Context, bizID string) (secretKey string, status bizuserinters.Status)
	GetGoogle2FASetupUserInfo(ctx context.Context, bizID string) (name string, status bizuserinters.Status)

	CacheGoogle2FASecretKey(ctx context.Context, bizID, secretKey string) (status bizuserinters.Status)
	GetCachedGoogle2FASecretKey(ctx context.Context, bizID string) (secretKey string, status bizuserinters.Status)

	SetSetupGoogle2FACompleted(ctx context.Context, bizID string, secretKey string) (status bizuserinters.Status)
	SetVerifyGoogle2FACompleted(ctx context.Context, bizID string) (status bizuserinters.Status)
}

Jump to

Keyboard shortcuts

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