Commit e54cc3d
fix(auth): drift-guard _A2A_DISCOVERY_PATHS against a2a-sdk route renames
Reviewer flagged that the hardcoded /.well-known/agent-card.json
literal could silently leak auth on a renamed route if a2a-sdk's
canonical path moves. Two changes:
1. Reference a2a.utils.constants.AGENT_CARD_WELL_KNOWN_PATH directly
so the 1.0 path tracks a2a-sdk automatically. Legacy 0.3 alias
/.well-known/agent.json stays as a literal (no constant for it).
2. New test_discovery_paths_match_a2a_sdk_routes inspects every path
that create_agent_card_routes registers and asserts each is in
_A2A_DISCOVERY_PATHS. If a future a2a-sdk version adds a new
well-known route (extensions, capability descriptor, etc.), this
test fails first — adopters update the frozenset rather than
silently 401'ing on the renamed/added route.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cd297b6 commit e54cc3d
2 files changed
Lines changed: 70 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
562 | 573 | | |
563 | 574 | | |
564 | | - | |
| 575 | + | |
565 | 576 | | |
566 | 577 | | |
567 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
488 | 546 | | |
489 | 547 | | |
490 | 548 | | |
| |||
0 commit comments