批量更新

This commit is contained in:
2026-09-20 00:19:08 +08:00
parent fa281363fb
commit c5ed596008
47 changed files with 5385 additions and 1199 deletions
+8 -2
View File
@@ -42,6 +42,10 @@ type Claims struct {
Scope string `json:"scope,omitempty"`
Amr string `json:"amr,omitempty"` // 认证方式:pwd/sms/otp/wx/...
// Events OIDC 事件声明,用于 Back-Channel Logout:
// {"http://schemas.openid.net/event/backchannel-logout": {}}
Events map[string]interface{} `json:"events,omitempty"`
jwt.RegisteredClaims
}
@@ -147,8 +151,9 @@ type TokenOptions struct {
Amr string
Subject string
Audience []string
Jti string // JWT ID,用于吊销(登出/踢下线)
TTL time.Duration // 留空默认 30 分钟
Jti string // JWT ID,用于吊销(登出/踢下线)
Events map[string]interface{} // OIDC 事件声明(Back-Channel Logout 用)
TTL time.Duration // 留空默认 30 分钟
Kid string
}
@@ -178,6 +183,7 @@ func SignToken(opt TokenOptions) (string, error) {
Sid: opt.Sid,
Scope: opt.Scope,
Amr: opt.Amr,
Events: opt.Events,
RegisteredClaims: jwt.RegisteredClaims{
ID: opt.Jti,
Subject: opt.Subject,