Skip to content

scoped PAT: merge classic and scoped token lists - #47886

Merged
djhi merged 4 commits into
scopedpat/root-branchfrom
scopedpat/merge-token-lists
Jul 28, 2026
Merged

djhi merged 4 commits into
scopedpat/root-branchfrom
scopedpat/merge-token-lists

Conversation

@djhi

@djhi djhi commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

First stacked PR for scoped PAT extracted from the prototype #47783 to ease reviewing.
Next stacked PR is #47979

This PR:

  • merge the two existing token lists (classic and scoped) into one
  • add an admonition about the scoped PAT migration (missing the docs URL)

Notes

It's not possible to create classic tokens anymore with the scopedPAT flag enabled.

How to test

With the scopedPAT enabled (default on staging)

Go to https://studio-staging-git-scopedpat-merge-token-lists-supabase.vercel.app/dashboard/account/tokens.

  • You shouldn't see two tabs anymore
  • If you had classic tokens, they should have the classic badge
  • You can create scoped tokens
  • You have a way to copy newly created tokens above the list upon form submission

With the scopedPAT disabled (use the devtool to override)

  • You shouldn't see two tabs anymore
  • If you had classic tokens, they should not have the classic badge
  • You can create classic tokens
  • You have a way to copy newly created tokens above the list upon form submission

Screenshots

Before:
image

After:
image

@djhi
djhi requested a review from a team as a code owner July 13, 2026 14:00
@vercel

vercel Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Jul 28, 2026 8:24am
studio-staging Ready Ready Preview, Comment Jul 28, 2026 8:24am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 28, 2026 8:24am
design-system Skipped Skipped Jul 28, 2026 8:24am
docs Skipped Skipped Jul 28, 2026 8:24am
ui-library Skipped Skipped Jul 28, 2026 8:24am
zone-www-dot-com Skipped Skipped Jul 28, 2026 8:24am

Request Review

@supabase

supabase Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c8005b70-4f2e-4375-842a-b15609ccc4f1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scopedpat/merge-token-lists

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  237 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  243 tests across 28 suites
duration  5 minutes, 23 seconds
commit  7766aa9

Flaky tests

Features › table-editor.spec.ts › table editor › can create and remove foreign key with column selection

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@djhi
djhi marked this pull request as draft July 13, 2026 15:10
@djhi
djhi marked this pull request as ready for review July 15, 2026 19:29

@charislam charislam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor nits but otherwise looks great! Really clean PR ❤️

* the consuming list (via filterAndSortTokens), so this only merges + tags.
*/
export const useMergedAccessTokens = ({
scopedEnabled = true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit but defaulting this to true will cause unnecessary API calls that are bound to fail, won't it?

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.

This one I fixed in the latest PR already but will do it here as well


const { mutate: deleteScopedToken } = useScopedAccessTokenDeleteMutation({
onSuccess: (_, vars) => {
track('access_token_removed', { tokenType: 'classic' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be tokenType: 'scoped'?

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.

good catch

@djhi
djhi merged commit ab22a6f into scopedpat/root-branch Jul 28, 2026
27 checks passed
@djhi
djhi deleted the scopedpat/merge-token-lists branch July 28, 2026 09:20
djhi added a commit that referenced this pull request Jul 28, 2026
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_.
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.

2 participants