Auth config to limit auth steps

This commit is contained in:
2024-10-13 01:45:08 +08:00
parent 0f18c6ff16
commit 9287e6c5cc
6 changed files with 60 additions and 9 deletions

View File

@@ -12,14 +12,15 @@ import (
type Account struct {
BaseModel
Name string `json:"name" gorm:"uniqueIndex"`
Nick string `json:"nick"`
Description string `json:"description"`
Avatar *string `json:"avatar"`
Banner *string `json:"banner"`
ConfirmedAt *time.Time `json:"confirmed_at"`
SuspendedAt *time.Time `json:"suspended_at"`
PermNodes datatypes.JSONMap `json:"perm_nodes"`
Name string `json:"name" gorm:"uniqueIndex"`
Nick string `json:"nick"`
Description string `json:"description"`
Avatar *string `json:"avatar"`
Banner *string `json:"banner"`
ConfirmedAt *time.Time `json:"confirmed_at"`
SuspendedAt *time.Time `json:"suspended_at"`
PermNodes datatypes.JSONMap `json:"perm_nodes"`
AuthConfig datatypes.JSONType[AuthConfig] `json:"auth_config"`
AutomatedBy *Account `json:"automated_by" gorm:"foreignKey:AutomatedID"`
AutomatedID *uint `json:"automated_id"`

View File

@@ -7,6 +7,10 @@ import (
"gorm.io/datatypes"
)
type AuthConfig struct {
MaximumAuthSteps int `json:"maximum_auth_steps" validate:"required,min=1"`
}
type AuthFactorType = int8
const (