user

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPasswordSet        = errors.New("user: no password set")
	ErrIncorrectPassword    = errors.New("user: wrong password")
	ErrInvalidHash          = errors.New("user: invalid password hash")
	ErrInvalidPasswordChars = errors.New("user: password contains invalid characters")
)

Functions

This section is empty.

Types

type AdminListUser

type AdminListUser struct {
	Id       string
	Username string
	Roles    []string
	Admin    bool
	UsesTOTP bool
	Disabled bool
}

type Passkey

type Passkey struct {
	webauthn.Credential
	FriendlyName *string
	LastUsed     *time.Time
}

type User

type User struct {
	Id                string
	Username          string
	PasswordHash      string
	Roles             []string
	Admin             bool
	TOTPSeed          *string
	RecoveryCodes     []string
	PasswordTimestamp int64
	StoredCredentials []Passkey
	Disabled          bool
}

func (*User) CheckPassword

func (u *User) CheckPassword(candidate string) error

func (*User) CheckTOTP

func (u *User) CheckTOTP(code string) bool

func (*User) GroupsOverlap

func (u *User) GroupsOverlap(groups []string) bool

func (*User) HasRole

func (u *User) HasRole(r string) bool

func (*User) SetPassword

func (u *User) SetPassword(password string) error

func (*User) TOTPEnabled

func (u *User) TOTPEnabled() bool

func (*User) WebAuthnCredentials

func (u *User) WebAuthnCredentials() []webauthn.Credential

func (*User) WebAuthnDisplayName

func (u *User) WebAuthnDisplayName() string

func (*User) WebAuthnID

func (u *User) WebAuthnID() []byte

func (*User) WebAuthnIcon

func (u *User) WebAuthnIcon() string

func (*User) WebAuthnName

func (u *User) WebAuthnName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL