Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

token-exchange-aiac: put the refusal reason in the rejection, not only the message

Đã đóng Phù hợp với người mới
#1,570 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu tại core/plugins/tokenexchangeaiac/plugin.go, ở deny(), sau đó đọc docs/token-exchange-aiac-plugin.md và kiểm tra các dạng phản hồi từ chối. Thêm lý do ổn định vào details cho mỗi trường hợp từ chối và ghi lại hợp đồng đó. Hoàn thành khi các đích bị vô hiệu hóa và chưa được cấp quyền hiển thị lý do bắt buộc trong cả phần thân 403 thông thường lẫn error.data.details của JSON-RPC.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

aiac enhancement

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"} (and audience_not_granted, exchange_failed, no_token, foreign_namespace), so it reaches the caller in the plain 403 body (details) and in error.data.details of the JSON-RPC frame.
  • Document the field in docs/token-exchange-aiac-plugin.md as part of the contract.

Acceptance criteria

  • A refusal of a disabled target carries details.reason == "target_disabled"; a refusal of an ungranted target carries details.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.

Ngôn ngữ chính
Go
Star
21
Fork
43
Merge trung bình
13 giờ 8 phút
Pull request đã merge (30 ngày)
267

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rossoctl/cortex

Tất cả issue của rossoctl/cortex

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.