Files
yhy-mager/docs/license-contract-draft.md
xiewenjun 54c318c615
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled
feat: implement license platform business flows and delivery tooling
Add admin and customer interfaces, orders, signed activation and leases, protected package delivery, keyring verification, migrations, security controls, tests and deployment documentation.

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
2026-10-09 15:33:22 +08:00

11 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 授权签发闭环草案
版本:DEV-LICENSE-v0.1(2026-09-30)。状态:开发假设,未替代正式业务决策或 OpenAPI 签字。
- 当前授权是后台管理员为 active 客户和 active 产品签发的一条期限记录。
- `starts_at` 和 `expires_at` 必须是 RFC3339 时间,服务端转 UTC 保存;结束时间必须晚于开始时间,精度为微秒;当前 TIMESTAMP 存储范围限定为 1970-01-01T00:00:01Z 至 2038-01-19T03:14:07Z(上界不含)。
- 授权初始状态为 `active`,拥有不可预测的 128-bit 十六进制 `license_key`。本阶段仅提供后台查看,不把它当作客户端激活凭证。
- 请求必须带 `Idempotency-Key`(1 至 128 字符)。同一管理员、同一键、同一请求字段重放返回原授权;字段不一致返回 409。管理员行锁串行化并发签发,客户/产品行锁确保状态校验一致;事务不会产生第二条授权或第二条签发审计。前端网络失败后保留原键重试。
- 签发事务同时写 `audit_events`,审计只记录管理员、资源、动作和非敏感期限/主数据 ID,不记录密码、会话令牌或完整 HTTP 内容。
- 本阶段不实现实例身份绑定、激活协议、离线租约、设备扩容/克隆、心跳、退款、客户门户或下载权限。新增的撤销/续期仅是后台期限记录开发假设:管理员级权限、Idempotency-Key、锁定授权行的事务操作记录与审计;续期只允许延后结束时间,撤销后不得续期。它们不等同续费、订单发放、激活或正式冻结/解绑。正式状态机、授权码展示/轮换、租户隔离和审计保留策略待确认。