[Feat]: PushNotificationConfig.authentication is ignored; no Authorization header is sent in push notifications

未关闭
#585 10 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
python

调研方向

查看 BasePushNotificationSender 类,以了解推送通知是如何分发的。问题在于 PushNotificationConfig 中的身份验证字段被忽略了。检查配置解析和 _dispatch_notification 方法。修复方案是读取身份验证方案,并在现有的 X-A2A-Notification-Token 旁添加适当的 Authorization 标头(例如 Bearer)。检查与推送通知相关的现有测试,以了解预期行为,并为新的身份验证标头添加测试。

由索引模型根据 Issue 内容生成。

描述

Is your feature request related to a problem? Please describe.

The A2A protocol spec states that when a client provides a PushNotificationConfig with an authentication scheme (e.g. "schemes": ["Bearer"]), the A2A server must authenticate when sending push notifications to the client’s webhook.
Example config:

"configuration": {
  "pushNotificationConfig": {
    "url": "CALLBACK-URL",
    "token": "secure-client-token-for-task-aaa",
    "authentication": {
      "schemes": ["Bearer"]
    }
  }
}

However, the Python implementation (BasePushNotificationSender) completely ignores authentication and sends no Authorization header.
It only attaches:

X-A2A-Notification-Token: <token>

This means that webhook endpoints cannot authenticate the caller and cannot follow the security model described in the spec.

This appears to be a spec compliance gap: push notification authentication is described by the protocol but not implemented in the Python server.

Describe the solution you'd like

I would like the Python server to:

  • Honor PushNotificationConfig.authentication

  • Support at least the "Bearer" scheme

  • Automatically add the appropriate Authorization header

  • Match the spec examples by sending both:

    • X-A2A-Notification-Token
    • Authorization: Bearer <token_or_jwt>
Describe alternatives you've considered

As a workaround, we currently:

  • Subclass BasePushNotificationSender
  • Override _dispatch_notification
  • Inject our own Authorization: Bearer <jwt> header

This works, but:

  • It duplicates logic that should be part of the framework
  • It breaks consistency between Python and other A2A implementations
  • It makes spec-compliant webhook security non-standard and harder to maintain

A built-in implementation would make push notification authentication reliable, consistent, and aligned with the A2A spec.

主要语言
Python
星标
2.2k
派生
496
平均合并
1 天 23 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

a2aproject/a2a-python 的其他 Issue

查看 a2aproject/a2a-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。