feat: let administrators view and copy encrypted integration credentials
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Package auth 定义凭据格式与权限快照;凭据原文仅在签发时交付。
|
||||
// Package auth 定义凭据格式与权限快照;凭据原文通过签发或管理员审计读取接口交付。
|
||||
package auth
|
||||
|
||||
import (
|
||||
|
||||
@@ -6,15 +6,19 @@ import (
|
||||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||||
)
|
||||
|
||||
// Credential 表示命名空间凭据,只保存秘密摘要和授权范围。
|
||||
// Credential 表示命名空间凭据,保存认证摘要、授权范围及可选的当前 Token 密文。
|
||||
// 对应表 orbit_credentials;这是服务端持久化模型,不直接作为 API 响应。
|
||||
type Credential struct {
|
||||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||||
core.Record
|
||||
// Name 可读名称,唯一性范围由对应数据表约束。
|
||||
Name string `db:"name"`
|
||||
// SecretDigest 凭据秘密的 SHA-256 摘要,不保存或输出原文。
|
||||
// SecretDigest 凭据秘密的 SHA-256 摘要,用于业务认证,不输出原文。
|
||||
SecretDigest core.Digest `db:"secret_digest"`
|
||||
// SecretKeyID 当前 Token 密文使用的主密钥标识;空表示尚未保管,与密文同时为空。
|
||||
SecretKeyID *string `db:"secret_key_id"`
|
||||
// SecretCiphertext AES-256-GCM nonce 与认证密文,最多 1024 字节;仅管理员接口可解密。
|
||||
SecretCiphertext []byte `db:"secret_ciphertext"`
|
||||
// PreviousSecretDigest 上一代秘密摘要;仅过渡期使用,空表示未保留旧令牌。
|
||||
PreviousSecretDigest *core.Digest `db:"previous_secret_digest"`
|
||||
// PreviousValidUntil 旧令牌的固定 UTC 截止;不晚于原到期时间,与旧摘要同时为空或非空。
|
||||
|
||||
Reference in New Issue
Block a user