feat: add provider profile removal delegation
This commit is contained in:
@@ -83,6 +83,7 @@ Code Agent session 是显式资源,不再由普通 `client agent send`、Workb
|
||||
| `hwlab-cli client access tools grant/revoke USER TOOL` | `PUT/DELETE /v1/admin/access/users/{userId}/tools/{toolId}/can-use` | 授予或撤销 `hwpod`、`unidesk_ssh`、`trans_cmd`、GitHub 写工具等 capability。 |
|
||||
| `hwlab-cli client access check --user USER --relation REL --object OBJECT` | `POST /v1/admin/access/check` | 管理员调试单次 authorization check,输出 decision 和 redacted actor/object。 |
|
||||
| `hwlab-cli client provider-profiles list` | `GET /v1/admin/provider-profiles` | 管理页的非视觉状态入口;输出 actor、profile、SecretRef、resourceVersion、hash 后缀和最近验证结果,不输出 API Key 或 Secret data。 |
|
||||
| `hwlab-cli client provider-profiles remove PROFILE` | `DELETE /v1/admin/provider-profiles/{profile}` | 删除遗留 provider profile;Cloud API 鉴权后委托 AgentRun 删除对应 Secret,内建 profile capability 保留、动态 slug 从列表消失。 |
|
||||
| `hwlab-cli client provider-profiles set-key PROFILE --key-stdin` | `PUT /v1/admin/provider-profiles/{profile}/credential` | 从 stdin 写入 provider API Key,Cloud API 鉴权后委托 AgentRun;默认只输出 resourceVersion/hash 后缀和 failureKind。 |
|
||||
| `hwlab-cli client provider-profiles validate PROFILE --wait` | `POST /v1/admin/provider-profiles/{profile}/validate` + `GET /validations/{id}` | 触发 provider canary 并短连接轮询,输出 validationId、runId、commandId、jobName、traceId、status、failureKind 和 redacted bridge 摘要。 |
|
||||
| `hwlab-cli client request POST /v1/hwpod-node-ops` | `POST /v1/hwpod-node-ops` | HWPOD node-ops 同路径 smoke;Code Agent 侧正式业务入口仍是 `hwpod`,由 `hwpod-compiler-cli` 生成 node-ops。 |
|
||||
|
||||
@@ -49,7 +49,7 @@ Provider API Key 管理属于 Cloud API 的 authenticated admin surface:前端
|
||||
| `POST /v1/admin/users` | `admin` 管理用户 role/status 的入口。 |
|
||||
| `GET/PATCH/PUT/DELETE /v1/admin/access...` | Admin Access API;唯一正式授权管理入口,读写 OpenFGA 细粒度授权、tool capability、role/status 和 effective matrix。 |
|
||||
| `POST /v1/admin/access/check` | 管理员调试授权 check;返回 mode、decision、object/relation 和 redacted actor,不返回 OpenFGA token。 |
|
||||
| `GET/PUT/POST /v1/admin/provider-profiles...` | Provider API Key 管理入口;Cloud API 鉴权和审计后委托 AgentRun 后端,返回脱敏 profile 状态、SecretRef 摘要和 canary 结果,不返回 Secret value。 |
|
||||
| `GET/PUT/POST/DELETE /v1/admin/provider-profiles...` | Provider API Key 管理入口;Cloud API 鉴权和审计后委托 AgentRun 后端,返回脱敏 profile 状态、SecretRef 摘要和 canary 结果,不返回 Secret value。 |
|
||||
| `GET/PATCH /v1/workbench/workspace`、`POST /v1/workbench/workspace/{id}/reset`、`GET /events` | 账号级共享 workspace authority;所有读写按 ownerUserId 隔离,写入使用 revision 观测冲突,active trace 只表示最近活动/当前选中 trace,不作为同账号 Code Agent 并发互斥锁。 |
|
||||
| `POST /v1/agent/sessions`、`GET/PATCH /v1/agent/sessions...` | 显式 Code Agent session 生命周期入口;创建/选择/状态标记 session,并与账号 workspace selection 同步。 |
|
||||
| `GET /v1/m3/status`、`POST /v1/m3/io` | M3 只读/受控 IO 入口;写操作必须有明确 approval。 |
|
||||
|
||||
@@ -50,13 +50,14 @@ view: provider API Key 管理
|
||||
```http
|
||||
GET /v1/provider-profiles
|
||||
GET /v1/admin/provider-profiles
|
||||
DELETE /v1/admin/provider-profiles/:profile
|
||||
PUT /v1/admin/provider-profiles/:profile/credential
|
||||
POST /v1/admin/provider-profiles/:profile/validate
|
||||
GET /v1/admin/provider-profiles/:profile/validations/:validationId
|
||||
```
|
||||
|
||||
- `/v1/provider-profiles` 是已认证用户可读的公开 catalog,只返回工作台下拉选择所需的 `profile/configured/backendKind/bridge` 等非敏感字段,用于工作台和设置页展示动态 slug。
|
||||
- `/v1/admin/provider-profiles*` 继续是管理员管理入口,负责查看 SecretRef/resourceVersion/hash 后缀、写 key/config 和触发 validate。
|
||||
- `/v1/admin/provider-profiles*` 继续是管理员管理入口,负责查看 SecretRef/resourceVersion/hash 后缀、删除旧 slug、写 key/config 和触发 validate。
|
||||
|
||||
所有接口必须先通过 [spec-v02-auth.md](spec-v02-auth.md) 恢复 `AuthPrincipal`,再按 [spec-user-access.md](spec-user-access.md) 和 [spec-v02-openfga-authorization.md](spec-v02-openfga-authorization.md) 判定是否允许访问管理能力。首版允许只对 `admin` 开放;如果后续引入 `provider_manager` 或等价 relation,必须先写入用户权限规格。
|
||||
|
||||
@@ -116,6 +117,7 @@ AgentRun deepseek profile
|
||||
|
||||
```bash
|
||||
bun tools/hwlab-cli/bin/hwlab-cli.ts client provider-profiles list
|
||||
bun tools/hwlab-cli/bin/hwlab-cli.ts client provider-profiles remove ofcx-go
|
||||
bun tools/hwlab-cli/bin/hwlab-cli.ts client provider-profiles set-key deepseek --key-stdin
|
||||
bun tools/hwlab-cli/bin/hwlab-cli.ts client provider-profiles validate deepseek --wait --timeout-ms 120000
|
||||
```
|
||||
@@ -124,6 +126,7 @@ bun tools/hwlab-cli/bin/hwlab-cli.ts client provider-profiles validate deepseek
|
||||
|
||||
- CLI 默认只使用 `HWLAB_API_KEY` 恢复同一个 HWLAB actor;已登录 Web session 只允许作为显式 `--web-session`/`--cookie` 诊断入口,不作为 provider 管理命令的默认鉴权来源。
|
||||
- `set-key --key-stdin` 从 stdin 读取 API Key,默认输出只显示 hash/resourceVersion,不打印 key。
|
||||
- `remove PROFILE` 通过 Cloud API 委托 AgentRun 删除对应 profile Secret;内建 profile 删除后 capability 仍保留,动态 slug 删除后从列表消失。
|
||||
- `validate --wait` 短连接 submit-and-poll,输出 validationId、runId、commandId、jobName、traceId、status、failureKind 和 redacted bridge upstream 摘要。
|
||||
- 这些命令不得直接调用 AgentRun 内部 URL,不得直接读写 Kubernetes Secret。
|
||||
|
||||
@@ -162,6 +165,6 @@ AgentRun event/trace 只允许显示 provider profile、SecretRef 摘要、valid
|
||||
| HWLAB 管理页规格 | 已定义/已接入 | 本文为 `v0.2` provider API Key 管理的 HWLAB 权威规格;Cloud Web 已提供 `#/management` 管理页。 |
|
||||
| Cloud API 委托接口 | 已实现 | `/v1/admin/provider-profiles*` 由 HWLAB Cloud API 鉴权授权后委托 AgentRun `/api/v1/provider-profiles*`,HWLAB 不直写 AgentRun Secret。 |
|
||||
| AgentRun provider profile 管理 API | 已对接 | 依赖 AgentRun `v0.1` `agentrun-mgr` provider profile 管理 API;后端长期规格和后续硬化项见 [pikasTech/agentrun#28](https://github.com/pikasTech/agentrun/issues/28)。 |
|
||||
| CLI 同路径入口 | 已实现 | `client provider-profiles list/set-key/validate/validation` 走 HWLAB Cloud Web 同源 API,用作管理页的非视觉同路径验收入口。 |
|
||||
| CLI 同路径入口 | 已实现 | `client provider-profiles list/remove/set-key/validate/validation` 走 HWLAB Cloud Web 同源 API,用作管理页的非视觉同路径验收入口。 |
|
||||
| DeepSeek canary | 已验证 | DeepSeek profile 经 `hwlab-deepseek-proxy.hwlab-v02.svc.cluster.local:4000/v1` 到 `/v1/responses`,验收必须继续证明不访问 `hyueapi.com`。 |
|
||||
| Secret 脱敏 | 已实现/持续约束 | Web、Cloud API、CLI 和 issue 证据不得回显完整 API Key;AgentRun Secret 写入的 `last-applied-configuration` 硬化由 AgentRun 侧继续跟踪。 |
|
||||
|
||||
Reference in New Issue
Block a user