Documentation
¶
Index ¶
- Variables
- func CreateLoginToken(db db.TxHandler, email string) (core.User, string, error)
- func CreateResetToken(db db.TxHandler, email string) (core.User, string, error)
- func GenerateAPIKey(db db.TxHandler, userID int32, validity time.Duration, description string, ...) (id, key string, err error)
- func GenerateAPIToken(db db.TxHandler, userID int32, validity time.Duration, description string, ...) (string, error)
- func Initialize(cfg Config, log zerolog.Logger) error
- func MagicLinksEnabled() bool
- func OpenIDProviders() []openid.Provider
- func OpenIDStart(db db.Handler, providerName, redirectURI string, clientType OpenIDClientType) (string, error)
- func PasswordAuthEnabled() bool
- func PasswordResetEnabled() bool
- func RevokeAPIKey(db db.Handler, keyIDStr string, delete bool) error
- func UpdateUserPassword(db db.TxHandler, email, password string) error
- type APIKey
- type Auth
- func PerformPasswordLogin(db db.TxHandler, email, password string) (auth Auth, key string, err error)
- func PerformTokenLogin(db db.TxHandler, encodedToken string) (Auth, string, error)
- func ReadAPIKey(db db.Handler, keyIDStr, keyStr string) (Auth, error)
- func ReadAPIToken(db db.Handler, encodedKey string) (Auth, error)
- func ResetUserPassword(db db.TxHandler, email, resetToken, password string) (a Auth, key string, err error)
- func VerifyUserPassword(d db.Handler, email, password string) (Auth, error)
- type Config
- type OpenIDClientType
- type PasswordBackend
- type PasswordConfig
- type PasswordRequirements
- type PasswordStrengthError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCredentialsInvalid = errors.New("invalid credentials")
View Source
var ErrTokenInvalid = errors.New("invalid token")
Functions ¶
func CreateLoginToken ¶
func CreateResetToken ¶
func GenerateAPIKey ¶
func GenerateAPIToken ¶
func MagicLinksEnabled ¶
func MagicLinksEnabled() bool
func OpenIDProviders ¶
func OpenIDStart ¶
func PasswordAuthEnabled ¶
func PasswordAuthEnabled() bool
func PasswordResetEnabled ¶
func PasswordResetEnabled() bool
Types ¶
type APIKey ¶
type Auth ¶
type Auth interface { UserID() int32 UserPermissions() core.UserPermissions HasScope(scope string) bool GetFileSystem(db db.Handler, rootOverride pgtype.UUID) *core.FileSystem }
func PerformPasswordLogin ¶
func PerformTokenLogin ¶
func ResetUserPassword ¶
type Config ¶
type Config struct { AutoCreate []string `koanf:"auto_create"` Password PasswordConfig `koanf:"password"` MagicLink bool `koanf:"magic_link"` OpenID openid.Config `koanf:"openid"` }
type OpenIDClientType ¶
type OpenIDClientType uint8
const ( OpenIDClientNone OpenIDClientType = iota OpenIDClientWeb OpenIDClientNative )
func OpenIDValidateAuthCode ¶
func OpenIDValidateAuthCode(d db.Handler, state, authCode, redirectURI string) (OpenIDClientType, error)
type PasswordBackend ¶
type PasswordConfig ¶
type PasswordRequirements ¶
type PasswordStrengthError ¶
type PasswordStrengthError struct {
Reason string
}
func (PasswordStrengthError) Error ¶
func (e PasswordStrengthError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.