Documentation
¶
Index ¶
- Constants
- type Account
- type AccountContact
- type AccountContactType
- type AccountProfile
- type ActionEvent
- type AuthChallenge
- type AuthChallengeState
- type AuthFactor
- type AuthFactorType
- type AuthSession
- type BaseModel
- type JSONMap
- type MagicToken
- type MagicTokenType
- type Notification
- type NotificationLink
- type NotificationSubscriber
- type ThirdClient
Constants ¶
View Source
const ( PasswordAuthFactor = AuthFactorType(iota) EmailPasswordFactor )
View Source
const ( ActiveChallengeState = AuthChallengeState(iota) ExpiredChallengeState FinishChallengeState )
View Source
const ( ConfirmMagicToken = MagicTokenType(iota) RegistrationMagicToken )
View Source
const (
EmailAccountContact = AccountContactType(iota)
)
View Source
const (
NotifySubscriberFirebase = "firebase"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
BaseModel
Name string `json:"name" gorm:"uniqueIndex"`
Nick string `json:"nick"`
Avatar string `json:"avatar"`
Profile AccountProfile `json:"profile"`
Sessions []AuthSession `json:"sessions"`
Challenges []AuthChallenge `json:"challenges"`
Factors []AuthFactor `json:"factors"`
Contacts []AccountContact `json:"contacts"`
Events []ActionEvent `json:"events"`
MagicTokens []MagicToken `json:"-" gorm:"foreignKey:AssignTo"`
ThirdClients []ThirdClient `json:"clients"`
Notifications []Notification `json:"notifications" gorm:"foreignKey:RecipientID"`
NotifySubscribers []NotificationSubscriber `json:"notify_subscribers"`
ConfirmedAt *time.Time `json:"confirmed_at"`
PowerLevel int `json:"power_level"`
}
func (Account) GetAvatarPath ¶
func (Account) GetPrimaryEmail ¶
func (v Account) GetPrimaryEmail() AccountContact
type AccountContact ¶
type AccountContactType ¶
type AccountContactType = int8
type AccountProfile ¶
type ActionEvent ¶
type AuthChallenge ¶
type AuthChallenge struct {
BaseModel
Location string `json:"location"`
IpAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
RiskLevel int `json:"risk_level"`
Progress int `json:"progress"`
Requirements int `json:"requirements"`
BlacklistFactors datatypes.JSONType[[]uint] `json:"blacklist_factors"`
State int8 `json:"state"`
ExpiredAt time.Time `json:"expired_at"`
SessionID *uint `json:"session_id"`
AccountID uint `json:"account_id"`
}
func (AuthChallenge) IsAvailable ¶
func (v AuthChallenge) IsAvailable() error
type AuthChallengeState ¶
type AuthChallengeState = int8
type AuthFactor ¶
type AuthFactorType ¶
type AuthFactorType = int8
type AuthSession ¶
type AuthSession struct {
BaseModel
Claims datatypes.JSONSlice[string] `json:"claims"`
Audiences datatypes.JSONSlice[string] `json:"audiences"`
Challenge AuthChallenge `json:"challenge" gorm:"foreignKey:SessionID"`
GrantToken string `json:"grant_token"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiredAt *time.Time `json:"expired_at"`
AvailableAt *time.Time `json:"available_at"`
LastGrantAt *time.Time `json:"last_grant_at"`
ClientID *uint `json:"client_id"`
AccountID uint `json:"account_id"`
}
func (AuthSession) IsAvailable ¶
func (v AuthSession) IsAvailable() error
type MagicToken ¶
type MagicTokenType ¶
type MagicTokenType = int8
type Notification ¶
type Notification struct {
BaseModel
Subject string `json:"subject"`
Content string `json:"content"`
Links datatypes.JSONSlice[NotificationLink] `json:"links"`
IsImportant bool `json:"is_important"`
ReadAt *time.Time `json:"read_at"`
SenderID *uint `json:"sender_id"`
RecipientID uint `json:"recipient_id"`
}
type NotificationLink ¶
NotificationLink Used to embed into notify and render actions
type NotificationSubscriber ¶
type ThirdClient ¶
type ThirdClient struct {
BaseModel
Alias string `json:"alias" gorm:"uniqueIndex"`
Name string `json:"name"`
Description string `json:"description"`
Secret string `json:"secret"`
Urls datatypes.JSONSlice[string] `json:"urls"`
Callbacks datatypes.JSONSlice[string] `json:"callbacks"`
Sessions []AuthSession `json:"sessions" gorm:"foreignKey:ClientID"`
Notifications []Notification `json:"notifications" gorm:"foreignKey:SenderID"`
IsDraft bool `json:"is_draft"`
AccountID *uint `json:"account_id"`
}
Click to show internal directories.
Click to hide internal directories.