Documentation
¶
Index ¶
- func NewCreds(creds models.CredentialSlice) []webauthn.Credential
- type Auth
- func (*Auth) GetContext(ctx context.Context) (User, bool)
- func (a *Auth) GetUser(ctx context.Context, userid int32) (User, error)
- func (a *Auth) GetUserByName(ctx context.Context, username string) (User, error)
- func (a *Auth) GetUserFromToken(tokenString string) (User, error)
- func (*Auth) NewContext(ctx context.Context, user User) context.Context
- func (a *Auth) NewUser(ctx context.Context, params NewUserParams) error
- type Claims
- type NewUserParams
- type User
- func (u User) Cookie(expiration time.Duration) *http.Cookie
- func (u User) ProfilePictureInt() *int32
- func (u *User) SetPassword(ctx context.Context, password string) error
- func (u *User) SetProfilePicture(ctx context.Context, name string, data []byte) error
- func (u User) Token(expiration time.Time) string
- func (u User) Validate(password string) bool
- func (u User) WebAuthnCredentials() []webauthn.Credential
- func (u User) WebAuthnDisplayName() string
- func (u User) WebAuthnID() []byte
- func (u User) WebAuthnName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreds ¶
func NewCreds(creds models.CredentialSlice) []webauthn.Credential
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) GetUserByName ¶
username -> db -> user
func (*Auth) GetUserFromToken ¶
token -> user
func (*Auth) NewContext ¶
user -> context
type Claims ¶
type Claims struct {
Password string `json:"password"`
ProfilePictureID *int32 `json:"profilePictureID"`
WebauthnID string `json:"webauthnID"`
jwt.RegisteredClaims
}
type NewUserParams ¶
type User ¶
func (User) ProfilePictureInt ¶
func (*User) SetPassword ¶
Update user password
func (*User) SetProfilePicture ¶
Insert/Update Profile Picture
func (User) WebAuthnCredentials ¶
func (u User) WebAuthnCredentials() []webauthn.Credential
func (User) WebAuthnDisplayName ¶
func (User) WebAuthnID ¶
func (User) WebAuthnName ¶
Click to show internal directories.
Click to hide internal directories.