token-exchange-aiac: put the refusal reason in the rejection, not only the message
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go
调研方向
从 core/plugins/tokenexchangeaiac/plugin.go 中的 deny() 开始,然后阅读 docs/token-exchange-aiac-plugin.md 并检查拒绝响应的形式。为每种拒绝情况将稳定的原因添加到 details,并记录这一约定。禁用的目标和未获授权的目标在普通 403 响应体和 JSON-RPC 的 error.data.details 中都能提供所需原因时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Background
token-exchange-aiac answers two different refusals with the same 403 policy.forbidden:
audience_not_granted: Keycloak has a client for the destination, but the caller is not granted it.target_disabled: the destination's client is disabled, for example a quarantined service.
The reason is recorded in the session event (pctx.Record(... Reason: reason ...)), but the rejection the caller sees carries no Details: deny() in core/plugins/tokenexchangeaiac/plugin.go returns pipeline.DenyStatus(status, code, msg). Only the human-readable message tells them apart ("the destination's client is disabled" vs "this workload is not granted the destination's audience").
rossoctl/aiac's system harness must tell them apart: its quarantine test (test_failed_tool_outbound_call_denied) counts a refusal as "blocked by the quarantine" only for target_disabled. It matches the message text, a copy of the cortex string, which breaks if the message is reworded. Raised in the review of rossoctl/aiac#242.
Task
- Put the machine-stable reason in the rejection, for example
Details: {"reason": "target_disabled"}(andaudience_not_granted,exchange_failed,no_token,foreign_namespace), so it reaches the caller in the plain 403 body (details) and inerror.data.detailsof the JSON-RPC frame. - Document the field in
docs/token-exchange-aiac-plugin.mdas part of the contract.
Acceptance criteria
- A refusal of a disabled target carries
details.reason == "target_disabled"; a refusal of an ungranted target carriesdetails.reason == "audience_not_granted", in both rejection shapes. - The message text is no longer the only way to tell them apart.
Follow-up on the AIAC side: key target_disabled_refusal (k8s/authbridge-rejection.py) on the reason instead of the message.
- 主要语言
- Go
- 星标
- 21
- 派生
- 43
- 平均合并
- 13 小时 8 分钟
- 30 天内合并 PR
- 267
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rossoctl/cortex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
UI shows costs for all sessions even when drilled into a session可能已有人在做 @esnible 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
rossoctl/cortex#1116 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 70/100
维护者通常 1 天内回复
-
难度 4/5 一周以上 新手友好度 18/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
schema-drift
难度 2/5 1-3 小时 新手友好度 72/100
stefanhoth/paperless-ngx-cli#61 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
slavakurilyak/awesome-ai-agents#888 ·
维护者通常 1 天内回复
-
enhancement nav-pilot
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
kind/enhancement
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复