feat: support permanent credentials and overlapping token rotation
This commit is contained in:
@@ -15,6 +15,10 @@ type Credential struct {
|
||||
Name string `db:"name"`
|
||||
// SecretDigest 凭据秘密的 SHA-256 摘要,不保存或输出原文。
|
||||
SecretDigest core.Digest `db:"secret_digest"`
|
||||
// PreviousSecretDigest 上一代秘密摘要;仅过渡期使用,空表示未保留旧令牌。
|
||||
PreviousSecretDigest *core.Digest `db:"previous_secret_digest"`
|
||||
// PreviousValidUntil 旧令牌的固定 UTC 截止;不晚于原到期时间,与旧摘要同时为空或非空。
|
||||
PreviousValidUntil *time.Time `db:"previous_valid_until"`
|
||||
// Permissions 授权范围的 JSON 快照,必须由服务端解释和校验。
|
||||
Permissions core.JSON `db:"permissions"`
|
||||
// ExpiresAt 凭据过期时间,统一 UTC;为空表示没有配置到期时间。
|
||||
|
||||
Reference in New Issue
Block a user