mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
cli/ref-doc
111
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
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" /> |
||
|
|
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 |
||
|
|
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. |
||
|
|
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. |
||
|
|
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> |
||
|
|
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> |
||
|
|
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 |
||
|
|
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" /> |
||
|
|
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. |
||
|
|
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> |
||
|
|
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. |
||
|
|
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) |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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 |
||
|
|
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 |
||
|
|
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. |
||
|
|
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
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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` |
||
|
|
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" /> |
||
|
|
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. |
||
|
|
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
|
||
|
|
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> |
||
|
|
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> |
||
|
|
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 |
||
|
|
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). ``` |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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 --> |
||
|
|
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 |
||
|
|
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 --> |
||
|
|
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 --> |
||
|
|
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> |
||
|
|
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 --> |
||
|
|
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> |
||
|
|
e4f75bf74c | chore(studio): update copywriting on integrations pages (#48197) | ||
|
|
e19cd1863d |
feat(studio): connect logo contract for authorize (#48161)
## What kind of change does this PR introduce? Feature + docs. Closes [DEPR-604](https://linear.app/supabase/issue/DEPR-604/define-connect-logo-asset-and-variant-contract). ## What is the current behavior? `/authorize` logo resolution trusted self-asserted requester `name` (and similar) for curated MCP marks, fell back to a letter tile when there was no usable icon, and always used theme-reactive tile chrome. This includes the scenario when pairing against unclassified uploaded OAuth app bitmaps. ## What is the new behavior? - [Documents the Connect logo asset/variant contract](https://design-system-git-danny-depr-604-connect-logo-contract-supabase.vercel.app/design-system/docs/ui-patterns/connect-interstitials#logos) (default to light, keep pairs matched, no theme-recolour of vendor SVGs). - Resolves curated partner logos from allowlisted `redirect_uri` hosts only (`claude.ai` / `anthropic.com`, `cursor.com` / `cursor.sh`, `chatgpt.com` / `openai.com`, `perplexity.ai`). - Unknown / missing / failed requester icons show `SupabaseLogo` alone (no letter tile). - Uploaded organisation OAuth app icons (unclassified bitmaps) pair with fixed light tile chrome (`border-black/10 bg-white` / `SupabaseLogo forceLight`) on both sides across Studio themes. - Curated partners keep theme-reactive tiles and may use dark assets when available. ### 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 once available). 2. Open `/dashboard/authorize?auth_id=foo` (any `auth_id` is fine — the real response may 404). 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. The fields that matter for this PR are `name`, `icon`, and `redirect_uri`. #### Curated pair (allowlisted redirect) Expect Cursor mark + Supabase pair. Toggle light/dark: curated dark assets may swap; tiles stay theme-reactive (`bg-surface-75`). ```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" } ``` #### Unknown → Supabase alone Expect Supabase bolt alone. No letter tile. No curated mark even if `name` says Claude. ```json { "name": "Acme", "website": "https://acme.example", "icon": null, "domain": "acme.example", "redirect_uri": "https://acme.example/callback", "expires_at": "2099-01-01T00:00:00.000Z", "scopes": ["organizations:read", "projects:read"], "approved_at": null, "registration_type": "dynamic" } ``` #### Spoofed trusted name, non-allowlisted redirect (logo only) Expect Supabase alone (no Claude mark). This PR does **not** show the impersonation caution (that is coming in #48162). ```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" } ``` #### Uploaded OAuth app icon → forced-light pair Expect remote icon + Supabase pair with forced-light tiles (`border-black/10 bg-white`) on both sides in light and dark Studio themes. The icon URL below is the checked-in solid-colour Acme bitmap on this branch. ```json { "name": "Acme", "website": "https://acme.example", "icon": "https://raw.githubusercontent.com/supabase/supabase/danny/depr-604-connect-logo-contract/apps/design-system/public/img/icons/acme-oauth-icon.png", "domain": "acme.example", "redirect_uri": "https://acme.example/callback", "expires_at": "2099-01-01T00:00:00.000Z", "scopes": ["organizations:read", "projects:read"], "approved_at": null, "registration_type": "static" } ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved authorization interstitial branding with trusted requester logos and safer fallback behavior. * Added support for consistent light-theme treatment of uploaded OAuth app icons. * Added examples and documentation for unknown requesters, uploaded logos, and wrong-account states. * **Bug Fixes** * Prevented unverified or unavailable requester icons from being presented as trusted. * Ensured logo pairing remains visually consistent across light and dark themes. * **Tests** * Added coverage for trusted-host validation, fallback branding, icon loading failures, and theme behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
9f5e75183c |
chore(studio): add bullet-point to integration uninstall modal (#48139)
## What is the current behavior? <img width="533" height="394" alt="Screenshot 2026-07-21 at 11 55 05" src="https://github.com/user-attachments/assets/4e5e8fde-5823-4ad2-849e-abad90bfa72a" /> ## What is the new behavior? <img width="501" height="430" alt="Screenshot 2026-07-21 at 12 43 17" src="https://github.com/user-attachments/assets/2888d815-8c2c-47db-a058-dc60b208d6b1" /> ## Additional context Also fixed font-weight for strong text in studio to be `font-bold`. |
||
|
|
b30db91d71 |
chore: cleanup UI patterns exports (#47406)
## Problem We now export components under a subpath in ui-patterns to avoid barrel files as they slow down every tools (from IDE to linters, etc.) and may also affect bundles our users have to download. ## Solution - Remove the UI patterns index file - Fix invalid impors |
||
|
|
c6fc456910 |
chore: cleanup duplicate exports studio (#47387)
## Problem Knip reports many duplicate exports (both named and default). Besides, we're moving away from default exports and even have an eslint rule to enforce it on new code. ## Solution - Cleanup those exports - Update imports when necessary No functional changes. If it builds, it's fine |