Repository navigation
fix(client): cache the extended Agent Card only after signature verification - #711
Merged
bartek-gralewicz merged 2 commits intoSep 16, 2026
Conversation
…ication getAgentCard replaced the client's cached card with the fetched extended card before running the supplied signature verifier. When verification failed the call threw, but the rejected card stayed active, so later capability checks (pushNotifications, extendedAgentCard, streaming) were driven by content the caller had refused to trust. Fetch into a local, verify, and only then commit it to the cache, so a rejected card leaves the previously trusted card in place and the next call fetches again. Fixes a2aproject#705
🧪 Code Coverage
Generated by coverage-comment.yml |
bartek-gralewicz
approved these changes
Sep 16, 2026
bartek-gralewicz
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for contributing to the SDK!
bartek-gralewicz
added a commit
that referenced
this pull request
Sep 18, 2026
🤖 I have created a release *beep* *boop* --- ## [1.2.0](v1.1.0...v1.2.0) (2026-09-18) ### Features * **server:** Introduce SettleByTaskId method ([#692](#692)) ([e856bda](e856bda)) ### Bug Fixes * accept GetExtendedAgentCard JSON-RPC calls with omitted params ([#687](#687)) ([047d970](047d970)) * avoid mutating caller message configuration ([#725](#725)) ([e3a6428](e3a6428)) * **client:** cache the extended Agent Card only after signature verification ([#711](#711)) ([55b601c](55b601c)) * guard terminal state transitions and make cancelTask atomic ([#636](#636)) ([7b87c94](7b87c94)) * preserve call context for JSON-RPC tenant requests ([#708](#708)) ([ae20aca](ae20aca)) * preserve HeadersInit in authenticating fetch ([#721](#721)) ([f8c33fa](f8c33fa)) * preserve historyLength=0 and reject invalid REST listTasks pageSize ([#685](#685)) ([32c1865](32c1865)) * reject empty task IDs with RequestMalformedError in getTask/cancelTask ([#629](#629)) ([71aae97](71aae97)) * reject invalid ListTasks status filters with RequestMalformedError ([#631](#631)) ([a881fae](a881fae)) * reject missing required extensions before mutating task history ([#690](#690)) ([3b4ef3f](3b4ef3f)) * reject whitespace-only taskId on sendMessage ([#689](#689)) ([85227a0](85227a0)) * return 404/-32001 for missing push notification configs ([#630](#630)) ([34f06e3](34f06e3)) * scope ExecutionEventBusManager by tenant and owner to match TaskStore ([#707](#707)) ([69d8899](69d8899)) * stamp the resolved taskId onto sendMessage push configs ([#688](#688)) ([cfb19a8](cfb19a8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Bartek Gralewicz <[email protected]>
3 of 4 tasks
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.
Description
Client.getAgentCardreplaced the cached Agent Card with the fetched extended card before running the supplied signature verifier. When verification failed the call threw, but the rejected card stayed active inside the client, so later capability checks (pushNotifications,extendedAgentCard,streaming) were driven by content the caller had refused to trust, and a latergetAgentCard()served it without fetching or verifying again.This fetches into a local, runs the verifier, and only then commits the card to the cache. On verification failure the previously trusted card remains active and the next call fetches again, per A2A §8.4.3 / §13.3.
CONTRIBUTINGGuide.npx vitest run test/client/multitransport-client.spec.ts: 50 passing;eslint/prettierclean on the changed files. The new test (should keep the current agent card when signature verification of the extended card fails) fails againstmainwithout the fix.Fixes #705 🦕