2026-06-03 12:13:42 +08:00

22 lines
1.3 KiB
Markdown
Raw 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.

# license-limits-core
这是 FLNXI 授权模块链路中的基础限额模块。所有版本都需要通过验证系统拿到这个模块授权,用来承载“用户数上限、素材数上限”这类商业规则。
当前状态:
- 提供 `/health` 健康检查。
- 提供 `/status` 能力状态。
- 提供 `/capabilities` 能力清单。
- 提供 `/authorize` 授权决策入口,接收 `{ action, context }`,当前只允许 `licenseLimits:check/read/validate/enforce`。
- 提供 `/limits` 合同入口,但具体限额必须来自验证系统签发的实例授权,不在镜像里写死。
- 提供 `/limits/enforce` 限额执行入口,接收 `{ type, current, limits }`,由模块判断当前用户数/素材数是否还能新增。
执行边界:主应用负责从数据库统计当前用户数或素材数,并负责校验本地许可证、模块授权凭证和模块运行态;本模块负责根据验证系统签发的上限和当前数量给出最终允许/拒绝结果。它不要求客户每次操作都联网访问验证服务器,但本模块容器必须在客户本机运行并可被主应用访问。
发布后需要把固定镜像和 digest 写入 `license-server`:
```env
PREMIUM_MODULE_LICENSE_LIMITS_CORE_IMAGE=registry.example.com:5000/flnxi/premium/license-limits-core:1.0.0
PREMIUM_MODULE_LICENSE_LIMITS_CORE_DIGEST=sha256:...
```