improvement(oauth): centralize scopes and remove dead scope evaluation code#3449
improvement(oauth): centralize scopes and remove dead scope evaluation code#3449waleedlatif1 merged 2 commits intostagingfrom
Conversation
…n code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Removes legacy scope evaluation/metadata: OAuth connections/credentials API routes stop calling Written by Cursor Bugbot for commit 198a19a. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR centralizes all OAuth scopes into Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["OAUTH_PROVIDERS\n(lib/oauth/oauth.ts)\n— Single Source of Truth —"] -->|getCanonicalScopesForProvider| B["auth.ts\nBetter Auth\nOAuth providers"]
A -->|getScopesForService| C["Block definitions\n(blocks/blocks/*.ts)\nrequiredScopes"]
A -->|getScopeDescription\n/ SCOPE_DESCRIPTIONS| D["OAuthRequiredModal\n(oauth-required-modal.tsx)\nScope display UI"]
C --> E["getMissingRequiredScopes\n(lib/oauth/utils.ts)"]
E -->|Ignores IGNORED_SCOPES\noffline_access, refresh_token,\noffline.access| F["credential-selector.tsx\ntool credential-selector.tsx\nShow re-auth warning"]
B --> G["/api/auth/oauth/connections\n/api/auth/oauth/credentials\nRaw scopes only in response"]
Last reviewed commit: 8927ac3 |
…overage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
Summary
OAUTH_PROVIDERS(oauth.ts) as single source of truthgetCanonicalScopesForProvider()instead of hardcoded scope arraysgetScopesForService()forrequiredScopesSCOPE_DESCRIPTIONSevaluateScopeCoverage,normalizeScopes,ScopeEvaluation,requiresReauthorization,extraScopes)use-oauth-scope-status.tshook (movedgetMissingRequiredScopesto@/lib/oauth/utils)Type of Change
Testing
Tested manually
Checklist