[BUG] A2A HTTP endpoints answer 401 without a WWW-Authenticate challenge

Đang mở Phù hợp với người mới
#3,792 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
82/100
Loại issue
Lỗi
Độ 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
authentication

Hướng nghiên cứu

Bắt đầu tại go/core/internal/a2agateway/http.go quanh các dòng 71-74, nơi yêu cầu chưa được xác thực được trả về một 401 trần. Kiểm tra cách gateway cấu hình xác thực để challenge có thể nêu realm hoặc issuer, sau đó thêm WWW-Authenticate: Bearer vào phản hồi đó. Tái hiện bằng lệnh curl trong issue với endpoint agent-card và chạy các test của package a2agateway; hoàn tất nghĩa là 401 mang header và một test khẳng định điều đó.

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

Mô tả

📋 Prerequisites
  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software (checked against main at e8cd153)
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue
🎯 Affected Service(s)

Controller (A2A gateway)

🚦 Impact/Severity

Minor

🐛 Bug Description

The A2A HTTP endpoints (/agents/<namespace>/<name> and its agent card) answer an unauthenticated request with a bare 401 Unauthorized and no WWW-Authenticate header (http.go L71-74). A2A 1.0.1 §7.4 says the server SHOULD include challenge information so a client can learn how to authenticate. Together with the card declaring no security scheme (kagent-dev/kagent#3788), a generic client has no way to discover the required authentication.

🔄 Steps To Reproduce
  1. curl -i http://<controller>:8083/agents/<namespace>/<name>/.well-known/agent-card.json without a token.
🤔 Expected Behavior

401 with WWW-Authenticate: Bearer (plus a realm or the issuer, as configured).

📱 Actual Behavior

401 with no WWW-Authenticate header.

Ngôn ngữ chính
Go
Star
4.5k
Fork
937
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
150

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 kagent-dev/kagent

Tất cả issue của kagent-dev/kagent

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.