Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
0897dad to
0eff5a0
Compare
🎭 Playwright Test Results (next)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
a212038 to
308688c
Compare
Replaces the scoped form's inline account-level access mode (blur overlay + confirmation checkbox) with a proper legacy-token escape hatch, and tightens expiry handling across both token forms. - "Create legacy token" now switches the sheet to the classic form (name + expiry only, with the classic account-wide warning) and creates the token through the legacy endpoint; the two-step review is skipped. The link also mentions the Supabase MCP server as a reason to need one. - Restore the "Generate token for experimental API" split-button dropdown on the scoped flow, extracted into a shared ExperimentalTokenDropdown used by both the classic button and the scoped sheet. - Cap custom expiry dates at one year from today: single shared getMaxCustomExpiryDate() drives the scoped calendar bounds, zod validation, and the classic dialog's maxDate. Calendars no longer page past the last selectable month (scoped Calendar via startMonth/endMonth; shared DatePicker derives them from minDate/maxDate). - Add an MCP-unsupported warning to the review step (with a link back into legacy mode) and the view-token sheet, sharing one set of copy constants. - Copy: resource access card descriptions, "can't be updated after creation" admonition, and inline links now use InlineLinkClassName.
Tokens must always have an expiry: drop the "Never" preset from EXPIRES_AT_OPTIONS so both classic entry points (flag-off dialog and the experimental V0 dialog) can no longer create non-expiring tokens, matching the scoped/legacy sheet which never offered one. Existing non-expiring tokens are unaffected; the list still displays them. Also deletes the orphaned BasicInfo.tsx (superseded by TokenDetails), the dead 'never' branch in getExpirationDate, and re-baselines the dialog's close reset to the full defaults.
Scoped/Form/Permissions/, Scoped/Form/ResourceAccess/, and AccessToken.schemas.ts (+ test) belonged to the superseded scoped-form design and had no live importers; the schemas file also still encoded the removed non-expiring token semantics. PERMISSION_LIST / ACCESS_TOKEN_RESOURCES stay: AccessTokenNewBanner still consumes them via useGroupedPermissions.
The two create-token tests broke in the styling cleanup (#48689): permission categories now start collapsed and the review step splits the risk summary into a badge plus description. This never surfaced because stacked PRs don't trigger the unit-test workflow. Expand the Project category before selecting a permission and assert the new risk structure. Also mirror the mode-switch links: "Switch back" becomes "Create scoped token" so both directions read "…need a token…? Create <type> token".
The projects MultiSelector's search input said "Search organizations", copied from the organization selector above it.
The sr-only description said the sheet is a two-step scoped token flow, which is wrong once the legacy link switches it to the one-step classic form. Use mode-agnostic copy.
setValue alone leaves a lingering organizationSlugs/projectRefs error in formState after a failed scoped submit; the fields unmount in legacy mode so the error was invisible but survived until the next full validation.
Buttons are keyboard-focusable by default; the explicit tabIndex={0} on
the three mode-switch links was a no-op.
The MCP-unsupported notice on the review step links back into legacy mode; it was the only untested mode-switch entry point.
308688c to
84c2e74
Compare
|
Closing in favour of #48858 |
…8858) ## 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? Remaining bits of #48714 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added role-aware access checks throughout scoped token creation. * Organization selectors now disable project-only organizations and recommend project-scoped tokens when appropriate. * Review screens highlight missing capabilities and permissions exceeding your current role. * Permission rows display indicators when access exceeds your role. * Added resource keys, labels, and summaries to improve token review clarity. * **Documentation** * Updated permission guidance with links to access-control documentation. * **Bug Fixes** * Corrected project selector behavior when no organization is selected. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Replaces the scoped form's inline account-level access mode (blur overlay + confirmation checkbox) with a proper legacy-token escape hatch, tightens expiry handling across both token forms, and models permission requirements the way the platform actually enforces them.
Legacy token escape hatch
ExperimentalTokenDropdownused by both the classic button and the scoped sheet.Tokens always expire
getMaxCustomExpiryDate()drives the scoped calendar bounds, zod validation, and the classic dialog'smaxDate.startMonth/endMonth; the sharedDatePickerderives them fromminDate/maxDate). The sharedDatePicker's only other consumer is the JIT database-access expiry picker, which picks up the same month bounds; reports/logs use the separateLogsDatePickerand are unaffected.Permission groups modeled as OR-of-AND alternatives
x-fga-permissionssemantics — development-vs-production branching alternatives no longer collapse into impossible conjunctions.MCPToolScopeMappingsis rewritten per endpoint from what each tool's handler actually calls (instead of expanding coarse OAuth scope bundles), with each entry annotated with its endpoint and the tool list pinned to the installed@supabase/mcp-server-supabaseby test.MCP-unsupported warnings
Cleanup and fixes
Scoped/Form/Permissions/,Scoped/Form/ResourceAccess/,BasicInfo.tsx,AccessToken.schemas.ts+ test) — no live importers.organizationSlugs/projectRefsvalidation errors; covered by a round-trip regression test, plus a test for the review-step legacy link.InlineLinkClassName.