Add Identity Provider to support Authentication via Authentik,OpenID ,etc..
This commit is contained in:
parent
0647725c68
commit
430f46ffee
10 changed files with 269 additions and 30 deletions
|
@ -7,18 +7,18 @@ import (
|
|||
)
|
||||
|
||||
type User struct {
|
||||
ID int `json:"id" gorm:"primary_key"` // Unique identifier
|
||||
DisplayName string `json:"displayName" gorm:"column:display_name"` // Display name
|
||||
Username string `json:"username" gorm:"column:username;unique"` // Username (unique)
|
||||
Email string `json:"email" gorm:"column:email;unique"` // Email (unique)
|
||||
Provider int `json:"provider" gorm:"column:provider"` // Provider
|
||||
Password string `json:"-" gorm:"column:password"` // Password
|
||||
CircleID int `json:"circleID" gorm:"column:circle_id"` // Circle ID
|
||||
ChatID int64 `json:"chatID" gorm:"column:chat_id"` // Telegram chat ID
|
||||
Image string `json:"image" gorm:"column:image"` // Image
|
||||
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` // Created at
|
||||
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` // Updated at
|
||||
Disabled bool `json:"disabled" gorm:"column:disabled"` // Disabled
|
||||
ID int `json:"id" gorm:"primary_key"` // Unique identifier
|
||||
DisplayName string `json:"displayName" gorm:"column:display_name"` // Display name
|
||||
Username string `json:"username" gorm:"column:username;unique"` // Username (unique)
|
||||
Email string `json:"email" gorm:"column:email;unique"` // Email (unique)
|
||||
Provider AuthProvider `json:"provider" gorm:"column:provider"` // Provider
|
||||
Password string `json:"-" gorm:"column:password"` // Password
|
||||
CircleID int `json:"circleID" gorm:"column:circle_id"` // Circle ID
|
||||
ChatID int64 `json:"chatID" gorm:"column:chat_id"` // Telegram chat ID
|
||||
Image string `json:"image" gorm:"column:image"` // Image
|
||||
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` // Created at
|
||||
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` // Updated at
|
||||
Disabled bool `json:"disabled" gorm:"column:disabled"` // Disabled
|
||||
// Email string `json:"email" gorm:"column:email"` // Email
|
||||
CustomerID *string `gorm:"column:customer_id;<-:false"` // read only column
|
||||
Subscription *string `json:"subscription" gorm:"column:subscription;<-:false"` // read only column
|
||||
|
@ -48,3 +48,10 @@ type UserNotificationTarget struct {
|
|||
TargetID string `json:"target_id" gorm:"column:target_id"` // Target ID
|
||||
CreatedAt time.Time `json:"-" gorm:"column:created_at"`
|
||||
}
|
||||
type AuthProvider int
|
||||
|
||||
const (
|
||||
AuthProviderDonetick AuthProvider = iota
|
||||
AuthProviderOAuth2
|
||||
AuthProviderGoogle
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue