更新依赖项,优化 OAuth2 服务,添加 PKCE 支持,增强 OIDC 处理器,新增客户端注册和令牌管理端点,改进数据库模型以支持新功能。

This commit is contained in:
2025-04-17 01:25:46 +08:00
parent 0368547137
commit a3f3cc17cf
13 changed files with 738 additions and 70 deletions

View File

@@ -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 {