Repository navigation
Commit 5751d31
authored
fix(server): send PushNotificationConfig.authentication as an Authorization header (a2aproject#1271)
## What
Spec
[4.3.3](https://a2a-protocol.org/latest/specification/#433-push-notification-payload)
gives the webhook request an `Authorization: {authentication_scheme}
{credentials}` header, built from
`PushNotificationConfig.authentication`.
`BasePushNotificationSender` never read that field - the only header it
has ever sent is `X-A2A-Notification-Token`, from the sibling `token`. A
receiver therefore had no credential to check and no way to tell a
genuine push from a forged one, which is the whole point of registering
`authentication` in the first place.
Nothing suggests this was left to the application. The constructor
docstring explicitly justifies delegating URL screening, on the grounds
that the spec makes it a SHOULD, and says nothing about auth, which the
spec makes a MUST. The code already reads the field next to it. This
reads as an omission.
## Only when both halves are present
`AuthenticationInfo` is a message, so a config can set `scheme` without
`credentials`. Sending on that would put `Bearer ` with nothing after it
on the wire - a header that looks like a credential and is not. Both
must be non-empty.
Note the singular `scheme`. Only the v0.3 compat type has repeated
`schemes`, and `conversions.py:252-261` collapses it to `schemes[0]` on
the way in, so the sender only ever deals with one.
## Heads-up on the ACTS side
`SEC-PUSH-001`, `SEC-PUSH-002` and `PUSH-DELIV-001` currently pass in
nightly CI for every SDK, so this may look like a fix to something that
was not broken. It is not: the assertion that inspects the delivered
request is new, added in
[a2aproject/A2A@82c277f](a2aproject/A2A@82c277f).
The corpus CI runs predates it, and the older tests only checked that
the config API accepted the config - which, as that commit's own note
puts it, "a server that stores it and pushes anonymously, or never
pushes, satisfies".
A consequence worth stating: no other SDK has been measured against the
real assertion yet, so unlike the rest of this stack there is no
cross-SDK corroboration here. The code is the evidence -
`push_info.authentication` appears nowhere under `src/a2a/server/`
before this change.
## Result
Clears `SEC-PUSH-001`, `SEC-PUSH-002` (`must`) and `PUSH-DELIV-001`
(`may`) on all three bindings, and with them the **last failing MUST**:
| binding | must | verdict |
| --- | --- | --- |
| jsonrpc | 59/59 | CONFORMANT |
| grpc | 47/47 | CONFORMANT |
| rest | 49/49 | CONFORMANT |
The three PRs after this one are SHOULD-level and change the verdict for
nobody; they take the remaining non-MUST failures to zero.
Closes a2aproject#5851 parent c25022f commit 5751d31
2 files changed
Lines changed: 105 additions & 9 deletions
File tree
- src/a2a/server/tasks
- tests/server/tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
76 | | - | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
106 | 188 | | |
107 | 189 | | |
108 | 190 | | |
| |||
140 | 222 | | |
141 | 223 | | |
142 | 224 | | |
143 | | - | |
| 225 | + | |
144 | 226 | | |
145 | 227 | | |
146 | 228 | | |
| |||
173 | 255 | | |
174 | 256 | | |
175 | 257 | | |
176 | | - | |
| 258 | + | |
177 | 259 | | |
178 | 260 | | |
179 | 261 | | |
180 | 262 | | |
181 | 263 | | |
182 | | - | |
| 264 | + | |
183 | 265 | | |
184 | 266 | | |
185 | 267 | | |
| |||
204 | 286 | | |
205 | 287 | | |
206 | 288 | | |
207 | | - | |
| 289 | + | |
208 | 290 | | |
209 | 291 | | |
210 | 292 | | |
| |||
228 | 310 | | |
229 | 311 | | |
230 | 312 | | |
231 | | - | |
| 313 | + | |
232 | 314 | | |
233 | 315 | | |
234 | 316 | | |
| |||
0 commit comments