Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationAttempt ¶
type AuthenticationAttempt struct { ID int `db:"id"` Time time.Time `db:"time"` Successful bool `db:"successful"` Banned bool `db:"banned"` Username string `db:"username"` Type string `db:"auth_type"` RemoteIP NullIP `db:"remote_ip"` RequestURI string `db:"request_uri"` RequestMethod string `db:"request_method"` }
AuthenticationAttempt represents an authentication attempt row in the database.
type DuoDevice ¶ added in v4.33.0
type DuoDevice struct { ID int `db:"id"` Username string `db:"username"` Device string `db:"device"` Method string `db:"method"` }
DuoDevice represents a DUO Device.
type IP ¶ added in v4.33.0
IP is a type specific for storage of a net.IP in the database which can't be NULL.
type IdentityVerification ¶ added in v4.33.0
type IdentityVerification struct { ID int `db:"id"` JTI uuid.UUID `db:"jti"` IssuedAt time.Time `db:"iat"` IssuedIP IP `db:"issued_ip"` ExpiresAt time.Time `db:"exp"` Action string `db:"action"` Username string `db:"username"` Consumed *time.Time `db:"consumed"` ConsumedIP NullIP `db:"consumed_ip"` }
IdentityVerification represents an identity verification row in the database.
func NewIdentityVerification ¶ added in v4.33.0
func NewIdentityVerification(jti uuid.UUID, username, action string, ip net.IP) (verification IdentityVerification)
NewIdentityVerification creates a new IdentityVerification from a given username and action.
func (IdentityVerification) ToIdentityVerificationClaim ¶ added in v4.33.0
func (v IdentityVerification) ToIdentityVerificationClaim() (claim *IdentityVerificationClaim)
ToIdentityVerificationClaim converts the IdentityVerification into a IdentityVerificationClaim.
type IdentityVerificationClaim ¶ added in v4.33.0
type IdentityVerificationClaim struct { jwt.RegisteredClaims // The action this token has been crafted for. Action string `json:"action"` // The user this token has been crafted for. Username string `json:"username"` }
IdentityVerificationClaim custom claim for specifying the action claim. The action can be to register a TOTP device, a U2F device or reset one's password.
func (IdentityVerificationClaim) ToIdentityVerification ¶ added in v4.33.0
func (v IdentityVerificationClaim) ToIdentityVerification() (verification *IdentityVerification, err error)
ToIdentityVerification converts the IdentityVerificationClaim into a IdentityVerification.
type Migration ¶ added in v4.33.0
type Migration struct { ID int `db:"id"` Applied time.Time `db:"applied"` Before int `db:"version_before"` After int `db:"version_after"` Version string `db:"application_version"` }
Migration represents a migration row in the database.
type NullIP ¶ added in v4.33.0
NullIP is a type specific for storage of a net.IP in the database which can also be NULL.
func NewNullIPFromString ¶ added in v4.33.0
NewNullIPFromString easily constructs a new NullIP from a string.
type SchemaMigration ¶ added in v4.33.0
SchemaMigration represents an intended migration.
func (SchemaMigration) After ¶ added in v4.33.0
func (m SchemaMigration) After() (after int)
After returns the version the schema will be at After the migration is applied.
func (SchemaMigration) Before ¶ added in v4.33.0
func (m SchemaMigration) Before() (before int)
Before returns the version the schema should be at Before the migration is applied.
type StartupCheck ¶ added in v4.33.0
type StartupCheck interface {
StartupCheck() (err error)
}
StartupCheck represents a provider that has a startup check.
type TOTPConfiguration ¶ added in v4.33.0
type TOTPConfiguration struct { ID int `db:"id" json:"-"` Username string `db:"username" json:"-"` Issuer string `db:"issuer" json:"-"` Algorithm string `db:"algorithm" json:"-"` Digits uint `db:"digits" json:"digits"` Period uint `db:"period" json:"period"` Secret []byte `db:"secret" json:"-"` }
TOTPConfiguration represents a users TOTP configuration row in the database.
func (TOTPConfiguration) URI ¶ added in v4.33.0
func (c TOTPConfiguration) URI() (uri string)
URI shows the configuration in the URI representation.
type U2FDevice ¶ added in v4.33.0
type U2FDevice struct { ID int `db:"id"` Username string `db:"username"` Description string `db:"description"` KeyHandle []byte `db:"key_handle"` PublicKey []byte `db:"public_key"` }
U2FDevice represents a users U2F device row in the database.
type UserInfo ¶ added in v4.33.0
type UserInfo struct { // The users display name. DisplayName string `db:"-" json:"display_name"` // The preferred 2FA method. Method string `db:"second_factor_method" json:"method" valid:"required"` // True if a TOTP device has been registered. HasTOTP bool `db:"has_totp" json:"has_totp" valid:"required"` // True if a security key has been registered. HasU2F bool `db:"has_u2f" json:"has_u2f" valid:"required"` // True if a duo device has been configured as the preferred. HasDuo bool `db:"has_duo" json:"has_duo" valid:"required"` }
UserInfo represents the user information required by the web UI.