Repository navigation
Scoped PAT: View token permissions - #48003
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAccessTokenList now supports viewing permissions for scoped tokens and uses selected-token state for deletion confirmation across classic and scoped tokens. The component also defaults ChangesAccess token actions
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Test Results (next)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
| retryDelay: 1000, | ||
| } | ||
| ) | ||
| console.log({ token }) |
Second stacked PR for scoped PAT extracted from the prototype #47783 to ease reviewing. Previous stacked PR is #47886 Next stacked PR is #48003 This PR: - refactor the scoped token creation form in a multi-step fashion ## How to test Go to https://studio-staging-git-scopedpat-scoped-token-creat-80c55b-supabase.vercel.app/dashboard/account/tokens - Click the _Generate new token_ button - Try submitting immediately. It should display errors correctly - Configure everything except permissions and try submitting. It should display a warning about missing permissions - Configure the permissions and submit. It should display the review step - Try going back, modify anything and submit - Create the token. It should display the token value with a button to copy it and a checkbox to confirm the copy. You cannot close the sheet at this step until you check the box and click _Done_.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/studio/components/interfaces/Account/AccessTokens/AccessTokenList.tsx (1)
90-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPreserve the token-kind/ID relationship instead of casting.
Define
MergedAccessTokenas a discriminated union and let thekindbranch narrowidbefore dispatching. The current casts suppress type checking and can hide mismatches if either token shape changes.As per coding guidelines, avoid TypeScript
ascasts and model multi-state values as discriminated unions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/studio/components/interfaces/Account/AccessTokens/AccessTokenList.tsx` around lines 90 - 92, Update MergedAccessToken to a discriminated union keyed by kind, with classic tokens carrying a numeric id and scoped tokens carrying a string id. In the tokenToDelete branch, use the kind check to narrow id naturally before calling deleteClassicToken or deleteScopedToken, and remove both TypeScript casts.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/studio/components/interfaces/Account/AccessTokens/AccessTokenList.tsx`:
- Around line 39-50: Update AccessTokenList and useMergedAccessTokens so
scoped-token request failures are propagated through the hook and rendered by
the list before keeping scopedTokensEnabled defaulted to true; otherwise restore
the default to opt-in until scoped errors are handled. Ensure failures do not
produce a partial list or “No access tokens found” state.
---
Nitpick comments:
In `@apps/studio/components/interfaces/Account/AccessTokens/AccessTokenList.tsx`:
- Around line 90-92: Update MergedAccessToken to a discriminated union keyed by
kind, with classic tokens carrying a numeric id and scoped tokens carrying a
string id. In the tokenToDelete branch, use the kind check to narrow id
naturally before calling deleteClassicToken or deleteScopedToken, and remove
both TypeScript casts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: dbdee218-e023-41fb-974c-af4cbc2e6a31
📒 Files selected for processing (1)
apps/studio/components/interfaces/Account/AccessTokens/AccessTokenList.tsx
Fourth stacked PR for scoped PAT extracted from the prototype #47783 to ease reviewing. Previous stacked PR is #48003 Next stacked PR is #48002 This PR: - fix some accessibility issues - add unit tests <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added coverage for creating scoped access tokens at the project, organization, and account levels. * Verified validation for required fields, successful token creation, clipboard copying, and completion flow. * **Chores** * Added temporary browser console logging when viewing a scoped access token. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Third stacked PR for scoped PAT extracted from the prototype #47783 to ease reviewing.
Previous stacked PR is #47979
Next stacked PR is #47999
This PR add a way to view the tokens permissions
Summary by CodeRabbit
New Features
Bug Fixes