Skip to content

feat: add payment-methods.detokenization.read JWT scope - #368

Merged
cbetta merged 1 commit into
mainfrom
feat/detokenization-scope
Dec 2, 2026
Merged

cbetta merged 1 commit into
mainfrom
feat/detokenization-scope

Conversation

@cbetta

@cbetta cbetta commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

JWTScope gains payment-methods.detokenization.read, so merchants can mint a token that can only detokenize. For FEAT-1163.

Spec

  • Hand-written token helper exposes the scope that guards POST /payment-methods/{payment_method_id}/detokenization
  • Name and order follow the buyers.billing-details.read precedent
    Out of scope: a .write counterpart (core-api has none). *.read still covers the endpoint.

Change

PAYMENT_METHODS_DETOKENIZATION_READ = "payment-methods.detokenization.read"

Reviewer checks

Check This PR
Auth / permissions Yes: src/gr4vy/auth.py adds a JWT scope value
Data access widened No
New secret, env var or key No
CI, deploy or infra No
Dependencies added or bumped No
Copilot No comments, approval recommended
Security review Clear to merge, no findings

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cbetta
cbetta marked this pull request as ready for review December 2, 2026 14:46
Copilot AI lite review requested due to automatic review settings December 2, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped to adding the dedicated payment-method detokenization JWT scope, with no active review issues identified.

No open issues 🎉

What changed in this PR

Adds a dedicated JWT scope for payment-method detokenization, enabling narrowly scoped tokens for that endpoint.

Changes:

  • Added JWTScope.PAYMENT_METHODS_DETOKENIZATION_READ alongside related payment-method scopes.
File Description
src/​gr4vy/​auth.py Adds the payment-methods.detokenization.read JWT scope to the JWTScope enum.

Review effort: Lite

@cbetta
cbetta enabled auto-merge (squash) December 2, 2026 14:56
@cbetta
cbetta merged commit 7912f78 into main Dec 2, 2026
11 checks passed
@cbetta
cbetta deleted the feat/detokenization-scope branch December 2, 2026 15:08
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.

2 participants