mirror of https://github.com/go-sonic/sonic.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
457 B
Go
20 lines
457 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-sonic/sonic/consts"
|
|
)
|
|
|
|
type BaseMFAService interface {
|
|
UseMFA(mfaType consts.MFAType) bool
|
|
GenerateMFAQRCode(ctx context.Context, content string) (string, error)
|
|
}
|
|
|
|
type TwoFactorTOTPMFAService interface {
|
|
BaseMFAService
|
|
GenerateTFACode(tfaKey string) (string, error)
|
|
ValidateTFACode(tfaKey, tfaCode string) bool
|
|
GenerateOTPKey(ctx context.Context, keyID string) (key, optURL string, err error)
|
|
}
|