handlers

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 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 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 SecureOtpHandler added in v1.0.14

type SecureOtpHandler interface {
	FreezeBackOffTime() uint64
	FreezeMaxFailures() uint64
	SecurityModeBackOffTime() uint64
	SecurityModeMaxFailures() uint64
	SetSecurityModeNoExpire(key string) error
	UnsetSecurityModeNoExpire(key string) error
	IsVerificationAllowedAndIncreaseTrials(account string, ip string) (*requests.OTPCodeVerifyData, error)
	Reset(account string, ip string)
	DecrementSecurityModeFailedTrials(account string) error
	ExtendSecurityMode(account string) error
	IsInterfaceNil() bool
}

SecureOtpHandler defines the methods available for a secure otp handler

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