Versions in this module Expand all Collapse all v1 v1.10.17 Oct 18, 2021 Changes in this version + const MaxBcryptPasswordLength + func AuthenticateUserByToken(token *auth.Token, user *User) (bool, error) + func BeginWebAuthnLogin(user User, uwas []WebAuthn, sr SessionRequest) (*protocol.CredentialAssertion, error) + func BeginWebAuthnRegistration(user User, uwas []WebAuthn, sessionStore *WebAuthnSessionStore, ...) (*protocol.CredentialCreation, error) + func FinishWebAuthnLogin(user User, uwas []WebAuthn, sr SessionRequest) error + func FinishWebAuthnRegistration(user User, uwas []WebAuthn, sessionStore *WebAuthnSessionStore, ...) (*webauthn.Credential, error) + func NewSessionReaper(db *sql.DB, config SessionReaperConfig) utils.SleeperTask + type ChangeAuthTokenRequest struct + Password string + type ORM interface + AuthorizedUserWithSession func(sessionID string) (User, error) + ClearNonCurrentSessions func(sessionID string) error + CreateSession func(sr SessionRequest) (string, error) + CreateUser func(user *User) error + DeleteAuthToken func(user *User) error + DeleteUser func() error + DeleteUserSession func(sessionID string) error + FindExternalInitiator func(eia *auth.Token) (initiator *bridges.ExternalInitiator, err error) + FindUser func() (User, error) + GetUserWebAuthn func(email string) ([]WebAuthn, error) + SaveWebAuthn func(token *WebAuthn) error + Sessions func(offset, limit int) ([]Session, error) + SetAuthToken func(user *User, token *auth.Token) error + SetPassword func(user *User, newPassword string) error + func NewORM(db *sqlx.DB, sessionDuration time.Duration) ORM + type Session struct + CreatedAt time.Time + ID string + LastUsed time.Time + func NewSession() Session + type SessionReaperConfig interface + ReaperExpiration func() models.Duration + SessionTimeout func() models.Duration + type SessionRequest struct + Email string + Password string + RequestContext *gin.Context + SessionStore *WebAuthnSessionStore + WebAuthnConfig WebAuthnConfiguration + WebAuthnData string + type User struct + CreatedAt time.Time + Email string + HashedPassword string + TokenHashedSecret null.String + TokenKey null.String + TokenSalt null.String + UpdatedAt time.Time + func NewUser(email, plainPwd string) (User, error) + func (u *User) GenerateAuthToken() (*auth.Token, error) + func (u *User) SetAuthToken(token *auth.Token) error + type WebAuthn struct + Email string + PublicKeyData sqlxTypes.JSONText + type WebAuthnConfiguration struct + RPID string + RPOrigin string + type WebAuthnSessionStore struct + InProgressRegistrations map[string]string + func NewWebAuthnSessionStore(keyPairs ...[]byte) *WebAuthnSessionStore + func (store *WebAuthnSessionStore) GetWebauthnSession(key string) (webauthn.SessionData, error) + func (store *WebAuthnSessionStore) SaveWebauthnSession(key string, data *webauthn.SessionData) error + func (store *WebAuthnSessionStore) Set(key string, value interface{}) error + type WebAuthnUser struct + Email string + WACredentials []webauthn.Credential + func (u *WebAuthnUser) LoadWebAuthnCredentials(uwas []WebAuthn) error + func (u WebAuthnUser) CredentialExcludeList() []protocol.CredentialDescriptor + func (u WebAuthnUser) WebAuthnCredentials() []webauthn.Credential + func (u WebAuthnUser) WebAuthnDisplayName() string + func (u WebAuthnUser) WebAuthnID() []byte + func (u WebAuthnUser) WebAuthnIcon() string + func (u WebAuthnUser) WebAuthnName() string