mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
create-pull-request/patch
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0b9e4f6ab1 |
fix(studio): clarify token access settings and SSL prerequisites (#54507)
## Problem - Token access confirmations use stilted copy. - The SSL prerequisite notice sits outside the Token access card, repeats “enabled”, and includes an unnecessary project reference. - SSL configuration also shows enforcement as off when the latest update failed, and its dependency tooltip needs clearer guidance. ## Solution - Rewrite the token access and SSL confirmations, keeping the connection warnings. - Group prerequisite notices inside the Token access card with one divider, remove the project reference, and simplify their descriptions. - Keep the SSL switch tied to the fetched configuration independently of update success. - Explain the token access dependency in the disabled switch’s tooltip: “Database token access requires SSL enforcement.” Leave the existing SSL failure warning unchanged apart from its final full stop. | Before | After | | --- | --- | | <img width="727" height="501" alt="CleanShot 2026-12-03 at 11 21 35" src="https://github.com/user-attachments/assets/9fd18a91-528a-47dd-82e8-7349e26a8daa" /> | <img width="736" height="506" alt="CleanShot 2026-12-03 at 12 05 57" src="https://github.com/user-attachments/assets/8263303a-49d8-4910-9c88-e2fe5ecc1c34" /> | | <img width="362" height="236" alt="CleanShot 2026-12-03 at 11 21 54" src="https://github.com/user-attachments/assets/026852d4-9c1b-4a9d-9833-02e047794199" /> | <img width="421" height="229" alt="CleanShot 2026-12-03 at 12 06 24" src="https://github.com/user-attachments/assets/9a53c459-c7ca-4c18-8567-499d67a9c068" /> | | <img width="420" height="206" alt="CleanShot 2026-12-03 at 11 22 36" src="https://github.com/user-attachments/assets/4d2f8711-fd75-4730-832f-ac9e2e3d85ad" /> | <img width="420" height="207" alt="CleanShot 2026-12-03 at 11 52 51" src="https://github.com/user-attachments/assets/2fce238e-c8d7-4087-8402-05c2122f92f0" /> | | <img width="420" height="208" alt="CleanShot 2026-12-03 at 11 32 11" src="https://github.com/user-attachments/assets/f081e782-0a6c-499a-947d-0da149311218" /> | <img width="417" height="219" alt="CleanShot 2026-12-03 at 11 52 05" src="https://github.com/user-attachments/assets/6b6cfcf5-2c54-4f38-9b16-bcc0cdd500a0" /> | | <img width="809" height="255" alt="CleanShot 2026-12-03 at 12 28 47" src="https://github.com/user-attachments/assets/19cffa41-691f-4f60-96b5-7ba1ebcfb78e" /> | <img width="804" height="246" alt="CleanShot 2026-12-03 at 12 44 39" src="https://github.com/user-attachments/assets/2c3f2b74-21a8-41e7-b25e-ea2293350fcc" /> | ## Review instructions 1. Open Project → Database → Settings in the preview for a project that requires SSL enforcement before token access. 2. Check that SSL enforcement required sits inside Token access, separated by one divider, with no project reference in its description. 3. Select Enable SSL enforcement and review the confirmation copy. Cancel without applying the change. 4. On a project where token access is available, toggle it on and off to review both confirmations. Cancel each dialog. 5. With token access on, check that SSL enforcement stays on and locked, with a tooltip explaining that database token access requires SSL enforcement. Check that the tooltip also opens on keyboard focus. 6. If the API reports an unsuccessful SSL update, check that the switch still reflects `currentConfig.database` and the existing warning remains visible. |
||
|
|
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> |