更新依赖项,优化 OAuth2 服务,添加 PKCE 支持,增强 OIDC 处理器,新增客户端注册和令牌管理端点,改进数据库模型以支持新功能。
This commit is contained in:
@@ -8,13 +8,16 @@ import (
|
||||
|
||||
type AuthorizationCode struct {
|
||||
gorm.Model
|
||||
Code string `gorm:"uniqueIndex;not null"`
|
||||
ClientID string `gorm:"not null"`
|
||||
UserID uint `gorm:"not null"`
|
||||
RedirectURI string `gorm:"not null"`
|
||||
Scope string `gorm:"not null"`
|
||||
ExpiresAt time.Time `gorm:"not null"`
|
||||
Used bool `gorm:"default:false"`
|
||||
Code string `gorm:"uniqueIndex;not null"`
|
||||
ClientID string `gorm:"not null"`
|
||||
UserID uint `gorm:"not null"`
|
||||
RedirectURI string `gorm:"not null"`
|
||||
Scope string `gorm:"not null"`
|
||||
ExpiresAt time.Time `gorm:"not null"`
|
||||
Used bool `gorm:"default:false"`
|
||||
CodeChallenge string `gorm:"type:varchar(128)"`
|
||||
CodeChallengeMethod string `gorm:"type:varchar(20)"`
|
||||
Nonce string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
|
||||
func (ac *AuthorizationCode) TableName() string {
|
||||
|
||||
@@ -3,19 +3,30 @@ package models
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/datatypes"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
gorm.Model
|
||||
ClientID string `gorm:"uniqueIndex;not null"`
|
||||
ClientSecret string `gorm:"not null"`
|
||||
RedirectURIs []string `gorm:"type:json"`
|
||||
GrantTypes []string `gorm:"type:json"`
|
||||
Scopes []string `gorm:"type:json"`
|
||||
IsActive bool `gorm:"default:true"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
ClientID string `gorm:"uniqueIndex;not null"`
|
||||
ClientSecret string `gorm:"not null"`
|
||||
RedirectURIs datatypes.JSON `gorm:"type:json"`
|
||||
TokenEndpointAuthMethod string `gorm:"not null"`
|
||||
GrantTypes datatypes.JSON `gorm:"type:json"`
|
||||
ResponseTypes datatypes.JSON `gorm:"type:json"`
|
||||
ClientName string `gorm:"type:varchar(255)"`
|
||||
ClientURI string `gorm:"type:varchar(255)"`
|
||||
LogoURI string `gorm:"type:varchar(255)"`
|
||||
Scopes datatypes.JSON `gorm:"type:json"`
|
||||
Contacts datatypes.JSON `gorm:"type:json"`
|
||||
TosURI string `gorm:"type:varchar(255)"`
|
||||
PolicyURI string `gorm:"type:varchar(255)"`
|
||||
SoftwareID string `gorm:"type:varchar(255)"`
|
||||
SoftwareVersion string `gorm:"type:varchar(255)"`
|
||||
IsActive bool `gorm:"default:true"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (c *Client) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user