handlers

package
v1.0.12-tmp Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = errors.New("invalid config")

ErrInvalidConfig signals that an invalid configuration was provided

View Source
var ErrNilOTPProvider = errors.New("nil otp provider")

ErrNilOTPProvider signals that a nil otp provider was provided

View Source
var ErrNilRateLimiter = errors.New("nil rate limiter")

ErrNilRateLimiter signals that a nil rate limiter was provided

View Source
var ErrRegistrationFailed = errors.New("registration failed")

ErrRegistrationFailed signals that registration failed

Functions

This section is empty.

Types

type FrozenOtpHandler

type FrozenOtpHandler interface {
	BackOffTime() uint64
	MaxFailures() uint64
	IsVerificationAllowedAndIncreaseTrials(account string, ip string) (*requests.OTPCodeVerifyData, error)
	Reset(account string, ip string)
	IsInterfaceNil() bool
}

FrozenOtpHandler defines the methods available for a frozen otp handler

type OTP

type OTP interface {
	Validate(userCode string) error
	OTP() (string, error)
	QR() ([]byte, error)
	ToBytes() ([]byte, error)
	Url() (string, error)
}

OTP defines the methods available for a one time password provider

type OTPProvider

type OTPProvider interface {
	GenerateTOTP(account string, hash crypto.Hash) (OTP, error)
	TOTPFromBytes(encryptedMessage []byte) (OTP, error)
	IsInterfaceNil() bool
}

OTPProvider defines the methods available for an otp provider

type ShardedStorageFactory

type ShardedStorageFactory interface {
	Create() (core.StorageWithIndex, error)
	IsInterfaceNil() bool
}

ShardedStorageFactory defines the methods available for a sharded storage factory

type TOTPHandler

type TOTPHandler interface {
	CreateTOTP(account string) (OTP, error)
	TOTPFromBytes(encryptedMessage []byte) (OTP, error)
	IsInterfaceNil() bool
}

TOTPHandler defines the methods available for a time based one time password handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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