Skip to content

feat: implement mock AP2 signature verification#10

Closed
0x8000-0000 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
0x8000-0000:task-ucp-4
Closed

feat: implement mock AP2 signature verification#10
0x8000-0000 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
0x8000-0000:task-ucp-4

Conversation

@0x8000-0000

Copy link
Copy Markdown
Contributor

Description

Why:
- To verify that the server correctly rejects invalid AP2 mandates with the appropriate error code.
- Required for conformance testing of the AP2 security flow.

What:
- Added 'Ap2VerificationError' to exceptions.
- Implemented '_verify_ap2_mandate' in 'CheckoutService' to reject mandates containing the substring 'invalid_signature'.
- Updated 'complete_checkout' to invoke this verification.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules; this change depends on feat: implement mock AP2 signature verification samples#26

@0x8000-0000
0x8000-0000 requested a review from a team January 17, 2026 00:14
Why:
- To verify that the server correctly validates AP2 mandates during checkout completion.
- Ensures that invalid signatures result in a 400 Bad Request with the specific error code 'mandate_invalid_signature'.

What:
- Added 'test_ap2_mandate_invalid_signature' to 'Ap2MandateTest'.
- Submits a completion request with a mandate string containing 'invalid_signature'.
- Asserts that the response status is 400 and the error code matches the spec.
@nearlyforget
nearlyforget requested a review from a team February 28, 2026 01:46
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:stale Applied when PR is waiting for author response for 30 days labels Jul 7, 2026
@damaz91 damaz91 removed the status:needs-triage Signal that the PR is ready for human triage label Jul 20, 2026
@damaz91 damaz91 closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:stale Applied when PR is waiting for author response for 30 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants