Documentation
¶
Index ¶
- func ChangePassword(db *gorm.DB, email string, passwordHash []byte) error
- func ConfirmUser(db *gorm.DB, confirmation *UserConfirmation) error
- func CreateClient(db *gorm.DB, client *Client) error
- func CreateClientScope(db *gorm.DB, clientID string, scope string) error
- func CreateConfirmation(db *gorm.DB, confirmation *UserConfirmation) error
- func CreateCredential(db *gorm.DB, credential *UserCredential) error
- func CreateOIDCClient(db *gorm.DB, client *OidcClient) error
- func CreateRole(db *gorm.DB, role *Role) error
- func CreateScope(db *gorm.DB, scope string) error
- func CreateUser(db *gorm.DB, user *User) error
- func DeleteClientScope(db *gorm.DB, clientID string, scope string) error
- func DeleteCredential(db *gorm.DB, email string, id []byte) error
- func DeleteOIDCClient(db *gorm.DB, name string) error
- func DeleteScope(db *gorm.DB, scope string) error
- func ExpireAllConfirmation(db *gorm.DB, email string) error
- func GetCredentialDescriptors(db *gorm.DB, email string) ([]protocol.CredentialDescriptor, error)
- func GetCredentialNames(db *gorm.DB, email string) ([]string, error)
- func HasRole(db *gorm.DB, email string, name string) bool
- func HasUsers(db *gorm.DB) (bool, error)
- func IsScopeExist(db *gorm.DB, scope string) (bool, error)
- func IsScopeInUse(db *gorm.DB, scope string) (bool, error)
- func ListClientScopes(db *gorm.DB, clientID string) ([]string, error)
- func ListScopes(db *gorm.DB) ([]string, error)
- func Migrate(db *gorm.DB)
- func UpdateClient(db *gorm.DB, client *Client) error
- func UpdateCredential(db *gorm.DB, email string, id []byte, friendlyName string) error
- func UpdateOIDCClient(db *gorm.DB, client *OidcClient) error
- type Client
- type ClientScope
- type OidcClient
- type Role
- type Scope
- type User
- type UserConfirmation
- type UserCredential
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmUser ¶
func ConfirmUser(db *gorm.DB, confirmation *UserConfirmation) error
func CreateConfirmation ¶
func CreateConfirmation(db *gorm.DB, confirmation *UserConfirmation) error
func CreateCredential ¶
func CreateCredential(db *gorm.DB, credential *UserCredential) error
func CreateOIDCClient ¶
func CreateOIDCClient(db *gorm.DB, client *OidcClient) error
func UpdateCredential ¶
func UpdateOIDCClient ¶
func UpdateOIDCClient(db *gorm.DB, client *OidcClient) error
Types ¶
type Client ¶
type ClientScope ¶
type OidcClient ¶
type OidcClient struct { Name string `gorm:"primary_key;unique;not null"` ClientID string `gorm:"not null"` ClientSecret string `gorm:"not null"` RedirectURI string `gorm:"not null"` ButtonName string `gorm:"not null"` }
func GetOIDCClient ¶
func GetOIDCClient(db *gorm.DB, name string) (*OidcClient, error)
func ListOIDCClients ¶
func ListOIDCClients(db *gorm.DB) ([]OidcClient, error)
type User ¶
type User struct { Email string `gorm:"primary_key;unique;not null"` PasswordHash []byte `gorm:"not null"` DisplayName string `gorm:""` WebAuthnUserID uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"` Credentials []UserCredential Roles []Role `gorm:"many2many:user_roles;"` IsEnabled bool `gorm:"default:false;not null"` }
func (*User) WebAuthnCredentials ¶
func (user *User) WebAuthnCredentials() []webauthn.Credential
func (*User) WebAuthnDisplayName ¶
func (*User) WebAuthnID ¶
func (*User) WebAuthnIcon ¶
func (*User) WebAuthnName ¶
type UserConfirmation ¶
type UserConfirmation struct { UserEmail string `gorm:"primary_key;unique;not null"` OneTimePassword string `gorm:"not null"` ExpiryTime int64 `gorm:"not null"` ConfirmedTime int64 `gorm:"not null"` User User `gorm:"foreignKey:UserEmail"` }
func GetConfirmation ¶
func GetConfirmation(db *gorm.DB, otp string) (*UserConfirmation, error)
type UserCredential ¶
type UserCredential struct { ID []byte `gorm:"primary_key;unique;not null"` PublicKey []byte `gorm:"unique;not null"` AttestationType string `gorm:"not null"` Transport []protocol.AuthenticatorTransport `gorm:"type:text[]"` UserPresent bool `gorm:"not null"` UserVerified bool `gorm:"not null"` BackupEligible bool `gorm:"not null"` BackupState bool `gorm:"not null"` AAGUID []byte `gorm:"not null"` SignCount uint32 `gorm:"not null"` CloneWarning bool `gorm:"not null"` Attachment protocol.AuthenticatorAttachment `gorm:"not null"` UserEmail string `gorm:"uniqueIndex:idx_uniq_credential_name,priority:1;not null"` FriendlyName string `gorm:"uniqueIndex:idx_uniq_credential_name,priority:2;not null"` User User `gorm:"foreignKey:UserEmail"` }
func GetCredentials ¶
func GetCredentials(db *gorm.DB, email string) ([]UserCredential, error)
func NewUserCredential ¶
func NewUserCredential(email string, friendlyName string, cred *webauthn.Credential) *UserCredential
Click to show internal directories.
Click to hide internal directories.