Documentation ¶
Index ¶
- func CountCredentialByUserID(db *gorm.DB, userID uint) int
- func CreateAuthSession(ctx context.Context, data *webauthn.SessionData) error
- func DeleteSessionByUserID(userID uint, id uuid.UUID) func(tx *gorm.DB) error
- func LoginUser(ctx context.Context, opt LoginOpt) error
- func MarshalCredentialAssertion(c protocol.CredentialAssertion) graphql.Marshaler
- func MarshalCredentialCreation(c protocol.CredentialCreation) graphql.Marshaler
- func UnmarshalCredentialAssertion(v interface{}) (protocol.CredentialAssertion, error)
- func UnmarshalCredentialCreation(v interface{}) (protocol.CredentialCreation, error)
- type AuthSession
- type Credential
- type LoginOpt
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuthSession ¶
func CreateAuthSession(ctx context.Context, data *webauthn.SessionData) error
func DeleteSessionByUserID ¶
func MarshalCredentialAssertion ¶
func MarshalCredentialAssertion(c protocol.CredentialAssertion) graphql.Marshaler
func MarshalCredentialCreation ¶
func MarshalCredentialCreation(c protocol.CredentialCreation) graphql.Marshaler
func UnmarshalCredentialAssertion ¶
func UnmarshalCredentialAssertion(v interface{}) (protocol.CredentialAssertion, error)
func UnmarshalCredentialCreation ¶
func UnmarshalCredentialCreation(v interface{}) (protocol.CredentialCreation, error)
Types ¶
type AuthSession ¶
type AuthSession struct { ID uuid.UUID `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time Data datatypes.JSONType[webauthn.SessionData] }
func FirstAuthSession ¶
func FirstAuthSession(ctx context.Context) (*AuthSession, error)
func (AuthSession) Value ¶
func (a AuthSession) Value() webauthn.SessionData
type Credential ¶
type Credential struct { gorm.Model UserID uint User User Description string LastLogin *time.Time Data webauthn.Credential `gorm:"serializer:json"` }
func CredentialByUserID ¶
type Session ¶
type User ¶
type User struct { gorm.Model // `RANDOM_BYTES` was added with MariaDB 10.10.0 // AuthnID []byte `gorm:"type:BLOB(16);default:RANDOM_BYTES(16);not null"` AuthnID []byte `gorm:"type:BLOB(16)"` Name string `gorm:"type:VARCHAR(255);not null"` DisplayName string `gorm:"type:VARCHAR(255);not null"` Credentials []Credential }
func (User) WebAuthnCredentials ¶
func (u User) WebAuthnCredentials() []webauthn.Credential
func (User) WebAuthnDisplayName ¶
func (User) WebAuthnID ¶
func (User) WebAuthnIcon ¶
func (User) WebAuthnName ¶
Click to show internal directories.
Click to hide internal directories.