Documentation ¶
Index ¶
- type Provider
- type TimeBased
- func (p TimeBased) Generate(username string) (config *models.TOTPConfiguration, err error)
- func (p TimeBased) GenerateCustom(username, algorithm string, digits, period, secretSize uint) (config *models.TOTPConfiguration, err error)
- func (p TimeBased) Validate(token string, config *models.TOTPConfiguration) (valid bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { Generate(username string) (config *models.TOTPConfiguration, err error) GenerateCustom(username, algorithm string, digits, period, secretSize uint) (config *models.TOTPConfiguration, err error) Validate(token string, config *models.TOTPConfiguration) (valid bool, err error) }
Provider for TOTP functionality.
type TimeBased ¶
type TimeBased struct {
// contains filtered or unexported fields
}
TimeBased totp.Provider for production use.
func NewTimeBasedProvider ¶
func NewTimeBasedProvider(config *schema.TOTPConfiguration) (provider *TimeBased)
NewTimeBasedProvider creates a new totp.TimeBased which implements the totp.Provider.
func (TimeBased) Generate ¶
func (p TimeBased) Generate(username string) (config *models.TOTPConfiguration, err error)
Generate generates a TOTP with default options.
func (TimeBased) GenerateCustom ¶
func (p TimeBased) GenerateCustom(username, algorithm string, digits, period, secretSize uint) (config *models.TOTPConfiguration, err error)
GenerateCustom generates a TOTP with custom options.
Click to show internal directories.
Click to hide internal directories.