-
Notifications
You must be signed in to change notification settings - Fork 301
feat: Implement Agent Card Signing and Verification per Spec #581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @sokoliva, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements digital signature capabilities for Agent Cards, aligning with the A2A specification to enhance the authenticity and integrity of card data. It introduces core utilities for signing and verification, integrates these checks into existing client transports, and ensures proper serialization for gRPC communication, all backed by new test coverage. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces AgentCard signature verification functionality across various client transports (JSON-RPC, REST, gRPC). Key changes include adding python-jose as a dependency, implementing create_agent_card_signer and create_signature_verifier utilities, and extending get_card methods in BaseClient and transport classes to accept an optional signature_verifier callable. The proto_utils module was updated to handle AgentCardSignature conversion to and from protobuf. New integration and unit tests were added to validate symmetric and asymmetric signing and verification processes, as well as JSON Canonicalization Scheme (JCS) for AgentCards. Review comments highlight the need to add an algorithms parameter to create_signature_verifier for security against algorithm confusion attacks, update its docstring, correct a docstring in base_client.py regarding the signature_verifier parameter, and fix a type inconsistency in a test fixture where signatures was assigned a tuple instead of a list.
…ility of clean_empty by declaring types, add a multiple signatures test to test_signing.py
…a-python into agent-card-signature
…xpected algorithms are used for signature validation.
…n to security measures.
This PR introduces digital signatures for Agent Cards to ensure authenticity and integrity, adhering to the A2A specification for Agent Card Signing (Section 8.4).
Changes:
CanonicalizationLogic (src/a2a/utils/signing.py)SigningandVerificationUtilities (src/a2a/utils/signing.py):create_agent_card_signerwhich generates anagent_card_signerfor signingAgentCardscreate_signature_verifierwhich generates asignature_verifierfor verification ofAgentCardsignaturesjson-rpc,restandgRPCtransportssrc/a2a/utils/proto_utils.py) ensuringAgentCardSignaturecan be serialized and deserialized for gRPC transportRelease-As: 0.3.21
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)