Skip to content

fix: serialize opaque as a credential string#388

Merged
brendanjryan merged 3 commits intowevm:mainfrom
brendanjryan:brendanryan/fix-opaque-credential-interop-main
Apr 23, 2026
Merged

fix: serialize opaque as a credential string#388
brendanjryan merged 3 commits intowevm:mainfrom
brendanjryan:brendanryan/fix-opaque-credential-interop-main

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented Apr 23, 2026

Summary

  • serialize challenge.opaque in credentials as the spec-compliant base64url string shape
  • keep deserialization backward-compatible with legacy object-shaped opaque credentials
  • add opaque HMAC golden vectors and credential regression tests, and update AGENTS.md to match paymentauth.org

This bug could result in clients like tempo-wallet rejecting opaques from mppx servers, due to missing base64 decoding

Root cause

Challenge.serialize() already encoded opaque correctly for WWW-Authenticate, but Credential.serialize() spread the in-memory challenge object directly into the credential JSON and only re-encoded request. That made mppx emit opaque as an expanded object in credentials, while the Payment auth spec requires the echoed challenge.opaque field to remain a base64url string.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/mppx@388

commit: 67e6e85

@brendanjryan brendanjryan merged commit 0d1e548 into wevm:main Apr 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant