Repository navigation
Commit 77fabf3
fix(media): align evidence_rejected status to NIP-FI spec table (401→403)
The NIP-FI rejection table (§Public denial classes and transport codes)
maps `evidence_rejected` — malformed, invalid, OR expired evidence — to
HTTP 403. The previous code mapped signature failures, expired tokens,
missing tags, hash/server mismatches, etc. to 401, matching a now-removed
oracle-enumeration rationale that the spec does not make.
Changes:
- Merge the two `IntoResponse` denial branches into one 403 arm covering
all structurally present but invalid/malformed/expired proofs. Only
absent-header (`MissingAuth`) remains 401.
- Update the body string from "authentication failed" / "authorization
denied" to the spec's fixed string "evidence rejected" / "authentication
required" for the respective classes.
- Fix the misleading IntoResponse comment and the now-stale test section
header.
- Update the `evidence_rejected_errors_permissive_shape_is_json_401` unit
test → `evidence_rejected_errors_return_json_403`; add `InvalidAuthKind`,
`InvalidAuthVerb`, `InvalidAuthEvent` to coverage.
- Fix all five `test_auth_*` assertions in e2e_media_extended.rs: wrong
kind, missing t tag, missing expiration, expired token, empty content all
expect 403 (not 401).
Co-authored-by: Will Pfleger <[email protected]>
Signed-off-by: Will Pfleger <[email protected]>1 parent fbd3c93 commit 77fabf3
2 files changed
Lines changed: 32 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
187 | | - | |
| 186 | + | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
194 | 193 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 194 | + | |
| 195 | + | |
200 | 196 | | |
201 | 197 | | |
202 | 198 | | |
| |||
205 | 201 | | |
206 | 202 | | |
207 | 203 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 204 | + | |
| 205 | + | |
213 | 206 | | |
214 | 207 | | |
215 | 208 | | |
| |||
295 | 288 | | |
296 | 289 | | |
297 | 290 | | |
298 | | - | |
299 | | - | |
300 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
301 | 294 | | |
302 | 295 | | |
303 | 296 | | |
| |||
321 | 314 | | |
322 | 315 | | |
323 | 316 | | |
324 | | - | |
325 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
326 | 320 | | |
327 | 321 | | |
328 | 322 | | |
329 | 323 | | |
330 | 324 | | |
331 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
332 | 329 | | |
333 | 330 | | |
334 | 331 | | |
335 | 332 | | |
336 | 333 | | |
337 | | - | |
338 | | - | |
| 334 | + | |
| 335 | + | |
339 | 336 | | |
340 | 337 | | |
341 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
| 281 | + | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
| 303 | + | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | | - | |
| 324 | + | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
348 | | - | |
| 347 | + | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
0 commit comments