Commit Graph
116 Commits
Author SHA1 Message Date
Danny White 9052601faf fix(studio): validate direct database access permissions (#54506)
## Problem

Direct database access requires Database management read access, but
OAuth app settings currently allow saving an invalid combination. The
consent screen’s readiness checks then fail.

## Solution

Show an inline error when direct database access lacks Database
management read access, and prevent saving through the button, keyboard
shortcut, or form submission. Both controls stay editable, and neither
changes the other automatically.

| After |
| --- |
| <img width="1280" height="1103" alt="OAuth Apps Organization Settings
Office Supabase (1)"
src="https://github.com/user-attachments/assets/6cfd203b-d320-46da-b7b5-9ede2e9d814c"
/> |
| _Immediate inline error, cleared as soon as it’s corrected._ |
| <img width="1280" height="1103" alt="OAuth Apps Organization Settings
Office Supabase"
src="https://github.com/user-attachments/assets/f2637d92-c149-4d1a-9d83-130e0f54ce66"
/> |
| _Follow-up footer pattern if that error (or any inline error) is
ignored._ |

## Review instructions

1. Open the [staging
preview](https://studio-staging-git-dnywh-trusted-partner-permis-56807c-supabase.vercel.app/dashboard)
→ Organization → OAuth Apps. Edit an organisation-bound app, or select
**Publish OAuth app**. If your organisation is not a Trusted Partner,
use the DevTools steps below first.
2. Select Direct database access, then set Database management to No
access or Write. Check that the inline error explains that “Database
management” requires at least read access and Confirm stays enabled.
Click Confirm: saving should be blocked and “Fix the errors above to
continue.” should appear in red above the footer actions.
3. Select Database management Read only or Read and write. Check that
the inline and footer errors clear. Confirm should remain enabled.
4. Repeat in the opposite order, or remove Direct database access.
Neither control should change automatically.


<details>
<summary>Review without a Trusted Partner organisation (Chrome
DevTools)</summary>

1. In the Studio dev toolbar’s **Flags** tab, enable
`enableScopedOAuthPublish` if needed.
2. Open Chrome DevTools → **Network**, then open **Publish OAuth app**
or edit an existing app.
3. Select the **GET** request whose URL ends in
`/platform/organizations/YOUR_ORG_SLUG`, without `/oauth/apps` after it.
Its response contains your organisation’s name and slug.
4. Right-click the request → **Override content**. Choose a local folder
and click **Allow**. Add `"is_trusted_partner": true` to the top-level
JSON object, or change the existing value to `true`. Keep every other
field and save with **Cmd/Ctrl+S**.
5. Reload with DevTools open and reopen the app form. For a new app,
choose **An owner, once for the whole organization** under
**Authorization**. Fill in the required name, website and callback URL
so other validation does not interfere.
6. Under **Application permissions**, select **Direct database access →
Read only** while **Database management** has **No access**. Check that
the inline error appears and **Confirm** stays enabled. Click
**Confirm** and check that saving is blocked, with “Fix the errors above
to continue.” in red above the footer actions.
7. Set **Database management → Read only** or **Read and write**. Check
that the inline and footer errors clear, while **Confirm** remains
enabled. Change it to **Write** and check that the error returns.
Neither permission should change automatically.
8. Set **Direct database access → No access**. Check that the inline and
footer errors clear. Cancel the form without saving.
9. Turn off **Sources → Overrides → Enable Local Overrides** and reload
when finished.

The override only changes the response in your browser. It does not
grant backend Trusted Partner eligibility, so use it to review the UI
validation. Saving an app with direct database access requires a
genuinely eligible organisation.

</details>
2026-12-03 13:39:50 +07:00
Danny WhiteandJoshen Lim be27ad8cf5 feat(studio): show apps and confirm token access changes (#53917)
> [!WARNING]
> This PR relies on #53705 being merged first.

## Problem

Project admins need to see authorised apps before changing token access.
[DEPR-734](https://linear.app/supabase/issue/DEPR-734)

## Solution

- Show Apps below Members only when authorised apps exist; hide the
section while loading or empty, and retain verification errors.
- Show access levels and links to each app’s access sheet.
- Include members and authorised apps in toggle confirmations; wait for
complete counts and offer retry on errors.

| After |
| --- |
| <img width="725" height="560" alt="CleanShot 2026-12-02 at 14 44 13"
src="https://github.com/user-attachments/assets/6f033b2f-a8b4-4a64-824f-ef0cc270ff6c"
/> |
| No authorised apps (no empty state) |
| <img width="728" height="773" alt="CleanShot 2026-12-02 at 14 11 31"
src="https://github.com/user-attachments/assets/76b31461-abca-4f9a-b76d-bb664093dd67"
/> |
| Loading error |
| <img width="727" height="749" alt="CleanShot 2026-12-02 at 14 38 34"
src="https://github.com/user-attachments/assets/0722002c-a5cf-4877-b00b-15f9e4a6524c"
/> |
| 1× authorised app |
| <img width="418" height="222" alt="CleanShot 2026-12-02 at 14 39 27"
src="https://github.com/user-attachments/assets/db5cc89a-2099-4a6f-969c-b4e2c38ac972"
/> |
| Disabling token access whilst 1× app is relying on it |
| <img width="424" height="387" alt="CleanShot 2026-12-02 at 14 39 58"
src="https://github.com/user-attachments/assets/e15c1227-8190-42f4-876b-5f55a321848b"
/> |
| Re-enabling token access which will immediately restore access for N
members and apps |


## Review instructions

1. Open the [staging
preview](https://studio-staging-git-dnywh-depr-734-temporary-acc-b81819-supabase.vercel.app/dashboard),
select a project you administer, and open **Database → Settings**.
Enable database token access in **Feature previews**, plus `jitDbAccess`
and `enableScopedOAuthManage` in the dev toolbar’s **Flags** tab if
needed.
2. Open DevTools → **Console**, paste the setup below and run it.
Navigate to another Studio page (possibly outside of Database) and back
to **Database → Settings**, without reloading. Check **Test Partner
App** appears under Apps with **Read and write** access.
3. Turn token access off. Check the confirmation includes the app, then
choose **Cancel**.
4. Run `tokenAccessReview.state = 'disabled'` in Console, then navigate
away and back. Turn token access on, expand **Who will regain access?**,
check the app is listed, then choose **Cancel**.
5. Run `tokenAccessReview.state = 'enabled'; tokenAccessReview.fail =
true`, then navigate away and back. Check the Apps error disables the
toggle. Run `tokenAccessReview.fail = false` and choose **Retry apps**
to recover.
6. Run `tokenAccessReview.apps = false`, then navigate outside Database
and back. Check Apps is hidden once loaded. Reload to remove the setup.

The setup mocks GET responses only, requires no app authorisation, and
does not change saved access. Use **Cancel** in both confirmations. Do
not reload between steps; reloading removes the setup. Network’s
Response tab does not show these browser-generated responses.

<details>
<summary>Console setup</summary>

```js
(() => {
  if (window.tokenAccessReview) throw new Error('Review setup is already active. Reload to reset it.')
  const projectRef = location.pathname.match(/\/project\/([^/]+)/)?.[1]
  if (!projectRef) throw new Error('Open a project’s Database Settings first.')
  const appId = '75e64165-b74e-432f-bb70-80d6ae432f06'
  const grantId = 'review-org-grant'
  const scopes = ['database_token_access:write']
  const originalFetch = window.fetch
  const review = window.tokenAccessReview = { state: 'enabled', apps: true, fail: false }
  const approvals = /\/platform\/organizations\/[^/]+\/oauth\/approvals$/
  const grants = new RegExp(`/platform/organizations/[^/]+/oauth/approvals/${appId}/grants$`)
  const page = (data) => Response.json({ data, links: { next: null, prev: null } })
  window.fetch = function (input, init) {
    const url = new URL(input instanceof Request ? input.url : input, location.href)
    const method = init?.method ?? (input instanceof Request ? input.method : 'GET')
    if (method.toUpperCase() === 'GET') {
      if (url.pathname.endsWith(`/v1/projects/${projectRef}/jit-access`)) {
        return Promise.resolve(Response.json({ state: review.state, appliedSuccessfully: true }))
      }
      if (approvals.test(url.pathname)) {
        return Promise.resolve(page(review.apps ? [{
          id: appId, type: 'oauth_app', attributes: {
            app: { name: 'Test Partner App', icon: null, created_by: null },
            last_approved_at: '', target: 'organization',
            org_grant: { grant_id: grantId, approved_scopes: scopes, approved_at: '' },
          },
        }] : []))
      }
      if (grants.test(url.pathname)) {
        if (review.fail) return Promise.resolve(Response.json({ message: 'Review: apps unavailable' }, { status: 500 }))
        return Promise.resolve(page([{
          id: grantId, type: 'oauth_grant', attributes: {
            kind: 'organization_bound', user: null, approved_at: '', approved_scopes: scopes,
            projects: [{ ref: projectRef, name: 'Review project' }],
          },
        }]))
      }
    }
    return originalFetch.call(this, input, init)
  }
})()
```

</details>

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-12-02 19:55:19 +07:00
Danny WhiteandJoshen Lim 4dbb966b2e feat(studio): show Trusted Partner access on OAuth consent (#53583)
> [!WARNING]
> Live readiness checks require
[CTRL-2277](https://linear.app/supabase/issue/CTRL-2277) in the target
environment; production deployment is pending.

## Problem

Trusted Partner consent must explain direct database access and project
blockers before authorisation.
[DEPR-732](https://linear.app/supabase/issue/DEPR-732)

## Solution

- Show Direct database access alongside the requested permissions.
- Check selected projects, or every project page for organisation-wide
grants.
- Separate blocking issues from SSL notices; block authorisation during
loading or errors and offer retry.

| After |
| --- |
| <img width="1280" height="1323" alt="Authorize API Access Supabase"
src="https://github.com/user-attachments/assets/adb6367a-bace-4b62-81b5-68ba4c11396c"
/> |
| Consent screen with Direct database access (previously “Table data”)
and Database management |
| <img width="1280" height="1323" alt="Authorize API Access Supabase"
src="https://github.com/user-attachments/assets/0c35900c-1059-49cd-b1c5-4e0cf5441b9b"
/> |
| Selected-project blockers and the separate SSL notice |
| <img width="1280" height="1323" alt="95741"
src="https://github.com/user-attachments/assets/1fbef4f0-0433-4c93-b390-84d210dfb665"
/> |
| Organisation-wide blockers _without_ project-removal actions |

## Review instructions

1. Open the [staging consent
screen](https://studio-staging-git-dnywh-depr-732-trusted-partn-f24cfb-supabase.vercel.app/dashboard/authorize?auth_id=11666aa8-7f7e-4705-b33a-981903fd682e).
Enable `enableScopedOAuthConsent` in the dev toolbar’s **Flags** tab if
needed.
2. Open Chrome DevTools → **Network** and reload. Select the **GET**
request ending in `/platform/oauth/authorizations/{id}`.
3. Right-click that request → **Override content**. Choose a local
folder and click **Allow**. Add `database_token_access:read` and
`database_token_access:write` to `scopes`. Use only the read scope to
check read-only access. Keep every other field, save with
**Cmd/Ctrl+S**, then reload with DevTools open.
4. Select projects. Override each **GET** request ending in
`/platform/organizations/{slug}/oauth/authorizations/{id}/projects/{ref}/database-access`.
Use `{"issues":[],"enables_ssl":false}` for ready projects, then
`{"issues":[],"enables_ssl":true}` for an SSL notice. Save and reload
after each change. Check Direct database access and Database management
are separate, and SSL alone allows authorisation.
5. Change a readiness response to
`{"issues":["postgres_upgrade_required","platform_unsupported"],"enables_ssl":true}`.
Save and reload. Check blockers prevent authorisation, SSL stays
separate, and removing a blocked project clears its blockers.
6. Set `project_scoping_mode: false` in the authorisation override. Save
and reload. Check any blocked project prevents organisation-wide
authorisation, with no project-removal actions.
7. Block a database-access request in Network and reload. Check
authorisation stays disabled. Unblock it and choose **Retry checks**.
8. For a returning app, override `existing_grant.approved_scopes` in the
request ending in `/preflight`. Save and reload. Check added, removed
and unchanged permissions.
9. Disable **Sources → Overrides → Enable Local Overrides**. Repeat
ready and blocked project checks with a real staging authorisation
before approving live readiness behaviour.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-12-02 16:19:30 +07:00
Danny WhiteandJoshen Lim 05cbf8ca50 feat(studio): show Trusted Partner access in Authorized Apps (#53705)
## Problem

Organisation admins need to see authorised apps’ direct database access.
[DEPR-731](https://linear.app/supabase/issue/DEPR-731)

## Solution

- Show the approved direct-access level in Authorized apps.
- Show permissions and project coverage in **View access**.

| After |
| --- |
| <img width="1280" height="813" alt="OAuth Apps Organization Settings
Basket Supabase"
src="https://github.com/user-attachments/assets/d2bbc682-6e6f-462f-b5c2-3a2a8ff813ba"
/> |
| Authorized apps list showing read-only direct access |
| <img width="1280" height="813" alt="OAuth Apps Organization Settings
Basket Supabase (4)"
src="https://github.com/user-attachments/assets/24506547-461a-44e0-880f-6ade23fd734c"
/> |
| Authorized apps list showing read-write direct access |
| <img width="1280" height="813" alt="OAuth Apps Organization Settings
Basket Supabase (1)"
src="https://github.com/user-attachments/assets/53ac2662-9fb7-4cfc-b118-31ef5778b339"
/> |
| View access sheet with permission groups and project coverage |
| <img width="1280" height="813" alt="OAuth Apps Organization Settings
Basket Supabase (3)"
src="https://github.com/user-attachments/assets/a21cefa7-c656-4b5c-bb0c-075c724350f9"
/> |
| View access sheet with permission groups and project coverage |
| <img width="424" height="297" alt="CleanShot 2026-12-02 at 15 09 39"
src="https://github.com/user-attachments/assets/e1f83068-21a8-43c4-9ca8-dcf6a3164b01"
/> |
| Added second paragraph for revoking access to apps with direct
database access. This “existing connections will close shortly” is only
accurate one CTRL-2141 merges, as discussed
[here](https://github.com/supabase/supabase/pull/53705/changes#r4764576735).
|

## Review instructions

1. Open the [staging
preview](https://studio-staging-git-dnywh-depr-731-authorized-apps-supabase.vercel.app/dashboard),
select a test organisation and open **Apps**
(`/dashboard/org/{slug}/apps`). Enable `enableScopedOAuthManage` in the
Studio dev toolbar’s **Flags** tab if needed.
2. Open Chrome DevTools → **Network** and reload. Select the **GET**
request ending in `/platform/organizations/{slug}/oauth/approvals`.
3. Right-click that request → **Override content**. Choose a local
folder and click **Allow**. For an existing organisation-bound app, add
`database_token_access:read` to `attributes.org_grant.approved_scopes`.
Keep every other field, save with **Cmd/Ctrl+S**, then reload with
DevTools open.
4. Open the app’s **View access**. Override the **GET** request ending
in `/platform/organizations/{slug}/oauth/approvals/{app_id}/grants`. Add
the same scope to the matching grant’s `attributes.approved_scopes`.
Save and reload.
5. Check read-only direct access in the list and access sheet. Change
the scope to `database_token_access:write` in both overrides, save and
reload. Check read-write access and compare it with a standard app.
6. Compare the grants response’s existing `attributes.projects` list
with `null` for all projects. Save and reload after each change. Check
permission groups, project coverage and the app ID in **View access**.
7. Open **Revoke access**, check the existing OAuth access explanation,
then choose **Cancel**.
8. Disable **Sources → Overrides → Enable Local Overrides**. Repeat with
real authorised staging apps.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-12-02 14:05:39 +07:00
Danny WhiteandJoshen Lim 0265ff935e feat(studio): configure direct database access in OAuth app settings (#54006)
> [!WARNING]
> Partner eligibility requires
[CTRL-2282](https://linear.app/supabase/issue/CTRL-2282) in the target
environment; production deployment is pending.

## Problem

Trusted Partners need to configure direct database access for OAuth
apps. [DEPR-733](https://linear.app/supabase/issue/DEPR-733)

## Solution

- Save and reload direct-access scopes independently of Database
management.
- Allow new grants only for eligible organisations and
organisation-bound apps.
- Allow existing direct access to be removed when eligibility changes.

| After |
| --- |
| <img width="1280" height="754" alt="OAuth Apps Organization Settings
Basket Supabase"
src="https://github.com/user-attachments/assets/e9b78fb6-65e4-4299-ad07-a2f9538a36d5"
/> |
| `"is_trusted_partner": false` or missing |
| <img width="1280" height="754" alt="OAuth Apps Organization Settings
Basket Supabase (1)"
src="https://github.com/user-attachments/assets/cf78db2c-952c-47e9-9239-82aab2c8398a"
/> |
| `"is_trusted_partner": true` |

## Review instructions

1. Open the [staging
preview](https://studio-staging-git-dnywh-depr-733-oauth-app-dat-c71d4a-supabase.vercel.app/dashboard),
select a test organisation and open **OAuth Apps**. It should already be
`true, but enable `enableScopedOAuthPublish` in the Studio dev toolbar’s
**Flags** tab if needed.
2. Open Chrome DevTools → **Network**, then click **Publish OAuth app**.
3. In Network, select the **GET** request whose URL ends in
`/platform/organizations/YOUR_ORG_SLUG`, without `/oauth/apps` after it.
Its response contains the organisation’s name and slug.
4. Right-click that request → **Override content**. Choose a local
folder and click **Allow**. Add `"is_trusted_partner": true` to the
top-level JSON object, keeping every other field. Save with
**Cmd/Ctrl+S**.
5. Reload with DevTools open, reopen **Publish OAuth app**, and choose
**An owner, once for the whole organization** under authorisation.
6. Under **Application permissions**, find **Direct database access**.
Try **No access**, **Read only** and **Read and write**. Change
**Database management** separately and check the two values stay
independent.
7. With direct access selected, check **Each member, for themselves** is
unavailable. Set direct access to **No access**, choose member
authorisation, and check the Direct database access dropdown becomes
disabled.
8. Switch back to organisation authorisation, select direct access and
open **Preview consent for users**. Check its label and access level
match the form.
9. Change the overridden field to `false`, save and reload. Reopen the
new-app form and check Direct database access is hidden.
10. Disable **Sources → Overrides → Enable Local Overrides**. In a
genuinely eligible staging organisation, create a disposable app with
direct access, save and reopen it. Change its access level, save and
reopen again, then remove direct access. Check Database management
remains unchanged.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-12-02 16:50:36 +11:00
b53403e1d7 docs(integrations): add Build a Supabase integration guide (#54088)
## Problem

The steps to build a Supabase integration are spread across five pages:
the Partner Catalog page, creating an OAuth app, OAuth scopes, the
partner install flow, and the Management API reference. A partner has no
single page that says where to start or what to do next. Linear:
DOCS-1720.

## Solution

Add one guide, **Build a Supabase integration**, as the first item under
**Build Your Own** in the integrations sidebar. It does not repeat the
detail on the other pages. It links to them.

- **The path at a glance:** two short paths. Partner Catalog: apply,
build a landing page, publish. Integration: apply, build the OAuth flow,
build the integration, publish.
- **Apply to the Partners program**, then **Choose: Partner Catalog or
Integration**, a comparison table with wireframe images (SVG, light and
dark).
- **Partner Catalog: Build your landing page** and **Integration**
(build the OAuth flow, build the integration), each with "Build it"
cards that link to the top of the existing page.
- **Publish:** ask the partner manager to list the partner on the
Partner Catalog or the Integrations page.
- Removes the redirect from
`/docs/guides/integrations/build-a-supabase-integration` to the OAuth
guide, so the new page is reachable at that URL. The old `/oauth-scopes`
redirect stays.
- The progression and card data is in
`apps/docs/data/content-listings/build-a-supabase-integration.data.ts`.

Not in this PR: edits to the existing pages. The cards link to page
tops, so nothing here depends on those edits.

## Please check

- The five progression icons are placeholders from the built-in set. New
icons are coming.
- The table images sit inside table cells with a fixed width. I checked
them in the dev server only.
- I rendered the page with `pnpm dev` and ran `oxfmt --check` on the
changed files. I did not run the docs tests or `build:guides-markdown`.
- Two details are unverified: how partners hand their public key to
Supabase for a signed redirect, and partner status callbacks. The guide
does not describe either.
- The Dashboard Integrations tab wireframe is a drawing, not a
screenshot.

## Preview links

| Site | Live | Preview | Search for |
| ---- | ---- | ------- | ---------- |
| Docs |
[/docs/guides/integrations/build-a-supabase-integration](https://supabase.com/docs/guides/integrations/build-a-supabase-integration)
(redirects to the OAuth guide until this merges) | Vercel bot comment |
`The path at a glance` |

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: John Stokvis <345546350+stokvis-at-supabase@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Nik Richers <nik@validmind.ai>
Co-authored-by: John Stokvis <johnstokvis@Johns-MacBook-Pro.local>
2026-12-01 09:53:58 -06:00
Gildas Garcia fd5c02f1a0 fix(studio): Scoped OAuth apps - improve text for projects with permission issues (#54409)
## Problem

When an authorization fails because of permission issues, we currently
display _Unavailable_ next to the problematic projects in the project
selector list. This is confusing as those projects are available, just
not selectable for this authorization

## Solution

Display _permission issues_ instead

<img width="417" height="601" alt="image"
src="https://github.com/user-attachments/assets/331073ac-71e0-45b0-a607-dcbd47268d91"
/>
2026-12-01 16:07:27 +01:00
Gildas Garcia 7a6c6f7df8 fix(studio): fix Publish OAuth app button tooltips (#54359)
## Problem

Users who don't have the required permissions to publish an oauth app
may see two tooltips when hovering the _Publish OAuth app_ button.

<img width="620" height="208" alt="image"
src="https://github.com/user-attachments/assets/fedf7150-35e6-4429-b0c0-2fbc4cd2aa5e"
/>

## Solution

Hide the shortcut tooltip when users don't have the required permissions
to publish an oauth app
2026-12-01 10:15:50 +01:00
Danny White 3dcb524f9e fix(studio): make OAuth access levels single-select (#54109)
## Problem

The OAuth app editor has separate Read and Write checkboxes. The menu
closes after each click, so choosing both scopes takes two trips through
the menu.

## Solution

Use Studio’s single-select control to set the full access level in one
step. The current scopes determine the label on the trigger. The choices
are **No access**, **Read only**, **Write**, and **Read and write**.
Each choice updates the scopes for that row and preserves other rows.

This is the base for #54006. The scoped personal access token editor has
a companion update in #54164.

| Before | After |
| --- | --- |
| <img width="651" height="297" alt="CleanShot 2026-11-26 at 15 33 36"
src="https://github.com/user-attachments/assets/dd74666a-9a5a-42fa-97f3-d866e5394d93"
/> | <img width="649" height="307" alt="CleanShot 2026-11-27 at 11 30
25"
src="https://github.com/user-attachments/assets/48395dd5-032e-49eb-9663-709eeac40fc3"
/> |

## Review instructions

1. Open the [OAuth Apps
preview](https://studio-staging-git-dnywh-oauth-permission-acces-6a3679-supabase.vercel.app/dashboard/org/_/apps)
and select **Publish OAuth app**.
2. Under **Application permissions**, try each access level on a row.
Check that one selection closes the menu and updates the trigger.
3. Select **No access** and check that both scopes are cleared for that
row. Check that another row’s selection stays in place.
2026-12-01 14:53:15 +11:00
Danny White 556faeab51 feat(studio): clarify authorized app grant details (#54284)
## Problem

The grants dialog makes project coverage and each member’s permissions
hard to inspect.

## Solution

- Replace the dialog with a grant-details sheet.
- Separate organisation and member access, with project references and
permissions grouped by access level.
- Move app IDs into Details and add a revoke action for authorised
admins.
- Build on #54285 using the existing grants API.

| Before | After |
| --- | --- |
| <img width="1280" height="1323" alt="OAuth Apps Organization Settings
Basket Supabase"
src="https://github.com/user-attachments/assets/b6bb0082-9cee-48b4-adb4-058f14f10f9f"
/> | <img width="1280" height="1323" alt="OAuth Apps Organization
Settings Basket Supabase"
src="https://github.com/user-attachments/assets/b32a7723-9fa0-452d-95f5-1762fd364163"
/> |
| <img width="1280" height="1185" alt="OAuth Apps Organization Settings
Basket Supabase"
src="https://github.com/user-attachments/assets/9a7982ba-aebe-42f4-9ac6-9308136150f7"
/> | <img width="1280" height="1221" alt="OAuth Apps Organization
Settings Basket Supabase"
src="https://github.com/user-attachments/assets/1965f7e4-8554-4fa9-86ef-7e53af1d0038"
/> |

## Review instructions

1. Sign in to staging and use an authorised app, or [authorise the test
app](https://api.supabase.green/v1/oauth/authorize?client_id=75e64165-b74e-432f-bb70-80d6ae432f06&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A54321%2Fcallback&state=grant-sheet-review).
The localhost callback may fail after the grant is saved.
2. Open the
[preview](https://studio-staging-git-dnywh-oauth-grant-details-supabase.vercel.app/dashboard/org/_/apps#authorized-apps),
select the same organisation and choose **Manage app → View access**.
3. Check the grant sections, project references and permission groups.
Test narrow widths, closing the sheet and cancelling **Revoke access**.

### Mixed-grant overrides

In **DevTools → Network**, override only the GET ending in
`/oauth/approvals/<app-id>/grants` with this response. Save, reload and
reopen the sheet. Remove any parent `/approvals` override to avoid
Chrome’s file/folder clash.

<details>
<summary>grants.json</summary>

```json
{
  "data": [
    {
      "id": "22222222-2222-4222-8222-000000000001",
      "type": "oauth_grant",
      "attributes": {
        "approved_at": "2026-11-30T00:00:00Z",
        "approved_scopes": [
          "database:read",
          "database:write",
          "projects:read"
        ],
        "kind": "organization_bound",
        "projects": null,
        "user": null
      }
    },
    {
      "id": "22222222-2222-4222-8222-000000000002",
      "type": "oauth_grant",
      "attributes": {
        "approved_at": "2026-11-30T00:00:00Z",
        "approved_scopes": [
          "projects:read"
        ],
        "kind": "member_bound",
        "projects": [
          {
            "name": "Example storefront",
            "ref": "example-storefront"
          }
        ],
        "user": {
          "username": "alex",
          "email": "alex@example.com",
          "gotrue_id": "33333333-3333-4333-8333-000000000001"
        }
      }
    },
    {
      "id": "22222222-2222-4222-8222-000000000003",
      "type": "oauth_grant",
      "attributes": {
        "approved_at": "2026-11-30T00:00:00Z",
        "approved_scopes": [],
        "kind": "member_bound",
        "projects": [],
        "user": {
          "username": "sam",
          "email": "sam@example.com",
          "gotrue_id": "33333333-3333-4333-8333-000000000002"
        }
      }
    }
  ],
  "links": {
    "next": null,
    "prev": null
  }
}
```

</details>

Check that organisation access covers all projects, Alex has only read
access to Example storefront, and Sam has no projects or permissions.
Disable overrides when finished.

Requires `enableScopedOAuthManage` for the organisation.
2026-12-01 09:57:35 +11:00
Danny WhiteandGildas Garcia 99a665b8d7 feat(studio): polish authorized app access actions (#54285)
## Problem

Authorized Apps hides access details behind a menu and uses a lengthy
revoke confirmation. Opening and closing these views should work
consistently with a mouse and keyboard.

## Solution

- Open access details from the app row, app name or **View access** menu
action.
- Remove the menu tooltip, use consistent labels and hide
unavailable-action separators.
- Use a compact **Revoke access** confirmation with focus returned to
the initiating control.
- Keep the existing grants dialog and table IDs; the sheet follows in
#54284.

| Before | After |
| --- | --- |
| <img width="1274" height="687" alt="CleanShot 2026-11-30 at 17 40 25"
src="https://github.com/user-attachments/assets/e7eb9411-cc2e-4bf2-8599-979f06069791"
/> | <img width="1273" height="679" alt="CleanShot 2026-11-30 at 17 40
05"
src="https://github.com/user-attachments/assets/d6b38690-7ba2-4c8c-adfc-0e0e356f7687"
/> |
| <img width="576" height="284" alt="CleanShot 2026-11-30 at 17 44 18"
src="https://github.com/user-attachments/assets/e2b7f015-c214-4034-b6ab-a4afc050510d"
/> | <img width="424" height="207" alt="CleanShot 2026-11-30 at 17 44
36"
src="https://github.com/user-attachments/assets/77df776d-bc93-4cdb-b333-2c6c54ed6554"
/> |


## Review instructions

1. Use a staging test organisation with an authorised app. If needed,
[authorise the existing test
app](https://api.supabase.green/v1/oauth/authorize?client_id=75e64165-b74e-432f-bb70-80d6ae432f06&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A54321%2Fcallback&state=grant-sheet-review).
The localhost callback may fail to load after the grant is saved.
2. In the [Studio staging
preview](https://studio-staging-git-dnywh-oauth-access-list-polish-supabase.vercel.app/dashboard/org/_/apps#authorized-apps),
open **OAuth Apps → Authorized Apps** at
`/dashboard/org/_/apps#authorized-apps`. Click an app row or name, then
use **Manage app → View access**. Each opens the existing grant-details
dialog.
3. Focus the app name and press Enter or Space. Close the dialog and
check focus returns to the app name. Opening from the row or menu should
return focus to **Manage app**.
4. As an admin, select **Manage app → Revoke access**. Check the compact
confirmation names the app and explains the organisation and member
impact. Cancel it and check that grant details do not open accidentally
and focus returns to the app menu. Revoke only a disposable test grant
when checking submission.
5. As a user without revoke permission, check the menu has no revoke
action or stray separator. Repeat the controls and confirmation at a
narrow width.

---------

Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-12-01 09:47:05 +11:00
9b3435010c fix(studio): show client ID and app ID on OAuth apps page (#54324)
## Problem

On the OAuth apps page in Studio, the table showed only the Client ID,
and the edit panel showed the app ID as unlabeled `ID: ...` text under
the app name. It was hard to tell the two IDs apart, or to copy the
right one. That contributed to the wrong ID type being handed to the
team that manages the Stripe pipeline allowlist (incident, Nov 20–23).

## Solution

- **Table:** add an **App ID** column next to **Client ID**. Both are
shown shortened (`65****9a71`) with a copy button. Hover an ID to show
the whole value. The copy button always copies the whole value.
- **Edit panel:** show **Client ID** and **App ID** as separate labeled,
copiable fields (full value, not shortened), each with one line of
helper text:
- Client ID: "Used to identify your app when it makes OAuth requests to
Supabase."
- App ID: "Used to manage your app on Supabase, such as updating or
deleting it."
- Remove the old `ID: ...` description under the app name.
- Add one small shared component, `OAuthAppId`, used by the table and
the edit panel.

The helper text follows the discussion in Slack: `client_id` is what the
deployed app sends in OAuth requests to the Management API, and `app_id`
is the primary key the app's author uses in platform APIs (for example
to update or delete the app).

Not in this PR: the Authorized apps table already shows its App ID with
a copy button, so it is unchanged. No API or data changes.

## Please check

- **Helper text wording.** Is it accurate for both IDs?
- **Shortened IDs.** The first 2 and last 4 characters, with `****`
between, only for IDs longer than 20 characters.

## Review instructions

1. Open **Organization → OAuth Apps** (`/org/<slug>/apps`) and create an
app if there is none.
2. In **Publishable apps**, check that **Client ID** and **App ID** both
show as shortened values, and that each copy button copies the full
value.
3. Hover a shortened ID. It should show a tooltip with the full value.
4. Open the app's edit panel. Check that Client ID and App ID are
labeled, show the full value, and copy correctly, and that the old `ID:
...` text under the app name is gone.

Checked locally against the full platform stack (format, lint,
type-check, and by eye). No tests added: the change is layout and
display only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: John Stokvis <345546350+stokvis-at-supabase@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: kemal <hello@kemal.earth>
2026-11-30 15:55:56 -06:00
Gildas Garcia 418d251abe fix(studio): ensure we allow partial grants on all projects (#54311)
## Problem

When users try to authorize all current and future projects with
unsufficient permissions for an app that allows partial grants, the
consent screen does not display the correct message and block them from
authorizing the app.

## Solution

Fix the conditions to display the proper message about missing features
and allow authorization with partial grants.

## Review instructions

- Configure an app that allows partial grants (must be member bound)
- Configure a user without enough permissions (Read-only for instance)
- Use the oauth example app to authorize the app with this user
- Check that you are warned about missing features but that you can
still authorize the app
2026-11-30 17:45:21 +01:00
Gildas Garcia ce6c5e71fa feat(studio): OAuth app consent screen support for partial grants (#54213)
## Problem

Supabase admins can enable support for partial grants on some apps but
the consent screen doesn't support this scenario

## Solution

Detect partial grant support and warn users when they lack some
permissions, allowing them to confirm they want to authorize the app
anyway

<img width="846" height="2150" alt="image"
src="https://github.com/user-attachments/assets/37c48da9-395b-4425-b33d-7acdc8f3dcc1"
/>
2026-11-30 10:13:26 +01:00
Gildas Garcia 107b7dbad2 feat(studio): already approved request preselect org and projects (#54036)
## Problem

When users navigate back to the consent screen after a redirect error,
they have to reselect the org and projects despite the request having
been approved already

## Solution

When present, `approved_organization_slug` should set the organization
picker and override `organization_slug` from query parameters. Likewise,
`approved_project_refs` should take precedence over project refs from
query parameters or an existing grant in the preflight check.
2026-11-25 16:23:14 +01:00
kemal.earthandGildas Garcia 8597e7dc5a feat(studio): oauth apps form update (#53893)
## Problem

The Authorization section of the OAuth app publish form was two toggles,
each with its own inline warning box and its own "I understand this is
permanent" checkbox, plus a static info box describing what users would
see. Two problems with that:

- The settings are a one-way door, so the permanence warning appeared
twice and was easy to click past.
- Nothing showed what the two settings combine into, or what the person
connecting the app actually ends up seeing.

## Solution

UI only — the saved fields (`grant_kind`, `project_scoping_mode`) and
the save logic are unchanged, and `allow_partial_grants` is untouched.

- **Two radio groups** in place of the toggles: "Who approves access?"
(an owner, once for the org / each member, for themselves) and "Which
projects can it reach?" (all projects / let them choose). Built on
`RadioGroupStacked`, grouped with `fieldset`/`legend`.
- **One-way door made visible**: the saved option carries a `Current`
badge, the stricter options carry `Permanent`, and once a stricter value
is saved the looser option is disabled and badged `Can't switch back`.
- **Live preview** replaces the info box: a dimmed, cropped view of the
real consent screen, reusing `ScopeGroupCard` and the interstitial's
width, so it reflects the app's actual scopes and updates as the radios
change. A footer row states the resulting grant, and what it is today
when there are unsaved changes.
- **One confirmation, at save time**: both inline warnings and their
checkboxes are gone. Saving a stricter value opens a `ConfirmationModal`
listing only what changed, with a single acknowledgement checkbox gating
"Save permanently".

Unit tests cover the badge/locking states and the preview; the dialog's
bullets and acknowledgement gate have their own tests.

## Review instructions

1. Enable the `enableScopedOAuthPublish` flag and open **Organization
settings → OAuth Apps**.
2. Publish a new app. Both questions should default to the looser option
with no `Current` badges, and the stricter options should show
`Permanent`.
3. Change each radio and watch the preview and the "Resulting grant"
line update — switching "Which projects can it reach?" should swap the
fixed projects row for the picker.
4. Save with a stricter value selected. Confirm the dialog lists only
the changes you made, and that "Save permanently" stays disabled until
the checkbox is ticked.
5. Reopen the app. The saved values should show `Current`, and the
looser options should be disabled and badged `Can't switch back`.
6. Edit an app without touching authorization and save — no dialog
should appear.

---------

Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-11-25 10:24:54 +00:00
Danny White f6dede6c37 feat(studio): make OAuth permission changes easier to scan (#53700)
## Problem

When a returning app changes its permissions, the consent screen mixes
old and new access levels in a list of parenthetical labels.

## Solution

Show added, removed and unchanged permissions in their access groups. A
level change appears in both the old and new groups. Green comes from
the success token so it stays green across accent settings.

| Before | After |
| --- | --- |
| <img width="868" height="2164" alt="CleanShot 2026-11-20 at 12 40
23@2x"
src="https://github.com/user-attachments/assets/74e8462c-60eb-44c5-be25-7e683083be8d"
/> | <img width="866" height="1986" alt="CleanShot 2026-11-20 at 12 38
47@2x"
src="https://github.com/user-attachments/assets/a739e619-8fc7-4a91-9a28-4b3c176b882b"
/> |

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-permission-diff-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

**What to check**

1. Open Chrome DevTools → **Network** → **Fetch/XHR**, filter by the
`auth_id` in the consent URL, and reload. Right-click each of these two
**GET** requests and select **Override content**. Choose a local
Overrides folder if Chrome prompts you.
- `/api/platform/oauth/authorizations/<auth_id>` is the new request. Set
its top-level `scopes` to
`["database:read","database:write","projects:read","storage:read"]`.
-
`/api/platform/organizations/<org-slug>/oauth/authorizations/<auth_id>/preflight`
is the existing grant check. In that response, replace
`"existing_grant": null` with this field and leave the rest of the
response intact.

     ```json
     "existing_grant": {
       "grant_id": "00000000-0000-4000-8000-000000000001",
"approved_scopes": ["database:read", "projects:read", "secrets:read"],
       "project_refs": null,
       "approved_at": "2026-11-19T00:00:00.000Z"
     },
     ```

2. Keep the other fields as returned. Save both overrides and reload
with DevTools open.
3. Check that Database management is removed from **Read only** and
added to **Read and write**, Projects is unchanged, Storage is added,
and Secrets is struck through. Clear the overrides when done.
2026-11-25 10:55:08 +11:00
Gildas Garcia 8583896114 feat(studio): Improve OAuth app consent screen loading state (#53927)
## Problem

The OAuth consent screen appears before the preflight data has loaded,
briefly showing the default state.

## Solution

Keep the loading animation visible until that request completes so users
do not see the intermediate state

## Review instructions

- Throttle the network speed in the browser devtool 
- Using the OAuth example app, reauthorize an app (preferably one that
targets projects as it's easier to see the preflight has loaded)
- Verify you only see the consent form with the existing grant settings
applied (the projects are pre-selected)
2026-11-24 12:28:35 +01:00
Danny White a1b71bfdce fix(studio): clarify OAuth consent copy and hierarchy (#53702)
## Problem

The consent screen repeats information below the permissions and puts
the organization-level error away from the button it blocks.

## Solution

Place the member-bound role limit under **Permissions requested**, mark
section headings as headings, and group the role error with the action.
Keep the redirect destination centred in the footer.

| Before | After |
| --- | --- |
| <img width="890" height="1892" alt="CleanShot 2026-11-20 at 12 46
26@2x"
src="https://github.com/user-attachments/assets/1fa1b266-a82a-4fec-a840-50408f1e04fa"
/> | <img width="872" height="1706" alt="CleanShot 2026-11-20 at 12 46
32@2x"
src="https://github.com/user-attachments/assets/f0e510b1-e6b3-4e66-b3f7-61845c4cab71"
/> |
| <img width="874" height="1970" alt="CleanShot 2026-11-20 at 12 52
19@2x"
src="https://github.com/user-attachments/assets/97bcef92-50e7-453d-a1e4-9962b01a7cdf"
/> | <img width="862" height="1488" alt="CleanShot 2026-11-20 at 12 47
59@2x"
src="https://github.com/user-attachments/assets/556eb2f7-2d71-47ed-a21d-8a71a577bae6"
/> |

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-consent-copy-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

**What to check**

1. Open consent for a member-bound staging test app. Compare the role
explanation under **Permissions requested** and the centred redirect
destination with the current staging screen.
2. Open an organization-wide request with a role that cannot grant it.
Alternatively, in Chrome DevTools → Network, use **Override content** on
the successful organization preflight GET response for an unscoped
request. Set `validation_failure` to
`{"scope_target":"all_projects","role":{"name":"read-only"},"failed_scopes":["database:write"]}`
and reload with DevTools open.
3. Check that the warning sits above the disabled **Authorize** button
and the requested permissions are hidden. Clear any overrides when done.
2026-11-24 10:14:44 +11:00
Danny White 828bd84820 fix(studio): make OAuth project scope explicit (#53701)
## Problem

An unchecked box leaves users to figure out that access is limited to
selected projects.

## Solution

Show two explicit project scope options as a set of radio buttons. A new
grant starts with selected projects. Reauthorising an all-projects grant
still preselects all projects.

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-project-scope-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

| Before | After |
| --- | --- |
| <img width="880" height="1904" alt="CleanShot 2026-11-20 at 12 43
31@2x"
src="https://github.com/user-attachments/assets/87ed5f18-eebd-455e-a37a-9131fc9ac269"
/> | <img width="884" height="1948" alt="CleanShot 2026-11-20 at 12 43
45@2x"
src="https://github.com/user-attachments/assets/1ec03fb1-1208-496c-8ad0-1d5b6736c5da"
/> |

**What to check**

1. Open consent for a project-scoped staging test app in an organization
with projects.
2. Check that **All current and future projects** appears first and
**Selected projects only** is selected for a new grant.
4. Select a project, switch to all projects, then switch back. The
picker should reappear with your selection.
5. Repeat with an existing all-projects grant and check that the first
option is selected.
2026-11-24 10:14:13 +11:00
Danny White 1c85e3efb7 fix(studio): clarify OAuth permission labels (#53699)
## Problem

OAuth mixes abbreviated access levels with permission names whose
meaning is hard to infer.

## Solution

Use **Read and write** and **Read only** consistently, and add
keyboard-accessible definitions for Database management and Environment.
Reuse the dotted underline from Pipelines and document above-label
placement.

| Before | After |
| --- | --- |
| <img width="926" height="1936" alt="CleanShot 2026-11-20 at 12 20
42@2x"
src="https://github.com/user-attachments/assets/053b4afa-f428-4c0d-8f3b-dbc3f3dd5cf8"
/> | <img width="886" height="1902" alt="CleanShot 2026-11-20 at 12 21
20@2x"
src="https://github.com/user-attachments/assets/8277064b-1e73-43ff-b7b5-4d4af7d6c68f"
/> |
| _No tooltips, old “READ-WRITE”._ | _Tooltips for ambiguous
permissions, “READ AND WRITE” for clarity and to match setup
terminology._ |

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-permission-labels-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

**What to check**

1. Open consent for a test app that requests database read/write,
environment read, and projects read access.
2. Check the small **Read and write** and **Read only** headings. Hover
or Tab to Database management and Environment. Each definition should
appear above its dotted-underlined label.
3. Optionally open an existing Pipeline and hover over an annotated
status label to check the shared underline.
2026-11-24 10:13:36 +11:00
Gildas Garcia e6986b5296 feat(studio): OAuth apps consent screen should allow to select another org (#53744)
## Problem

The OAuth apps consent screen does not allow users to change the
selected org. If the calling app didn't provide the org slug, we select
the first available org from the users orgs.

## Solution

Add an organization selector:
<img width="436" height="570" alt="image"
src="https://github.com/user-attachments/assets/a5579f2c-ff54-4d02-9d4a-ac75ed245719"
/>

## Review instructions

Requirements:
- have multiple orgs
- have a published app that needs projects selection and at least one
authorization already granted
- have the oauth example app ready

Tests:
- authorizing the app again on the same org it was before should
preselect the projects
- you should be able to select another org and if you do, that should
clear the selected projects and you should see only this org projects in
the options
- reselecting the initially granted org should reselect the projects it
had in the existing grant
2026-11-20 18:16:48 +01:00
Gildas Garcia 4448134b3b fix(studio): OAuth apps consent screen permission diff may show an empty Already granted section (#53729)
## Problem

The OAuth apps consent screen may show an empty _Already granted_
section in the permissions diff
<img width="802" height="474" alt="image"
src="https://github.com/user-attachments/assets/f49bca9e-20da-4554-83dd-98b93b752a0a"
/>

## Solution

Hide it when empty

## Review instructions

- Publish an oauth app with only the _Database Read_ permission
- Use the oauth example to authorize it 
- Update the published app to add the _Database Write_ permission
- Use the oauth example to authorize it again

You shouldn't see an _Already granted_ button
2026-11-20 14:22:43 +01:00
Gildas Garcia 4442d91d77 feat(studio): Wire org and users authorized apps list to backend (#53674)
## Description

Part of the work for OAuth apps with the scoped permissions. This PR
wires the org and users authorized apps lists to backend.
2026-11-19 21:40:12 +01:00
Gildas Garcia 10488ed799 feat(studio): Wire the OAuth apps consent screen to the backend (#53511)
## Description

Part of the work for OAuth apps with the scoped permissions. This PR
wires consent screen to the backend.

## Review instructions

### Setup
Copy the `examples/oauth-app-authorization-flow/.env.example` to
`examples/oauth-app-authorization-flow/.env`

> [!IMPORTANT]  
> In next steps, make sure to copy the apps ids/secrets in the
`examples/oauth-app-authorization-flow/.env` with a way to differentiate
them:
> ```
> # org bound all projects
> SUPABASE_CLIENT_ID=xxx
> SUPABASE_CLIENT_SECRET=xxx
> ```

As an organization admin, go to the _Organization settings/OAuth Apps_
and create the following _Publishable apps_:

- `test_org_bound`: 
  - _Use the permissions of the person who connects_ unchecked
  - _Ask for specific projects_ unchecked
  - Select only _Database Read_ for the permissions
 
- `test_org_bound_projects`: 
  - _Use the permissions of the person who connects_ unchecked
  - _Ask for specific projects_ checked
  - Select only _Database Read_ for the permissions

- `test_member_bound`: 
  - _Use the permissions of the person who connects_ checked
  - _Ask for specific projects_ unchecked
  - Select only _Database Read/Write_ for the permissions
 
- `test_member_bound_projects`: 
  - _Use the permissions of the person who connects_ checked
  - _Ask for specific projects_ checked
  - Select only _Database Read/Write_ for the permissions

Make sure you have 3 projects in the org. Add a team member that have
Administration rights on the first project, read-only access to the 2nd
and no access to the third.

Install the `examples/oauth-app-authorization-flow` dependencies and
start the app.
- `test_org_bound`: 
  - connected on studio as the org admin
    - click the `oauth-app-authorization-flow` button
- check that you don't have to select a project on the consent screen
- check that the permissions requested are correct and you can approve
the app
- update the published app to include the _Database Write_ permissions
- return to the `oauth-app-authorization-flow` index and click its
button again
- check that the consent screen shows the permissions difference and
approve it again
- connected as a simple team member, check that you have a message
indicating you can't approve this app
  
- `test_org_bound_projects`: 
  - connected on studio as the org admin
    - click the `oauth-app-authorization-flow` button
    - check that you have to select projects on the consent screen
- check that the permissions requested are correct and you can approve
the app
- update the published app to include the _Database Write_ permissions
- return to the `oauth-app-authorization-flow` index and click its
button again
- check that the consent screen shows the permissions difference and
approve it again
- connected as a simple team member, check that you have a message
indicating you can't approve this app

- `test_member_bound`: 
  - connected on studio as a member 
    - click the `oauth-app-authorization-flow` button
- check that you don't have to select a project on the consent screen
- check that the permissions requested are correct and you can approve
the app
    - update the published app to add another permission
- return to the `oauth-app-authorization-flow` index and click its
button again
- check that the consent screen shows the permissions difference and
approve it again
   
- `test_member_bound_projects`: 
  - connected on studio as the org admin
    - click the `oauth-app-authorization-flow` button
- check that you have to select projects on the consent screen (you
should see only the two you have access to) and select them all one by
one
    - check that the permissions requested are correct
- approve the app and check that you have an error related to the
project with read-only access
    - unselect it and approve the app
- update the published app to include the _Database Write_ permissions
- return to the `oauth-app-authorization-flow` index and click its
button again
- check that the consent screen shows the permissions difference and
approve it again
2026-11-19 17:47:03 +01:00
Gildas Garcia 7b37f0c774 feat(studio): update oauth apps mocks and UI to the latest API payloads formats (#53363)
## Description

Part of the work for OAuth apps with the scoped permissions. This PR:
- Update the mock data to the new format returned or expected by the
backend
- Remove unnecessary hooks that have their feature merged in another one
(`useOAuthOrgAppDetailsQuery` is now merged in
`useOAuthAppsPreflightValidationQuery`)

> [!NOTE]  
> At this stage, the UI still only use mock data

## Review instructions

If all tests pass, we're good.
2026-11-18 13:38:19 +01:00
Gildas Garcia b58913895c feat(studio): Refactor OAuth app consent screen for project selection (#53361)
## Description

Part of the work for OAuth apps with the scoped permissions. This PR:
- Update `<MultiSelector>` to allow consumers to react to search terms
changes
- Refactor OAuth app consent screen to ensure we can load projects
asynchronously with an infinite list and server side filtering

> [!NOTE]  
> At this stage, the UI still only use mock data

## Review instructions

If all tests pass, we're good.
2026-11-18 13:16:31 +01:00
Gildas Garcia 45f4a115fa feat(studio): Refactor oauth app consent screen (#53357)
## Description

Part of the work for OAuth apps with the scoped permissions. This PR:
- refactors the authorize OAuth app consent screen to make it more
consistant with how we handle load requests
- remove the copy constants in favor of direct JSX like we do everywhere
- ensure the data hooks have optional parameters with runtime check to
be usable even when all needed data isn't loaded yet

> [!NOTE]  
> At this stage, the UI still only use mock data

## Review instructions

If all tests pass, we're good.
2026-11-17 16:58:49 +01:00
Gildas Garcia dde52ce6e8 feat(studio): update oauth publishable apps to include new options (#53355)
## Description

Part of the work for OAuth apps with the scoped permissions.
This PR updates the publishable apps UI to actually submit the new
options

> [!NOTE]  
> The backend may reject the API call if your organization isn't
enrolled in scoped oauth apps. That does not prevent to check the
payload is correct

## Review instructions

- Open _Organizations settings/OAuth Apps_
- Click the _Publish OAuth app_ button
- Check that both options in the _Authorization_ section require a
confirmation with a checkbox
- Before submitting, open your devtool
- Submit the app
- Check that the API route
`https://api.supabase.green/platform/organizations/[org_slug]/oauth/apps`
was called with the options you selected:
- if _Use the permissions of the person who connects_ was checked:
`grant_kind: "member_bound"`, otherwise `grant_kind:
"organization_bound"`
- If _Ask for specific projects_ was checked: `project_scoping_mode:
true` otherwise `project_scoping_mode: false`
2026-11-17 16:35:32 +01:00
Joshen Lim 6d08d66b7d Add eslint rule for google translate dynamic spans + address all issues (#52949)
## Context

We've been seeing many `NotFoundError: Failed to execute 'removeChild'
on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on
'Node'` events on Sentry which are historically known to be caused by
Google Translate in the browser.

There's technically no _right way_ to address this unfortunately, but
one of the solutions which should address most of these issues is to
wrap any dynamic text within a span - we've considered that quite a
while back tbh but never took the time to do this until today with the
help of Claude. Although just a heads up that it might not necessarily
completely eradicate those issues.

Also added an eslint rule which should prevent future occurences of this
<img width="1264" height="192" alt="image"
src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29"
/>
2026-11-05 23:28:46 +08:00
kemal.earth fa7e8b636a feat(studio): update flags for interstitals and apps list (#52955)
## Problem

The single `OauthAppScopedGrants` flag gates three independent areas of
scoped OAuth apps, so they can't be rolled out or rolled back
separately.

Resolves FE-4919

## Solution

Replace `OauthAppScopedGrants` with three flags, one per concern, and
remove the old one. Gating is a straight swap with no behavior changes.

| Flag | Files |
| --- | --- |
| `enableScopedOAuthConsent` | `pages/authorize.tsx` |
| `enableScopedOAuthPublish` | `PublishAppSidePanel/index.tsx` |
| `enableScopedOAuthManage` | `OAuthApps.tsx`, `pages/account/apps.tsx`,
`AccountLayout.tsx` |

The `authorize` page test now mocks only the consent flag.

Note: `PublishableApps` (the org apps list) isn't gated today, so Manage
covers only the authorized-apps table and the account page. I left that
as is to keep this a pure flag swap.

## Review instructions

Each flag can be toggled on its own.

1. Consent only: `/authorize?mock_scenario=default` shows the new
consent screen. The app form and list pages are unchanged.
2. Publish only: `/org/[slug]/apps`, then publish or edit an app. The
extra controls appear and nothing else changes.
3. Manage only: `/org/[slug]/apps` shows the new authorized-apps table,
and `/account/apps` renders. `/authorize` uses the legacy screen.
4. All off: behavior matches `master`.

Before merging, the three new flags must exist in ConfigCat with the
same targeting that `OauthAppScopedGrants` has today.
2026-11-05 11:34:43 +00:00
Joshen Lim 60b51d74d5 Audit existing unit tests + Remove redundant ones (#52215)
## Context

_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_

We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.

## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail 
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files 
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
2026-10-23 18:51:27 +08:00
fffb1e23ca feat: implement profile permissions v2 api (#50966)
## Problem

Migrating Studio's permission checks from the old RLS json logic to
openfga backed permissions.

### New hooks and helpers

- `usePermissionsQueryV2` fetches the new profile openfga permisisons 
- `useAsyncCheckPermissionsV2` the replacement for the old check hook;
takes an FGA permission string (or a list)
- `FGA_PERMISSIONS` permission constants derived from
`@supabase/shared-types`. At the moment, the hook also accepts plain
strings for permissions not yet published in the package
- `useAsyncCheckUserContentPermissions` new hook for permission checks
on user content (SQL snippets, reports, log snippets). This wraps
``useAsyncCheckPermissionsV2` and adds existing content level rules on
top of the fga permission check

### Notes

- ~~Need api to support new permissions: project_operations_write,
billing_read/write, audit_logs_read~~ [DONE]
- ~~Still need to support: organization_config_read/write, auth hooks
and users permissions~~ [DONE]

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2026-10-21 06:54:16 -04:00
f2876c7787 chore(studio): upgrade the TanStack dependency set (#51067)
TanStack Start 1.169 is the stable release. This moves the shared
catalog to Start 1.169.2 and Router 1.170.44, the newest matching pair
that clears the 72-hour release-age gate, and updates Studio React Query
and its devtools to 5.104.3. The ui-library TanStack auth blocks switch
to `.validator()` because Start 1.169 removes `.inputValidator()`.

**Changed:**

- `pnpm-workspace.yaml` – `@tanstack/react-router` `^1.170.44` and
`@tanstack/react-start` `^1.169.2`, so Router, Start, router-core, and
the Start plugin install as one set
- `pnpm-lock.yaml` – react-router 1.170.44, react-start 1.169.2,
router-core 1.171.37, router-plugin 1.168.46, start-plugin-core
1.171.53, history 1.162.5, and Studio React Query 5.104.3
- `apps/studio/package.json` – `@tanstack/react-query` and
`@tanstack/react-query-devtools` `~5.104.3`,
`@tanstack/react-router-devtools` `^1.167.2`
-
`apps/ui-library/registry/default/blocks/password-based-auth-tanstack/routes/auth/confirm.ts`
– `createServerFn` uses `.validator()`
-
`apps/ui-library/registry/default/blocks/social-auth-tanstack/routes/auth/oauth.ts`
– `createServerFn` uses `.validator()`
- `apps/ui-library/tests/sign-up-redirect.test.tsx` – the
server-function mock follows the `validator` chain
- `apps/ui-library/public/r/password-based-auth-tanstack.json` –
registry JSON regenerated from the block
- `apps/ui-library/public/r/social-auth-tanstack.json` – registry JSON
regenerated from the block
- `apps/ui-library/content/docs/tanstack/password-based-auth.mdx` – note
that the block requires `@tanstack/react-start` 1.168.25 or later, since
`.validator()` is missing from earlier Start versions
- `apps/ui-library/content/docs/tanstack/social-auth.mdx` – note that
the block requires `@tanstack/react-start` 1.168.25 or later, since
`.validator()` is missing from earlier Start versions
- `apps/studio/server.ts` – correct the header comment:
`wrapFetchWithSentry` only adds a span, trace meta tags, and a flush,
and request errors are captured by the Sentry middleware in `start.ts`

**Removed:**

- `minimumReleaseAgeExclude` pins for:
  - `@tanstack/react-router@1.170.41`
  - `@tanstack/react-start-client@1.168.39`
  - `@tanstack/react-start-rsc@0.1.59`
  - `@tanstack/react-start-server@1.167.46`
  - `@tanstack/react-start@1.168.60`
  - `@tanstack/react-store@0.11.2`
  - `@tanstack/router-core@1.171.34`
  - `@tanstack/router-generator@1.167.40`
  - `@tanstack/router-plugin@1.168.42`
  - `@tanstack/start-client-core@1.170.34`
  - `@tanstack/start-plugin-core@1.171.49`
  - `@tanstack/start-server-core@1.169.39`
  - `@tanstack/start-storage-context@1.167.36`
  - `@tanstack/store@0.11.2`

## To test

- TanStack Studio, open a project home – the shell loads with no router
error
- TanStack Studio, open a table, switch schema, then Back and Forward –
the table id follows history, and Forward returns to the later table
- TanStack Studio, run a query in the SQL Editor – results render
- TanStack Studio, open Project Settings – the general settings page
renders
- Next Studio, repeat home, Table Editor, SQL Editor, and Settings – the
same pages render
- ui-library TanStack password and social auth blocks, follow a sign-up
confirm and OAuth confirm link – the server function accepts the search
params through `.validator()` and redirects

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-19 21:00:40 +02:00
Gildas Garcia 09a4374b14 Fix: ensure the scoped oauth apps new UI doesn't show if mocks are enabled (#51829)
## Problem

The feature flag enabling the new scoped oauth apps UI was enabled by
mistake in production but this UI currently only work with mocks. We
added an environment check in some places but not all so users did see
the new UI

## Solution

Add the environment check wherever needed
2026-10-16 11:55:02 +02:00
Joshen Lim 09a1f431bc Mass update for all lucide icon imports to use the component with Icon suffix (#51659)
## Context

This is largely just a mechanical change here:
Opting to use lucide icons with the `Icon` suffix across all icon
imports within `studio`
- so that it’s clearer which components are icons + reduces the
possibility of name collision with our own components
- e.g <User /> vs <UserIcon />

Also added a eslint rule for this:
<img width="1069" height="167" alt="image"
src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc"
/>

And updated `AGENTS.md` as such:
```
Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced).
```
2026-10-14 12:56:55 +02:00
Gildas GarciaandJoshen Lim 4bf7b16473 feat(studio): scoped oauth apps reconsent UI (#51078)
## Problem

When users must grant access to an app they already added because its
scopes changed, they should have a clear understanding of the changes

## Solution

Show only the scopes differences by default

<img width="844" height="962" alt="image"
src="https://github.com/user-attachments/assets/6289f4cf-200f-4660-b9a1-aedbaaa963e3"
/>

## Review instructions

Try this UI with
[`authorize?mock_scenario=reconsent`](https://studio-staging-git-gildasgarcia-oauth-apps-inte-6106b6-supabase.vercel.app/dashboard/authorize?mock_scenario=reconsent)

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-10-13 17:25:50 +02:00
kemal.earthandGildas Garcia 64a6aa9085 feat(studio): ui for oauth app create edit form (#51023)
## Problem

Extends the create and edit form for OAuth apps. Adds two toggles and
their connections.

## How to test

In _Organization Settings \ OAuth Apps_

### New app

- You should be able to create an app without toggling any of the two
new options
- Toggling any of the two new option should require a confirmation that
blocks the form submition until checked

### Existing app

**The default values for existing apps are hard coded for now**
- You should be able to update any of the app props except the _Use the
permissions of the person who connects_ option which should be disabled.
- Toggling the _Ask for specific projects_ option should require a
confirmation that blocks the form submition until checked

---------

Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-10-13 11:25:19 +02:00
Gildas GarciaandJoshen Lim 88bc1ac384 feat(studio): oauth apps users own grant list in account settings (#50903)
## Purpose

Users now have an _apps_ page in their account settings allowing them to
see their own grants, the projects they affect and to disconnect an app.

This PR only uses mock data. Besides, the page and menu item are behind
a feature flag enabled on staging

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

- In _Account/OAuth Apps_, you should see a list of apps
<img width="748" height="359" alt="image"
src="https://github.com/user-attachments/assets/8c50a467-e2c1-4000-aecf-09d5db1591d3"
/>
- Each app should have a menu entry allowing to disconnect it (fake for
now)
<img width="587" height="278" alt="image"
src="https://github.com/user-attachments/assets/6221fbd6-3b61-4d93-903e-9aedaf94de3f"
/>
- Each app but the last should have a menu entry that opens a dialog to
see the connected projects
<img width="657" height="651" alt="image"
src="https://github.com/user-attachments/assets/e985f933-fdfb-4d28-93c3-b3678d7d8a53"
/>

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-10-12 10:15:33 +02:00
4f23e91174 feat(studio): scoped oauth apps, admins can revoke an app (#50980)
## Problem

Admins should be able to revoke an OAuth app that uses scoped tokens.

## Solution

## Solution

- Add a menu to the org settings oauth approved apps rows to revoke the
app

<img width="1164" height="342" alt="image"
src="https://github.com/user-attachments/assets/1323318a-7c68-436e-ae77-0c79d763e4cc"
/>


<img width="441" height="350" alt="image"
src="https://github.com/user-attachments/assets/dd5cf88e-184a-4edb-a240-340bd2f58727"
/>

## Review instructions

In Org Settings/OAuth apps, you should see a menu button for each app
that contains a _Revoke_ item. Clicking this item should open a dialog
to revoke the app.
Notice how the focus is back on the dropdown trigger button when the
dialog is closed (canceled or success)

---------

Co-authored-by: kemal <hello@kemal.earth>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-10-09 11:30:52 +02:00
690ef5e7f7 feat(studio): scoped oauth apps, admins can see an app grants (#50979)
## Problem

Admins need to see the grants associated to an approved OAuth
application that uses scoped tokens.

## Solution

- Add a menu to the org settings oauth approved apps rows to see the
grant list
- Update the react query hook to use infinite query for the grant list

<img width="1149" height="356" alt="image"
src="https://github.com/user-attachments/assets/2e6cfc76-5584-4447-aa19-a0bf103e2218"
/>

<img width="429" height="395" alt="image"
src="https://github.com/user-attachments/assets/dd811d33-2c0a-46df-b9e9-3cbf8ad2fa7f"
/>

<img width="434" height="267" alt="image"
src="https://github.com/user-attachments/assets/108905ba-4dcb-4dca-abe2-1a4e1fc3dbd2"
/>

## Review instructions

In Org Settings/OAuth apps, you should see a menu button for each app
that contains a _View grants_ item. Clicking this item should open a
dialog with the grants

---------

Co-authored-by: kemal <hello@kemal.earth>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-08 15:48:51 +02:00
12ab771e86 feat(studio): authorized apps table in org settings (#50529)
<img width="1150" height="669" alt="image"
src="https://github.com/user-attachments/assets/0b324577-bed5-4272-a7e0-f4444a0c1230"
/>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-10-08 11:25:07 +02:00
454a232947 feat(studio): scoped oauth interstitial ui (#50090)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

The scoped OAuth consent interstitial: scope display, org/project
selection,
consent screen assembly, success screen, and post-submit role-validation
error state. Consolidates the former stacked PRs #49481, #49484, #49486,
#49489, #49951 into one reviewable unit (each contained the last; no
code
was dropped).

- Entirely behind `useFlag('oauthAppScopedGrants')` — no reachable UI
with
  the flag off.
- Runs on the mock data layer from #49476 (`USE_MOCKS`-gated); no real
  endpoints are called.
- Covers PROD-626, PROD-627, PROD-628, PROD-629, PROD-653.

Base is #49476 (data contracts + mocks); will retarget to master once it
merges.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
2026-10-07 10:56:24 +02:00
Danny White ec53175b8a refactor(ui): rename text-brand to text-primary (#50564)
## What kind of change does this PR introduce?

Refactor. Follow-up to #49871.

## What is the current behavior?

Branded (green) text still uses the `text-brand` classname while the
colour comes from `--primary`.

## What is the new behavior?

**Rename-only:** `text-brand` → `text-primary` across callsites and
docs. Leftover `bg-brand` / `border-brand` alias to `brand-default`. No
intentional colour changes in this PR.

This better matches how we treat our green in other components and
props, like `variant="primary"` for green buttons.

## To test

On light mode: smoke-test that branded text still looks like #49871
(readable green, not the bright fill).

-
[Homepage](https://zone-www-dot-com-git-dnywh-depr-316-text-brand-de2380-supabase.vercel.app/):
“Scale to millions” uses `text-primary`
- [Docs
homepage](https://docs-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/docs):
branded links like “More on self-hosting” are still readable
- [Typography
docs](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/typography):
documents `text-primary`
- [Colour
usage](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/color-usage):
`text-primary` is visibly darker than `bg-brand-default` _on light mode_
- [Studio auth
providers](https://studio-staging-git-dnywh-depr-316-text-brand-to-60fa6c-supabase.vercel.app/dashboard/project/_/auth/providers):
enabled provider badge text readable; status dot stays bright green

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Style**
* Updated branded text, link hover states, icons, badges, indicators,
and highlighted content across the Design System, Docs, Studio, Learn,
UI Library, and marketing experiences to use the primary theme color.
* Updated syntax highlighting and table-of-contents styling for
consistent primary-color presentation.
  * Refined brand color fallback behavior for bright fills and borders.

* **Documentation**
* Updated color-usage and typography guidance to recommend the primary
text utility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-22 16:19:03 +10:00
Danny White 476d4a5851 refactor(ui): drop redundant Button variant="default" props (#50161)
## What kind of change does this PR introduce?

Mechanical cleanup on top of the Button default-variant change (#50160).

## What is the current behavior?

Many callsites still pass `variant="default"` even though that is now
the component default.

## What is the new behavior?

Removes redundant static `variant="default"` from legacy `Button` and
`ButtonTooltip` callsites. Keeps explicit defaults where they document
the API:

- `button-default.tsx` and `button-sizes.tsx` demos
- `DocsButton`, which pins neutral styling at the wrapper boundary

## To test

Studio:

- [Auth → Rate
Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits):
dirty the form so Cancel appears; Cancel stays neutral, Save stays green
- [Project Settings → API
Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys):
`DocsButton` in the header actions stays neutral

Design system:

- [Design system →
Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button):
`button-default` / `button-sizes` still show explicit default styling;
Primary (green) is restricted to the Primary section (and `asChild`)

WWW:

- [www → Brand
assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets):
Download logo kit / Download button kit stay neutral
2026-09-11 17:05:26 +10:00
Danny White 1131e3e2ce fix(ui): default Button variant to default instead of primary (#50160)
## What kind of change does this PR introduce?

Bug fix / design-system alignment for the legacy `Button` from `ui`.

## What is the current behavior?

Omitting `variant` on the legacy `Button` falls back to brand-green
`primary`. That makes accidental greens easy, and it is hard to spot the
real main action on busy pages.

## What is the new behavior?

- Legacy `Button` now defaults to neutral `default`
- Intentional primary CTAs (create, save, submit, marketing CTAs, and
matching `ButtonTooltip` usages) now set `variant="primary"` so their
appearance is unchanged
- Neutral actions that previously relied on the old fallback (cancel,
close, back, dashboard nav, and similar) become grey/white
- Design-system docs updated; regression tests cover the new default

`Button_Shadcn_` is unchanged. It already uses its own CVA default.

This is PR 1 of 2 in a stack. PR 2 drops now-redundant
`variant="default"` props.

## To test

Studio (http://localhost:8082):

- `/sign-in`: Sign in stays green
- Open a project → Database → Tables: New table stays green
- Auth → Users → Invite: Invite user stays green; Cancel / dismiss
controls stay neutral
- Project Settings → General: edit a field so Cancel and Save appear.
Cancel is neutral, Save is green

Design system (http://localhost:3003):

- Components → Button: default demo is neutral; primary demo is green;
featured preview is the default variant

Marketing (optional):

- www header: Start your project stays green; logged-in Dashboard is
neutral

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Style**
- Buttons now default to a neutral style, while primary actions across
Studio, documentation, marketing pages, forms, dialogs, and error states
use prominent primary styling.
- Updated button examples and previews clarify the distinction between
default and primary variants.
  - Event registration now includes a directional arrow icon.

- **Tests**
- Added coverage confirming default button styling and explicit primary
styling behave as expected.
- Updated related test fixtures to use primary styling where
appropriate.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-10 11:23:17 +10:00
Gildas Garcia 95ca302439 OAuth Apps Scoped Grants: refactor to ease future implementation (#49958)
## Problem

We're working on OAuth Apps Scoped Grants and want to display an
alternative UI for Authorized apps depending on a feature flag. However,
the `/apps` page currently contains the code of both the _Publishable
apps_ and _Authorized apps_ sections.

## Solution

No functional nor design changes.

- Extract both sections into their own components to ease the
introduction of the alternative UI
- Improve a11y

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added separate views for managing publishable and authorized OAuth
applications.
- Users can publish, update, and delete applications, with convenient
credential-copy controls.
- Authorized applications can be sorted and revoked through a
confirmation dialog.

- **User Experience**
- Added clear loading, empty, error, and permission-denied states for
OAuth application lists.
  - Improved organization settings layout for OAuth app management.
- Added consistent sorting behavior when selecting and toggling table
columns.
- Improved accessibility for credential notifications and dismissal
controls.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-03 16:09:15 +02:00
2bc6144aec fix(studio): guard unguarded requester.name reads on the OAuth authorize and apps pages (#49267)
<!-- ccr-slack-attribution -->
_Requested by **Ali Waseem** · [Slack
thread](https://supabase.slack.com/archives/C063LNYJJKS/p1787146439389169)_

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

Opening `/authorize` for an OAuth app whose `name` the platform API
omitted crashed the entire page with `TypeError: Cannot read properties
of undefined (reading 'toLowerCase')`
([SUPABASE-APP-K7E](https://supabase.sentry.io/issues/7679644991/)). The
user got a full-page error instead of a consent screen, and could
neither authorize nor decline.

The same class of crash hit the project-level OAuth apps list
([SUPABASE-APP-JB1](https://supabase.sentry.io/issues/7502074939/)).
Typing in the search box called `.toLowerCase()` on `client_name` for
every app, so one app registered without a name broke search for the
whole list.

The project-claim page crashed the same way, reading the first character
of the name for the fallback avatar.

## What is the new behavior?

The trusted-partner helpers treat a missing name as "no trusted partner
matched" and return `null`. The apps filter treats a missing name or
client ID as "does not match the search string". The claim page falls
back to a placeholder initial instead of indexing into `undefined`.

The authorize page now renders normally, minus the optional
partner-impersonation caution, which cannot be evaluated without a name.

Three changes:

-
`apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.utils.ts`
— `findTrustedPartnerByName` accepts `string | null | undefined` and
returns `null` early on a falsy name; `getOAuthImpersonationWarning`'s
`name` param widened to match (its existing `if (!namedPartner) return
null` already handles the rest).
- `apps/studio/components/interfaces/Auth/OAuthApps/oauthApps.utils.ts`
— `filterOAuthApps` optional-chains `client_name` and `client_id` before
`.toLowerCase()`, defaulting each match to `false`.
-
`apps/studio/components/interfaces/Organization/ProjectClaim/confirm.tsx`
— `{requester.name?.[0] ?? '?'}` for the fallback avatar initial.

Each is a separate commit so any one can be dropped independently.

## Additional context

### Root cause, not fixed here

`apps/studio/data/api-authorization/api-authorization-query.ts:37`
returns `data as ApiAuthorizationResponse`, an unchecked cast with no
runtime validation, even though the openapi-fetch client already types
the endpoint from the generated schema. Both the generated
`GetOAuthAuthorizationResponse` and the hand-written local type declare
`name: string` as required, so this was invisible to TypeScript.

The durable fix is to derive the type from the schema and drop the cast,
which is the house pattern elsewhere in `apps/studio/data`, and to
correct the OpenAPI spec at source if the API can legitimately omit
`name`. Left out deliberately to keep this cherry-pickable.

### Not in scope

`requester.scopes` is optional in the schema but required in the local
type, and is read unguarded in several places. Defaulting it to `[]`
would tell a user an app requested no permissions on a live consent
screen, so it needs a product decision rather than a drive-by guard.

### Testing

No local checks were run. This clone has no `node_modules` and `pnpm
install` is blocked in the environment, so `npm run build`, typecheck,
lint, Prettier and tests were all left to CI. Please treat CI as the
verification for this PR.

There is also a coverage gap worth noting:
`apps/studio/tests/components/ApiAuthorization.test.tsx:48-62` hardcodes
`name: 'Test App'` in `createMockAuthResponse`, and no test omits the
field, which is why none of these crashes were caught.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01P489vrPdHcJfMfzCGM9rZ5)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-08-19 14:23:54 -06:00
Danny White f7454cf94e feat(studio): oauth impersonation warning on authorize (#48162)
## What kind of change does this PR introduce?

Feature + docs. Stacked on #48161 (logo contract /
[DEPR-604](https://linear.app/supabase/issue/DEPR-604/define-connect-logo-asset-and-variant-contract)).

## What is the current behavior?

After #48161, curated logos only resolve from allowlisted `redirect_uri`
hosts. A requester can still present a trusted partner **name** (e.g.
Claude) while redirecting to an unrelated remote host; the UI shows
Supabase alone but does not call out the mismatch.

## What is the new behavior?

- Shows a caution admonition when the requester name looks like a
trusted partner (Claude, Cursor, ChatGPT/OpenAI, Perplexity) but
`redirect_uri` is a **remote** host outside that partner's allowlist.
- Skips localhost / loopback redirects for the caution (common for local
MCP clients); those still get curated logos when the name matches a
trusted partner.
- Highlights the footer redirect URL in warning colour when the caution
is shown.
- Documents the behaviour in the Connect interstitials pattern.

### To test

Real MCP clients (Claude, Cursor, etc.) only send users to
**production** `/authorize`, so you cannot drive a local or preview
Studio build from those tools. Use a Network override instead:

1. Start Studio and sign in (`pnpm dev:studio`, or use the [Vercel
preview](https://studio-staging-git-danny-oauth-impersonation-warning-supabase.vercel.app/)).
2. Open `/dashboard/authorize?auth_id=foo` (any `auth_id` is fine; the
real response may 404) ([Vercel
preview](https://studio-staging-git-danny-oauth-impersonation-warning-supabase.vercel.app/dashboard/authorize?auth_id=foo)).
3. DevTools → **Network** → find `GET
…/platform/oauth/authorizations/foo` (or whatever id you used).
4. Right-click → **Override content** (enable Local Overrides / pick a
folder if prompted).
5. Paste one of the payloads below (status **200**), save, then reload
the authorize page.
6. Keep `expires_at` in the future so the request does not look expired.

#### Impersonation caution (trusted name + remote non-allowlisted
redirect)

Expect:

- Supabase alone (no curated Claude mark)
- Caution: “Redirect does not match this app name”
- Footer redirect URL in warning colour

```json
{
  "name": "Claude",
  "website": "https://claude.ai",
  "icon": null,
  "domain": "claude.ai",
  "redirect_uri": "https://evil.com/callback",
  "expires_at": "2099-01-01T00:00:00.000Z",
  "scopes": ["organizations:read", "projects:read"],
  "approved_at": null,
  "registration_type": "dynamic"
}
```

| Preview |
| --- |
| <img width="764" height="958" alt="Authorize Claude Supabase"
src="https://github.com/user-attachments/assets/e6eee016-5710-41ba-9925-87511e009e22"
/> |

#### Localhost MCP: no caution

Expect curated Claude + Supabase pair (name match + loopback), **no**
caution, normal footer colour. Local MCP clients often use loopback
redirects.

```json
{
  "name": "Claude",
  "website": "https://claude.ai",
  "icon": null,
  "domain": "claude.ai",
  "redirect_uri": "http://127.0.0.1:42813/callback",
  "expires_at": "2099-01-01T00:00:00.000Z",
  "scopes": ["organizations:read", "projects:read"],
  "approved_at": null,
  "registration_type": "dynamic"
}
```

| Preview |
| --- |
| <img width="764" height="958" alt="Authorize Claude Supabase"
src="https://github.com/user-attachments/assets/79f36865-3c8e-43e5-9490-24288efc74aa"
/> |

#### Legitimate curated partner: no caution

Expect curated Cursor + Supabase pair, no admonition, normal footer
colour.

```json
{
  "name": "Cursor",
  "website": "https://cursor.com",
  "icon": null,
  "domain": "cursor.com",
  "redirect_uri": "https://cursor.com/callback",
  "expires_at": "2099-01-01T00:00:00.000Z",
  "scopes": ["organizations:read", "projects:read"],
  "approved_at": null,
  "registration_type": "dynamic"
}
```

| Preview |
| --- |
| <img width="764" height="958" alt="56164"
src="https://github.com/user-attachments/assets/412333a3-a74f-42eb-9f63-d56b6a26bf91"
/> |

#### Unrelated name + remote redirect: no caution

Expect Supabase alone (no icon), no admonition.

```json
{
  "name": "Acme Tools",
  "website": "https://evil.com",
  "icon": null,
  "domain": "evil.com",
  "redirect_uri": "https://evil.com/callback",
  "expires_at": "2099-01-01T00:00:00.000Z",
  "scopes": ["organizations:read", "projects:read"],
  "approved_at": null,
  "registration_type": "dynamic"
}
```

| Preview |
| --- |
| <img width="764" height="958" alt="Authorize Acme Tools Supabase"
src="https://github.com/user-attachments/assets/dab24817-5c26-4aa1-a447-796c4af5868b"
/> |

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Added an OAuth caution when a requester name matches a known partner
but uses an unapproved remote redirect host.
- Improved trusted partner logo selection for localhost/loopback
redirects while preserving safe fallbacks for untrusted redirects.

- **Documentation**
- Updated Connect interstitial guidance for redirect mismatches and
localhost/loopback behavior.

- **Tests**
- Expanded coverage for caution visibility, messaging, localhost logo
pairing, and trusted redirect scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-02 23:57:27 +00:00
Alaister YoungandAlaister Young ca2b50a0a7 chore(ui-patterns): collapse the admonition shim into ui-patterns/Admonition (#48377)
Follow-up to #48344: collapses the two resolution paths for the
Admonition module into one.

`src/admonition.tsx` was a back-compat shim re-exporting
`src/Admonition/`. Two ways to resolve one module is exactly what
produced the macOS self-import bug fixed in #48344, and the local
typecheck errors that #48374 worked around. This removes the shim and
standardizes on the PascalCase subpath, matching every other export in
the package.

**Changed:**

- Codemodded all 246 `ui-patterns/admonition` imports to
`ui-patterns/Admonition` (240 `.tsx`, 5 `.mdx`, 1 `.ts` across studio,
docs, www, design-system, and lite-studio)
- Pointed the 5 internal `'../admonition'` imports back at the
`'../Admonition'` directory

**Removed:**

- `packages/ui-patterns/src/admonition.tsx`, and its `./admonition`
entry in the exports map (regenerated with `pnpm gen:exports`)

## To test

- `grep -r "ui-patterns/admonition" --include='*.ts*'` → no hits
- `pnpm test:case-hazards` → passes
- `pnpm typecheck` → all 15 tasks green
- `pnpm --filter studio run lint:ratchet` → passes
- `pnpm --filter ui-patterns vitest run src/Admonition` → 11 tests pass

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Standardized Admonition component imports across the application and
documentation.
* Improved compatibility with case-sensitive environments by using the
canonical component path.
  * Removed the legacy Admonition import entry point.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-07-29 00:48:56 +08:00