feat: A2A-Version header validation and negotiation#18
Open
zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
Open
feat: A2A-Version header validation and negotiation#18zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
Conversation
Server side (lib/a2a/plug.ex): - Read A2A-Version request header - If present and not in supported versions list, return VersionNotSupportedError (-32009) - If absent, accept (per spec, absent header is OK) - Add :supported_versions option to Plug init (default ["1.0", "1.0.0"]) - Set A2A-Version response header on all JSON-RPC responses Client side (lib/a2a/client.ex): - Send A2A-Version: 1.0 header with every request Error module (lib/a2a/jsonrpc/error.ex): - Add version_not_supported/1 constructor for -32009 error Tests: 10 new tests covering version validation, unsupported version error, absent header acceptance, response header, custom supported_versions, and client header verification. 397 tests, 0 failures.
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.
Part of #13 (A2A v1.0 Protocol Support)
What This PR Does
Adds A2A-Version header support for version negotiation per the A2A protocol spec.
Server side (
lib/a2a/plug.ex)A2A-Versionrequest header on POST (JSON-RPC) requestsVersionNotSupportedError(-32009):supported_versionsoption to Plug init (default["1.0", "1.0.0"])A2A-Versionresponse header on all JSON-RPC responsesClient side (
lib/a2a/client.ex)A2A-Version: 1.0header with every requestError module (
lib/a2a/jsonrpc/error.ex)version_not_supported/1constructor for error code -32009Tests (10 new)
:supported_versionsoption works correctly397 tests, 0 failures ✅
Fixes part of #13