Repository navigation
fix(oauth): authenticate Stripe token requests with the secret key - #15416
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review complete. 🟡 1 medium 📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to🟡 Medium — Stripe token exchange sends secret as Bearer, not // src/Appwrite/Auth/OAuth2/Stripe.php
72 ['Authorization: Bearer ' . $this->appSecret],
73 \http_build_query([
74 'grant_type' => $this->grantType['authorize'],
75 'code' => $code
76 ])The token and refresh calls authenticate the This change modifies the Stripe OAuth2 provider's token exchange and refresh flows to send an
Note: token exchange on the Connect token endpoint is the one Stripe flow that requires Reviewed commit: f94538a |
🔵 Tier A · Mergeable after minor fixes
Stripe OAuth authorization-code exchanges and refresh-token requests now include the configured app secret as a Bearer Authorization header. The existing form-encoded grant payloads remain unchanged.
Fix with agent prompt### Issue 1
src/Appwrite/Auth/OAuth2/Stripe.php:72
**Add a Stripe token-request regression test**
Could we add a Stripe adapter test that verifies the Authorization header on both exchange and refresh requests? Existing OAuth2 adapter tests cover request contracts, but without this assertion the missing-credentials regression can return unnoticed.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 1
Reviewed |
| 'POST', | ||
| 'https://connect.stripe.com/oauth/token', | ||
| [], | ||
| ['Authorization: Bearer ' . $this->appSecret], |
There was a problem hiding this comment.
Add a Stripe token-request regression test
Could we add a Stripe adapter test that verifies the Authorization header on both exchange and refresh requests? Existing OAuth2 adapter tests cover request contracts, but without this assertion the missing-credentials regression can return unnoticed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Appwrite/Auth/OAuth2/Stripe.php
Line: 72
Comment:
**Add a Stripe token-request regression test**
Could we add a Stripe adapter test that verifies the Authorization header on both exchange and refresh requests? Existing OAuth2 adapter tests cover request contracts, but without this assertion the missing-credentials regression can return unnoticed.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · testing · Reply if this doesn't apply.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
Stripe, Autodesk and Box sign-in, and the Pinecone, LangChain RAG, Replicate and Redis Cloud templates were held back from the catalog because they didn't work as released. Their fixes are merged (#15414, #15416, #15417, #15421 and appwrite/templates#498), so add their pages: - Autodesk is new. The others come from the held-back drafts, without the workarounds for the template variable names and the hardcoded Redis port. - The template pages say what Any execute access exposes and how to narrow it, like the other template pages. - The pages list Cloud only, because no self-hosted release includes the fixes yet. Each page gets a cover in the catalog style. Etsy sign-in and the GitHub issue bot template still don't work, so they stay out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes #15368.
Token exchange and refresh to
connect.stripe.com/oauth/tokensent no credentials, so Stripe rejected them. Both now send the stored secret key asAuthorization: Bearer, per https://docs.stripe.com/connect/oauth-reference.