Skip to content

fix(auth): let developers choose Resend OAuth2 scope - #13568

Merged
Meldiron merged 1 commit into
mainfrom
fix-resend-oauth2-scopes
Sep 9, 2026
Merged

Meldiron merged 1 commit into
mainfrom
fix-resend-oauth2-scopes

Conversation

@Meldiron

@Meldiron Meldiron commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the hardcoded emails:send default scope from the Resend OAuth2 adapter. Resend offers only emails:send and full_access, and neither is identity-only, so the adapter should not pick one on the developer's behalf. Developers now request whichever scope they need through the provider's custom scopes; with none configured, the login URL sends an empty scope, matching other adapters with no default scopes.

Follow-up to #13366.

Test Plan

  • composer lint src/Appwrite/Auth/OAuth2/Resend.php passes
  • Custom scopes still append through the OAuth2 base constructor, so configuring emails:send or full_access on the provider produces the same login URL as before

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

🤖 Generated with Claude Code

Drop the hardcoded emails:send default from the Resend adapter so the
requested scope comes from the project's custom scopes instead.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@Meldiron Meldiron left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

lgtm

@greptile-apps

greptile-apps Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

The change appears safe to merge, with a non-blocking gap in regression coverage for the authorization URL behavior being fixed.

Fix All in Claude CodeFindings

  1. P2 Scope Behavior Lacks Coverage ▶

Summary

  • Resend now starts with no default scopes.
  • Existing base-class scope handling continues to append and deduplicate developer-supplied scopes.
  • The changed authorization-URL behavior lacks focused regression coverage.

Comment thread src/Appwrite/Auth/OAuth2/Resend.php Resolved
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix-resend-oauth2-scopes (after).

Metric Before After Change
🚀 Requests/sec 447.89 432.34 ⚪ -3.5%
⏱️ Latency P50 38.45 ms 40.01 ms ⚪ +4.1%
⏱️ Latency P95 91.18 ms 94.65 ms ⚪ +3.8%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 40.01 94.65 26,391 432.34 +3.47
Account 77.43 136.42 1,389 23.1 +0.72
TablesDB 38.21 72.3 14,353 237.04 +4.86
Storage 37.24 87.05 6,945 116.51 +3.18
Functions 61.23 112.3 3,704 62.79 +3.16

Top API waits (after)

API request Max wait (ms)
functions.variables.update 207.11
account.name.update 201.8
storage.files.delete 187.66
storage.files.create 185.55
storage.buckets.create 179.94

@Meldiron
Meldiron merged commit 79c9641 into main Sep 9, 2026
48 checks passed
@ChiragAgg5k ChiragAgg5k mentioned this pull request Sep 10, 2026
2 of 4 tasks
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