fix: align mandate types with spec for HNP security#202
fix: align mandate types with spec for HNP security#202gautammanak1 wants to merge 1 commit intogoogle-agentic-commerce:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces support for 'Human Not Present' (HNP) transaction flows by updating mandate specifications and sample implementations. Key changes include adding unique identifiers and user authorization fields to IntentMandate, introducing a TransactionModality enum, and ensuring payment mandates are cryptographically bound to pre-authorized intent mandates. Feedback focuses on refining the logic for including intent hashes in signatures, improving consistency in placeholder hash generation, and correcting multiline string formatting in Pydantic models.
6a131e3 to
e3501b4
Compare
- IntentMandate: id, user_authorization, Pydantic validation for unsigned vs cart-confirmation rules - PaymentMandateContents: intent_mandate_id, TransactionModality enum, HNP validation requiring intent_mandate_id when human_not_present - Shopping agent: bind payment signing to signed intent only; intent hash uses intent_mandate.id; modality and intent_mandate_id from state - Go sample structs; specification and a2a-extension doc updates - Ruff: ignore UP017 for Python 3.10; spellcheck and cspell hygiene - CI: set LINTER_RULES_PATH and MARKDOWN_CONFIG_FILE (.markdownlint.json in .github/linters); disable MD060 for wide tables
be32686 to
a477afa
Compare
|
Hello @holtskinner @jorellis I’m Gautam Manak (@gautammanak1). This contribution aligns the AP2 reference implementation with the specification for mandate security, with a focus on Human Not Present (HNP) flows. What problem this addresses What I changed IntentMandate: Added a stable id, optional user_authorization (JWT in real deployments; a dev placeholder in samples), and Pydantic validation so an unsigned intent cannot be combined with “no per-cart confirmation” in an invalid way. Human-present flows: signing is driven by cart + payment hashes; an unsigned intent in state does not add an intent hash to the authorization string. Thank you to the Google team and AP2 maintainers for maintaining this project and for reviewing this change. Best regards, |
Description
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTINGGuide.Fixes 150🦕