Repository navigation
feat: verify signed peer AgentCards (WP13) - #123
Merged
Merged
Conversation
Verify a peer's well-known agent card JWS against an optional card_public_key before the first a2a_call. Successful verification is cached per peer for the process; failures are retried on the next call. Redirects to a different host are rejected. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
|
Caution Review failedThe pull request is closed. |
The well-known card file is an AgentCard carrying a signatures array of detached JWS entries, not a JWS envelope. Verify any one signature over the RFC 8785 canonical form of the card with signatures removed, bind ES256/RS256 to the configured key type, and classify format, signature, and fetch failures separately. Concurrent first calls for one peer now share a single card fetch. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
A signer may strip default-valued properties before signing while a struct-based server re-emits them. Verify against several canonical candidates: as served, empty collections removed, all defaults removed, and empty required properties removed. Require typ=JOSE and a non-empty kid in the protected header, detach the shared first-call fetch from the leader's cancellation, and document the wire format and normalization. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
card_public_key(PEM path). Before the firsta2a_call, fetch<peer origin>/.well-known/agent-card.jsonand verify its JWS.SignedCardHandlerserves verbatim. ES256 (P-256) and RS256 only;none/HS*are refused.peer <name>: agent card signature invalid.Files
internal/a2acall/cardverify.go(+ tests)internal/a2acall/a2acall.gointernal/cmd/agentconfig.go(+ tests)internal/cmd/runtime.go— one line to pass the parsed key; outside WP13's file list but required to wire config to the tool.Test plan
TestVerifyCardtable: valid, tampered, wrong key, unsigned, nil key.LoadCardPublicKeyand config-level relative path resolution.make fmt lint testandgo test ./...green.🤖 Generated with Claude Code