Documentation
¶
Index ¶
- func PutAccount(model *AccountModel) error
- func UpdateAccountCredentials(model *AccountModel) error
- type AccountModel
- func (u *AccountModel) AddCredential(cred webauthn.Credential)
- func (u *AccountModel) CredentialExcludeList() []protocol.CredentialDescriptor
- func (model *AccountModel) MarshalCredentials() (string, error)
- func (u *AccountModel) WebAuthnCredentials() []webauthn.Credential
- func (u *AccountModel) WebAuthnDisplayName() string
- func (u *AccountModel) WebAuthnID() []byte
- func (u *AccountModel) WebAuthnIcon() string
- func (u *AccountModel) WebAuthnName() string
- type AccountTable
- type ClientModel
- func (c *ClientModel) GetAudience() fosite.Arguments
- func (c *ClientModel) GetGrantTypes() fosite.Arguments
- func (c *ClientModel) GetHashedSecret() []byte
- func (c *ClientModel) GetID() string
- func (c *ClientModel) GetRedirectURIs() []string
- func (c *ClientModel) GetResponseTypes() fosite.Arguments
- func (c *ClientModel) GetRotatedHashes() [][]byte
- func (c *ClientModel) GetScopes() fosite.Arguments
- func (c *ClientModel) IsPublic() bool
- type ClientTable
- type WebauthnCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PutAccount ¶
func PutAccount(model *AccountModel) error
func UpdateAccountCredentials ¶
func UpdateAccountCredentials(model *AccountModel) error
Types ¶
type AccountModel ¶
type AccountModel struct {
AccountTable
WebauthnCredentials
}
func GetAccount ¶
func GetAccount(account string) (*AccountModel, error)
func NewAccountModel ¶
func NewAccountModel(name string, displayName string) *AccountModel
NewAccountModel creates and returns a new User
func (*AccountModel) AddCredential ¶
func (u *AccountModel) AddCredential(cred webauthn.Credential)
AddCredential associates the credential to the user
func (*AccountModel) CredentialExcludeList ¶
func (u *AccountModel) CredentialExcludeList() []protocol.CredentialDescriptor
CredentialExcludeList returns a CredentialDescriptor array filled with all the user's credentials
func (*AccountModel) MarshalCredentials ¶
func (model *AccountModel) MarshalCredentials() (string, error)
func (*AccountModel) WebAuthnCredentials ¶
func (u *AccountModel) WebAuthnCredentials() []webauthn.Credential
WebAuthnCredentials returns credentials owned by the user
func (*AccountModel) WebAuthnDisplayName ¶
func (u *AccountModel) WebAuthnDisplayName() string
WebAuthnDisplayName returns the user's display name
func (*AccountModel) WebAuthnID ¶
func (u *AccountModel) WebAuthnID() []byte
WebAuthnID returns the user's ID
func (*AccountModel) WebAuthnIcon ¶
func (u *AccountModel) WebAuthnIcon() string
WebAuthnIcon is not (yet) implemented
func (*AccountModel) WebAuthnName ¶
func (u *AccountModel) WebAuthnName() string
WebAuthnName returns the user's username
type AccountTable ¶
type AccountTable struct {
Pk string `json:"pk"` // 主键标识
Account string `json:"uname"` // 账号
Password string `json:"upass"` // 密码
CreateAt time.Time `json:"createat"`
UpdateAt time.Time `json:"updateat"`
Nickname string `json:"nickname"`
Mail sql.NullString `json:"mail"`
Credentials sql.NullString `json:"credentials"`
}
type ClientModel ¶
type ClientModel struct {
ID string `json:"id"`
Secret []byte `json:"client_secret,omitempty"`
RotatedSecrets [][]byte `json:"rotated_secrets,omitempty"`
RedirectURIs []string `json:"redirect_uris"`
GrantTypes []string `json:"grant_types"`
ResponseTypes []string `json:"response_types"`
Scopes []string `json:"scopes"`
Audience []string `json:"audience"`
Public bool `json:"public"`
}
func GetClient ¶
func GetClient(id string) (*ClientModel, error)
func (*ClientModel) GetAudience ¶
func (c *ClientModel) GetAudience() fosite.Arguments
func (*ClientModel) GetGrantTypes ¶
func (c *ClientModel) GetGrantTypes() fosite.Arguments
func (*ClientModel) GetHashedSecret ¶
func (c *ClientModel) GetHashedSecret() []byte
func (*ClientModel) GetID ¶
func (c *ClientModel) GetID() string
func (*ClientModel) GetRedirectURIs ¶
func (c *ClientModel) GetRedirectURIs() []string
func (*ClientModel) GetResponseTypes ¶
func (c *ClientModel) GetResponseTypes() fosite.Arguments
func (*ClientModel) GetRotatedHashes ¶
func (c *ClientModel) GetRotatedHashes() [][]byte
func (*ClientModel) GetScopes ¶
func (c *ClientModel) GetScopes() fosite.Arguments
func (*ClientModel) IsPublic ¶
func (c *ClientModel) IsPublic() bool
type ClientTable ¶
type ClientTable struct {
Pk string `json:"pk"`
ID string `json:"id"`
Secret string `json:"secret"`
RotatedSecrets sql.NullString `json:"rotated_secrets" db:"rotated_secrets"`
RedirectURIs sql.NullString `json:"redirect_uris" db:"redirect_uris"`
GrantTypes sql.NullString `json:"grant_types" db:"grant_types"`
ResponseTypes sql.NullString `json:"response_types" db:"response_types"`
Scopes sql.NullString `json:"scopes"`
Audience sql.NullString `json:"audience"`
Public sql.NullInt32 `json:"public"`
}
func (*ClientTable) ToModel ¶
func (t *ClientTable) ToModel() *ClientModel
type WebauthnCredentials ¶
type WebauthnCredentials struct {
CredentialsSlice []webauthn.Credential
}
Click to show internal directories.
Click to hide internal directories.