a2aproject / a2aproject/a2a-python

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

未關閉
#585 10 則留言 0 個 reaction 已指派 1 人 已指派給 @sokoliva 在 GitHub 檢視
主要語言
Python
星號
2.1k
分支
496
平均合併
4 天 17 小時
30 天內合併 PR
12

描述

### 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:

```json
"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:
```

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 `

### Describe alternatives you've considered

As a workaround, we currently:

* **Subclass `BasePushNotificationSender`**
* Override `_dispatch_notification`
* Inject our own `Authorization: Bearer ` 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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。