feat: OAuth client scopes#27707
feat: OAuth client scopes#27707supalarry wants to merge 41 commits intolauris/cal-7035-fix-invalidate-old-refresh-tokensfrom
Conversation
|
Paragon Review Unavailable Hi @supalarry! To enable Paragon reviews on this repository, please register at https://home.polarity.cc Once registered, connect your GitHub account and Paragon will automatically review your pull requests. |
There was a problem hiding this comment.
1 issue found across 28 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/trpc/server/routers/viewer/oAuth/updateClient.handler.ts">
<violation number="1" location="packages/trpc/server/routers/viewer/oAuth/updateClient.handler.ts:68">
P1: Security: Scope changes by owners should trigger reapproval. The `scopes` field is added to `hasAnyFieldsChanged()` but NOT to `triggersReapprovalForOwnerEdit()`. This allows OAuth client owners to escalate their client's permissions without admin oversight. Similar to how `redirectUri` changes require reapproval, scope modifications should also set status to PENDING.
The `triggersReapprovalForOwnerEdit()` call below (lines 79-93) needs to include `scopes` in both `currentClient` and `proposedUpdates` to maintain the approval workflow for permission changes.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/api/v2/src/modules/auth/guards/permissions/permissions.guard.spec.ts">
<violation number="1" location="apps/api/v2/src/modules/auth/guards/permissions/permissions.guard.spec.ts:152">
P3: Fix typo in test description: "compatability" → "compatibility" for clearer test naming.</violation>
<violation number="2" location="apps/api/v2/src/modules/auth/guards/permissions/permissions.guard.spec.ts:163">
P3: Fix typo in test description: "compatability" → "compatibility" for clearer test naming.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
apps/api/v2/src/modules/auth/guards/permissions/permissions.guard.spec.ts
Outdated
Show resolved
Hide resolved
apps/api/v2/src/modules/auth/guards/permissions/permissions.guard.spec.ts
Outdated
Show resolved
Hide resolved
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
…ions Co-Authored-By: unknown <>
… lauris/cal-7030-feat-oauth-client-scopes
… lauris/cal-7030-feat-oauth-client-scopes
… lauris/cal-7030-feat-oauth-client-scopes
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/web/modules/settings/oauth/view/OAuthClientDetailsDialog.tsx">
<violation number="1" location="apps/web/modules/settings/oauth/view/OAuthClientDetailsDialog.tsx:285">
P2: Legacy clients with empty scopes can no longer be updated because scope selection is hidden while the submit handler requires at least one scope. Allow scope selection when editing legacy clients (or bypass the required-scope check) so updates aren’t permanently blocked.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. ✅ No changes pushed |
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/web/playwright/oauth/oauth-authorize-approval-status.e2e.ts">
<violation number="1" location="apps/web/playwright/oauth/oauth-authorize-approval-status.e2e.ts:457">
P3: Unknown-scope errors map to the OAuth "invalid_scope" error, so this expectation will fail (or mask a regression). Update the assertion to expect invalid_scope.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
apps/web/playwright/oauth/oauth-authorize-approval-status.e2e.ts
Outdated
Show resolved
Hide resolved
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
… lauris/cal-7030-feat-oauth-client-scopes
Fixes #26475
Summary by cubic
Adds OAuth client scopes across API, UI, and docs with strict scope-based endpoint access. Token and refresh responses now include a space-delimited scope; the authorize page validates state and requested scopes against the client’s registered scopes.
New Features
Migration
Written for commit aaa4ac9. Summary will update on new commits.