| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| account | ||
| api | ||
| app/detail | ||
| chat | ||
| config/tool | ||
| dashboard | ||
| dataset | ||
| login | ||
| price | ||
| skill | ||
| 404.tsx | ||
| _app.tsx | ||
| _document.tsx | ||
| _error.tsx | ||
| devapidoc.tsx | ||
| index.module.scss | ||
| index.tsx | ||
| openapi.tsx |
问题 (#7006):
通过 API Key 调用知识库更新接口(api/core/dataset/update)返回 403
unAuthorization。API Key 可正常使用 list/create/delete,唯独 update 报错。
根因:
update.ts 中 authDataset/authUserPer 调用缺少 authApiKey: true。
parseHeaderCert() 默认 authApiKey=false,API Key 鉴权分支不会被执行,
请求走到末尾被拒绝。
对比其他端点:
- create.ts — authDataset({ authApiKey: true, ... }) ✓
- collection/create.ts — authDataset({ authApiKey: true, ... }) ✓
- collection/list.ts — authDataset({ authApiKey: true, ... }) ✓
- update.ts — authDataset 和 authUserPer 均缺少 authApiKey ✗
改动:
update.ts 四处调用各添加 authApiKey: true:
1. authDataset 主入口 Read 权限检查 (L88)
2. authDataset 移动目标文件夹 Manage 权限检查 (L109)
3. authDataset 移动源文件夹 Manage 权限检查 (L122)
4. authUserPer 移动至/从根目录的团队创建权限检查 (L132)
测试:
新增 projects/app/test/api/core/dataset/update.test.ts:
- token 认证更新数据集
- API Key 认证更新数据集
Fixes #7006
Signed-off-by: DadaVinqi <DadaVinqi@users.noreply.github.com>
Co-authored-by: DadaVinqi <DadaVinqi@users.noreply.github.com>
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| account | Loading commit data... | |
| api | Loading commit data... | |
| app/detail | Loading commit data... | |
| chat | Loading commit data... | |
| config/tool | Loading commit data... | |
| dashboard | Loading commit data... | |
| dataset | Loading commit data... | |
| login | Loading commit data... | |
| price | Loading commit data... | |
| skill | Loading commit data... | |
| 404.tsx | Loading commit data... | |
| _app.tsx | Loading commit data... | |
| _document.tsx | Loading commit data... | |
| _error.tsx | Loading commit data... | |
| devapidoc.tsx | Loading commit data... | |
| index.module.scss | Loading commit data... | |
| index.tsx | Loading commit data... | |
| openapi.tsx | Loading commit data... |