fix: Challenge selection ignores the offered intent - #212
fix: Challenge selection ignores the offered intent#212mpp-agricola[bot] wants to merge 3 commits into
Conversation
|
/ag fix can you add more test coverage |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22ce652262
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for challenge in challenges: | ||
| method = self._methods.get(challenge.method) | ||
| if method is not None: | ||
| if method is not None and challenge.intent in method.intents: |
There was a problem hiding this comment.
Preserve charge matching for client-only Stripe methods
When Stripe is configured exactly as the bundled client documentation shows (stripe(create_token=..., payment_method=..., intents={}) in src/mpp/methods/stripe/__init__.py), this condition rejects every charge challenge because method.intents is empty. PaymentTransport consequently returns the original 402 without invoking create_token, breaking the documented Stripe client flow; client-side charge capability needs a default or separate capability source rather than requiring a nonempty server-verifier registry.
Useful? React with 👍 / 👎.
| method = self._methods.get(challenge.method) | ||
| if method is not None: | ||
| if method is not None and challenge.intent in method.intents: |
There was a problem hiding this comment.
Search every same-name method for a compatible intent
When two installed methods share a name but advertise disjoint intents, _methods has already discarded every instance except the last one, so a challenge supported by an earlier instance is incorrectly rejected. For example, PaymentRuntime([tempo_charge, tempo_session]) cannot match a charge challenge even though tempo_charge is installed; selection should preserve the existing last-method preference among compatible instances rather than consulting only the single collapsed entry.
Useful? React with 👍 / 👎.
Agricola-Request: revise:audit:AGR-2026-022:python:22ce65226239 Agricola-Summary: Expanded challenge negotiation coverage across runtime and HTTP transport paths; verification blocked by unavailable PyPI DNS.
|
Agricola updated this pull request from the latest review feedback and failing CI. Summary of changes
Changed filesRequested from tempoxyz/mpp-tools#97. |
Motivation
Agricola noticed a discrepancy between
tempoxyz/pymppand the canonical implementation: challenge selection ignores the offered intent.The Agricola ticket #97 contains the audit evidence, affected SDKs, and remediation lifecycle.
Summary
semantic:challenge-negotiation/select-supported-method-intentin the target SDK's idioms.Key design considerations
agricola/agr-2026-022automation branch.