token-exchange-aiac: put the refusal reason in the rejection, not only the message
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- backend-api-design
Research direction
Start in core/plugins/tokenexchangeaiac/plugin.go at deny(), then read docs/token-exchange-aiac-plugin.md and inspect the rejection response shapes. Add the stable reason to details for each refusal and document that contract. Done when disabled and ungranted targets expose the required reason in both the plain 403 body and JSON-RPC error.data.details.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 21
- Forks
- 43
- Avg merge
- 14h 25m
- Merged PRs (30d)
- 245
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rossoctl/cortex
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
rossoctl/cortex#1546 · 1 comment ·
Maintainers usually reply within 1 day
-
UI shows costs for all sessions even when drilled into a sessionPossibly taken @esnible claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
rossoctl/cortex#1116 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
bug laptop
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
bug: Copied listener and parser code has drifted (hop-by-hop response headers, SSE BOM/CR handling)Openbug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 49/100
Maintainers usually reply within 1 day
Similar issues
-
Object Manager 1.13 resets a vCLU after sending a projectPossibly taken @tciunelis claimed this today. Openbug ready ticket
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Domktorymysli/vclu#152 ·
Maintainers usually reply within 1 day
-
bug converter
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
grafana/sigma-rule-deployment#435 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
🤖 verification skills: harden check.sh and verify.sh argument and file handling (#391 follow-ups)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
google/go-containerregistry#2491 ·
Maintainers usually reply within 1 day