fix(access): 统一 API Key 模型权限与列表契约
将全局启用、用户组基线、API Key 专属或排除规则及 scope 按固定顺序求值,避免 Key 越过所属用户组权限,并让运行时候选与模型列表共用同一权限链。 新增 Key 级可分配模型与失效规则诊断接口、OpenAI 兼容 /v1/models 及 rich 列表迁移路径;前端权限弹窗改为按当前 Key 实时加载并支持清理失效规则。 验证:Go 全量测试与 go vet 通过;Web 22 个测试文件共 142 项通过;pnpm lint、pnpm openapi、pnpm build、Compose 配置、gofmt、ShellCheck 和 git diff --check 通过;独立 PostgreSQL 真实配置验收通过。
This commit is contained in:
@@ -39,7 +39,7 @@ https://ai.51easyai.com/api/v1
|
||||
| GET, POST | `/api/v1/api-keys` | 查询、创建 API Key |
|
||||
| GET | `/api/v1/api-keys/access-rules` | 查询 Key 访问规则 |
|
||||
| POST | `/api/v1/api-keys/access-rules/batch` | 批量设置 Key 访问规则 |
|
||||
| GET | `/api/v1/api-keys/assignable-models` | 查询可分配模型 |
|
||||
| GET | `/api/v1/api-keys/{apiKeyID}/assignable-models` | 查询指定 Key 可分配模型与规则诊断 |
|
||||
| PATCH | `/api/v1/api-keys/{apiKeyID}/scopes` | 更新 Key 权限范围 |
|
||||
| PATCH | `/api/v1/api-keys/{apiKeyID}/disable` | 禁用 Key |
|
||||
| DELETE | `/api/v1/api-keys/{apiKeyID}` | 删除 Key |
|
||||
@@ -50,7 +50,9 @@ https://ai.51easyai.com/api/v1
|
||||
|---|---|---|
|
||||
| GET | `/api/v1/model-catalog` | 模型能力目录 |
|
||||
| GET | `/api/v1/platforms` | 当前用户可用平台 |
|
||||
| GET | `/api/v1/models` | 当前用户可用模型 |
|
||||
| GET | `/api/v1/platform-models` | 当前身份可用的平台模型来源明细 |
|
||||
| GET | `/v1/models` | OpenAI 兼容逻辑模型列表 |
|
||||
| GET | `/api/v1/models` | 已弃用的平台模型来源明细(兼容期) |
|
||||
| GET | `/api/v1/playground/models` | Playground 可用模型 |
|
||||
| POST | `/api/v1/pricing/estimate` | 请求价格预估 |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user