mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
a2e41ea71b65622ee64fc7a6e08030beea6e435d
8686
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f05fe34966 |
feat(ui): scroll area (#54023)
## Problem - on `/kb/guides/migrate-from-auth0` in safari 27 on macos, the mouse wheel does not scroll the page and a trackpad does - radix scroll area bar in the table of contents adds a non-passive `wheel` listener on `document` - webkit stops mouse-wheel page scroll when that listener meets `overscroll-behavior-y: none` on `html`, which kb sets ## Solution - replaces radix with base ui in the `ui` scroll area parts because base ui binds its wheel listener to the scrollbar element - replaces the radix `display: table` workarounds in the studio token sheets and the connect sheet with a reset of the base ui content `min-width` - changes the docs ask ai scroll area to use the `ui` scroll area - adds an inset focus ring to the scroll area viewport because base ui makes an overflowing viewport focusable - adds a `getAnimations` stub to the jsdom test setups because the base ui viewport calls it - adds `@base-ui/react` to the pnpm catalog + points the design system scroll area page at the base ui docs <!-- ## 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 1. open the preview [/kb/guides/migrate-from-auth0](https://kb-git-antlio-ui-scroll-area-supabase.vercel.app/kb/guides/migrate-from-auth0) in safari on macos with a mouse 2. turn the mouse wheel and make sure that the page scrolls and the table of contents marks the active heading 3. open the preview [/design-system/docs/components/scroll-area](https://design-system-git-antlio-ui-scroll-area-supabase.vercel.app/design-system/docs/components/scroll-area) and make sure that each demo shows its bar on hover and scrolls with the wheel 4. make sure that the horizontal demo scrolls sideways 5. press `tab` until a demo takes focus and make sure that it shows an inset focus ring 6. open a project in the [studio preview](https://studio-staging-git-antlio-ui-scroll-area-supabase.vercel.app/dashboard), click `Connect` and make sure that a long code line scrolls inside its code block and the sheet body does not scroll sideways 7. open the [docs preview](https://docs-git-antlio-ui-scroll-area-supabase.vercel.app/docs), press `cmd+k`, search for `auth` and make sure that the results list scrolls ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
5b31e21ddb |
feat(docs): guide video preview (#53981)
## Problem * video card in the docs guide sidebar blurs the thumbnail making it hard to preview * users cannot see which video the card opens before they click it ## Solution * adds a `GlassLens` filter wrapper to `ui-patterns` with lens curvature and color fringe settings * replaces the video card in both docs sidebars with a sharp thumbnail * changes the video dialog in docs and www to fade the backdrop + skip the zoom when reduced motion is on * fixes the white iframe in dark mode + a one-frame backdrop flash at the end of the close animation * adds autoplay on open + the card thumbnail behind the iframe while the video loads * adds a hidden dialog title for screen readers <!-- linear:table-colwidths:801 --> <table> <thead> <tr> <th>preview</th> </tr> </thead> <tbody> <tr> <td> https://github.com/user-attachments/assets/b41b3b8a-4d3e-47b3-92ea-3b2cd7629494 </td> </tr> </tbody> </table> ## Review instructions 1. open [/docs/guides/database/overview](<https://docs-git-antlio-docs-video-preview-supabase.vercel.app/docs/guides/database/overview>) in dark mode 2. make sure that the video card shows a thumbnail 3. make sure it feels better :) ## Checklist Check all before review: - [X] I have read [CONTRIBUTING.md](<https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md>) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](<https://github.com/supabase/supabase/tree/master/apps/docs/style-guide>) |
||
|
|
653104a8bf |
docs: clarify disk IOPS and throughput are provisioned separately from compute capacity (#54073)
## Problem The Compute size section of the Compute and Disk guide says the table values are minimums that "every project of a given compute size gets". Readers could easily take the table as the IOPS and throughput their project gets. The page already says elsewhere that effective IOPS and throughput are the lower of the instance limit and the provisioned disk values (gp3 defaults to 3,000 IOPS and 125 MB/s), but that rule sits far from the table, so the two read as contradicting each other. The same confusion has come up several times in slack threads. ## Changes - Compute size intro: describe the table as what the compute instance can deliver, say it does not set the disk's IOPS or throughput, and link to the provisioned disk section. The 8XL example now says "supports" instead of "has". - New note under the table: effective IOPS and throughput are the lower of the instance limits and the provisioned disk values, with the gp3 defaults, and a pointer to Disk types for pricing. - 4XL and above paragraph: the "configure" link pointed at a billing page. It now points to Infrastructure settings, with the IOPS and throughput usage pages linked for pricing. - Corrects "From 8XL, baseline and maximum are the same" to "On larger sizes like 4XL and above", which matches the compute table. ## Notes - Docs prose only. No change to the table or shared data. - The new statements restate text already on this page. The 4XL example follows from the gp3 default and the effective-is-the-lower rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
46727fa89b |
docs: add guide for managing remote config as code (#50353)
## I have read the CONTRIBUTING.md file. YES ## What kind of change does this PR introduce? Docs. A new guide for `supabase config diff`, `config pull`, and `config push`, written for CLI v3. Relates to MARKET-1590. ## What is the current behavior? The CLI reference lists the three commands, but no guide explains the workflow. The Select 2026 recap blog tells users to run `config pull` with nothing to link to. ## What is the new behavior? - New guide at `/docs/guides/local-development/config-as-code`, in the nav after "Managing config and secrets". - Covers diff (labels, `--exit-code` for CI), pull (preview, git check, where values go), push (one consent question, `--yes` for CI and agents, the `init` defaults risk), and what push can and cannot write. - Links to `local-and-hosted-projects` and `migrating-to-v3` for the shared v3 target and consent rules. ## Additional context All behavior claims are checked against `supabase/cli` `v3.4.0`. **Related:** #50594 by @Sweta0519 adds a `config push` section to `managing-config.mdx`. This guide includes its `[group-write]` and `init` defaults points, with credit. It might be good to ask if we can shrink #50594 to a short pointer to this guide, so the two do not repeat each other. **Needs review:** one inline `NEEDS REVIEW` comment. "The Dashboard stays editable" is product intent from the PRFAQ, not confirmed in platform code. **Verified:** MDX compiles, internal links and anchors resolve, and the preview page returns 200 and shows in the nav. | Before (net-new page) | [After (PR preview)](https://docs-git-nikrichers-market-1590-launch-config-d-a8be81-supabase.vercel.app/docs/guides/local-development/config-as-code) | | ------------------------------ | --- | | _No production URL, new page._ |  | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6b39a00d33 | docs(self-hosted): drop the test OTP expiration from the phone guide (#54061) | ||
|
|
3ac85eb3c6 | docs(storage): update the self-hosting imgproxy example to v4 (#54145) | ||
|
|
4a34715279 | docs(storage): update image transformation limits (#54146) | ||
|
|
160f233b4e | chore(self-hosted): remove env vars Storage no longer reads (#54132) | ||
|
|
49bda396bb |
docs(rbac): enable RLS on the RBAC tables (#48394)
## What kind of change does this PR introduce? Documentation fix (security footgun). ## What is the current behavior? Closes #36816. The RBAC guide's schema block creates `public.user_roles` and `public.role_permissions` but never enables Row Level Security on either. Because both tables are created in the `public` schema, they inherit the default privileges granted to `anon` and `authenticated`. A reader who follows the guide as written ends up with the two tables that decide their entire authorization model readable *and writable* by any signed-in user — a user can insert `(their_uid, 'admin')` into `user_roles`, or add a permission to `role_permissions`, and the auth hook will happily mint them the claim on next token issue. It also leaves the guide internally inconsistent: the auth hook section creates ```sql create policy "Allow auth admin to read user roles" ON public.user_roles ... ``` which has no effect at all while RLS is disabled on that table. The [Slack Clone migration](https://github.com/supabase/supabase/blob/master/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214102356_init.sql#L74-L79) that this guide is explicitly based on does have both statements — they just didn't make it into the doc. ## What is the new behavior? Adds the two missing statements to the schema block, matching the example app: ```sql -- Secure the tables alter table public.user_roles enable row level security; alter table public.role_permissions enable row level security; ``` Plus a `caution` admonition explaining why this matters and why neither table gets an `anon`/`authenticated` policy — `authorize()` is `security definer`, so it reads `role_permissions` on the caller's behalf without the caller needing access. ## Additional context Docs-only change. The `security definer` `authorize()` function and the `supabase_auth_admin` policy later in the guide continue to work; the latter in fact only starts working once RLS is enabled. --------- Co-authored-by: Jeremias Menichelli <jmenichelli@gmail.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
530ae14dab |
docs(auth): remove claims of automatic cleanup of expired sessions (#54123)
Removes section from the doc stating the sessions are automatically deleted after 24 hours of expiry. Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
2fcbeb10ff |
Update billing-faq.mdx (#54125)
## Problem The documentation does not make it clear that the support team cannot extend grace periods or make exceptions to applied restrictions. This may lead to incorrect expectations about what support can do. ## Solution Added a note to the documentation: > The support team cannot extend grace periods or make exceptions to applied restrictions. ## Review instructions 1. Open the changed documentation page. 2. Confirm the note is displayed in the appropriate context and clearly communicates the restriction. ## Checklist - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide). |
||
|
|
44f50c6cc1 | docs(self-hosted): include imgproxy in the macOS Storage volume fix (#53004) | ||
|
|
dd1badd5b3 | docs(functions): trim self-hosted worker lifecycle section and fix isolate reuse claims (#54013) | ||
|
|
5be1d76ba7 | docs(self-hosted): correct NameID, claims, and rate limit details in the SAML guide (#54065) | ||
|
|
49525599d1 | docs(self-hosted): enable RLS on user_roles in the auth hooks guide (#54063) | ||
|
|
e0beeba832 | fix(docs): keep the home prompt panel text inside on phones (#54122) | ||
|
|
6062d5f44c |
chore: update cli reference doc (#53957)
Updates the CLI reference from the supabase/cli release workflow. The command spec and sidebar are generated from the same CLI command tree. For changes, edit the command tree or the content under `apps/cli/docs/` in supabase/cli. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|
|
7c6366d979 |
Added myself to humans.txt (#54094)
## Problem An onboarding task is suggesting to add my name in humans.txt. ## Solution Added my name in the list. <!-- ## 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 1. Ensure name is correct. 2. Ensure name has been inserted at the correct location. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
79da6ab86f |
docs(storage): add object versioning and lifecycle policies guides (#51566)
## What Adds docs for the Storage object versioning private alpha and bucket lifecycle policies for noncurrent versions. - New: `storage/buckets/object-versioning.mdx`, `storage/buckets/lifecycle-policies.mdx`, plus nav entries - Updated: copy/move, delete objects (versioned buckets and `aws s3 sync`), S3 compatibility (lifecycle rows, versioning note), schema diagram (versioning columns), storage size (noncurrent versions count toward storage size; current vs noncurrent query) |
||
|
|
0d9e021060 |
docs(ref): add Swift v3 alpha reference (#53896)
## Problem supabase-swift v3 is in alpha (`3.0.0-alpha.2`). The docs have no reference for it. v3 renames many public APIs, so the v2 reference does not help people who try the alpha. ## Solution Add a v3 reference at `/reference/swift/v3`. v2 stays the default at `/reference/swift`. - **Prerelease flag.** A version in `REFERENCES` can now set `prerelease: 'alpha'` (or another stage). Swift versions are `['v2', 'v3', 'v1']`. `versions[0]` is still the latest stable version, so the existing URL and "latest" logic does not change. Other SDKs can use the same flag. - **Alpha notice.** A prerelease page shows "This version is in alpha" with a link to the stable version. It does not show the "Version out of date" warning. - **Version menu.** Prerelease versions show in a separate "Prereleases" group with a stage badge. - **Spec.** `spec/supabase_swift_v3.yml` ports the v2 spec to the v3 API. The examples were checked against the v3 source at the `v3.0.0-alpha.2` tag. It adds the new v3 APIs: MFA recovery codes, `AuthAdminClient`, admin custom providers, `functions.stream`, and the Realtime streams API. - **Pages.** New introduction, installing (Xcode 26, Swift 6.2), and upgrade guide pages under `docs/ref/swift/v3/`. - **Navigation.** Nav entries for v3. v3 is excluded from the "TypeScript support" section. Not in this PR: - Search indexing for v3. Search still covers v2 only. - In the v2 spec, 7 filter ids use camelCase (for example `containedBy` and `textSearch`). They match no section, so they do not render in the v2 docs today. The v3 spec uses the matching kebab-case ids. The v2 fix can be a separate PR. ## Review instructions 1. Open `/docs/reference/swift/v3` on the preview. See the alpha notice and the v3 sections. 2. Open the version menu. See "Stable releases" (v2.0 with a "Latest" badge, v1.0) and "Prereleases" (v3.0 with an "Alpha" badge). 3. Open `/docs/reference/swift`. See that it still shows v2 with no notice. 4. Read the upgrade guide at `/docs/reference/swift/v3/upgrade-guide`. Typecheck, Prettier, and ESLint pass locally. I did not run the docs unit tests. The Swift examples were not compiled. <img width="318" height="236" alt="Screenshot 2026-11-25 at 10 36 01" src="https://github.com/user-attachments/assets/0f0caf18-7a4a-4835-8f6a-b76df9c66fa9" /> <img width="685" height="417" alt="Screenshot 2026-11-25 at 10 36 10" src="https://github.com/user-attachments/assets/1c55bc44-1fc1-4390-8d8c-48bc55822bd3" /> ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
08e5819707 |
docs: add Diogo Biazus as per onboarding process (#53061)
Same as #52956 but now from the proper repo ## Problem My onboarding instructions asked me to add myself to humans.txt. While doing so I noticed there was an inconsistency in the alphabetical order near my name. ## Solution I added my name to the list and reordered a few surrounding names. ## Review instructions Check that "Diogo Biazus" is in the list on the expected position. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
ce80792683 | feat(docs): Improve Pipelines docs (#54045) | ||
|
|
af75c3f8d9 |
Change deprecation notice in docs to mention early 2027 (#54052)
A notice was added in the Project's Settings -> API Keys page via [pull request 52250](https://github.com/supabase/supabase/pull/52250) that mentions `Legacy API keys will be retired in early 2027` but the notice in the docs still mentions `Supabase is deprecating the anon and service_role keys by the end of 2026`. This pull request updates the docs to be consistent with the Dashboard UI to avoid confusion. |
||
|
|
7960616cf9 |
fix(docs): use the sub claim in the storage copy/move policy examples (#53953)
Fixes #53952 ## What changed The Copy and Move Objects guide has three RLS policy examples that compare `storage.objects.owner_id` (`text`) and the output of `storage.foldername()` (`text[]`) with `auth.uid()` (`uuid`). Postgres has no implicit cast between `text` and `uuid`, so any query governed by these policies fails with `operator does not exist: text = uuid`. This PR changes the comparisons to use `auth.jwt()->>'sub'`, matching the pattern already used in the storage access control and delete objects guides. ## Verification - Reproduced the original error against a local Postgres instance. - Confirmed the corrected expressions run without errors. - No links or anchors changed. I used AI to help debug and verify this against a local Postgres instance, and I personally reviewed the final change. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
b3076f07b2 |
Add Lyric Hartley to humans.txt (#53081)
## Problem My name was not in the file. ## Solution Added my name ## Review instructions See that my name is there Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
041c363873 |
fix(docs): layout v2 fixtures (#53761)
## Problem - keyboard users hit focus problems in the option-1 docs layout because the on this page rail clips focus rings and Firefox adds an unlabeled tab stop on the sidebar scroll area - skip link to the content does not render - reference sits in a dropdown next to the logo which doesn't feel optimal - header breadcrumbs repeat the sidebar section with group crumbs that never link ## Solution - fixes the focus rings and tab stops in the sidebar, the rails and the footers so each ring is inset and is not clipped - changes the header breadcrumbs to show the parent and the page + links a group crumb to its overview page when it has one - moves reference into the sidebar section list with a back button + removes the sections dropdown and points the logo to the docs home - moves the knowledge base to the top of the sidebar footer and removes the changelog link - removes the hover backgrounds and color transitions from the sidebar and rail rows + fades the sidebar list under the back button on scroll - aligns the home agent prompt with the second framework column and changes the footer separator to a square <!-- ## 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. --> 1. visit [/docs/guides/database/replication/pipelines?docs-ia-mvp-v1=option-1](https://docs-git-antlio-fix-docs-layout-v2-nits-supabase.vercel.app/docs/guides/database/replication/pipelines?docs-ia-mvp-v1=option-1) 2. reload the page and press Tab once to make sure that the first stop is the skip link to the content 3. press Tab through the sidebar, the on this page rail and the page footer to make sure that each ring is inset and round and is not clipped 4. click the back button in the sidebar until the section list shows, then click `Reference` to make sure that it opens the reference list with a back button ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
d6e4089b1a |
feat(common): add FrameworkProvider and remove next imports (#53905)
Introduces a lightweight `FrameworkProvider` React context in `packages/common` (`Link`, `Image`, `pathname`, `asPath`, `isReady`, `params`, `push`), wires it up in the consuming apps, and removes the `next` dependency from `packages/common`. **Added:** - `FrameworkProvider`, `useFramework`, `FrameworkLink`, and `FrameworkImage` in `packages/common/framework.tsx`, with plain HTML defaults (`DefaultFrameworkLink` / `DefaultFrameworkImage`). `useFramework().push` always exists and falls back to `window.location.assign` - App-level framework providers wiring `next/link`, `next/image`, and router state in `www` (App + Pages routers), `docs`, `design-system`, `learn`, and `ui-library`, and native TanStack Router bindings in `studio` (`StudioFrameworkProvider`) - `StudioFrameworkProvider` reuses the common defaults (its image only applies the basePath) and reports `isReady` once the first route load commits, so the first page view carries the final route after any redirect - Unit tests for `StudioFrameworkProvider` (`useParams`, `FrameworkLink`, `FrameworkImage`, query/hash-only navigation, `isReady`) and for `PageTelemetry` route-change sends and the `TelemetryTagManager` consent gate **Changed:** - `common/hooks/useParams.ts`: read params from `useFramework()` instead of `next/compat/router` - `common/telemetry.tsx`: replace `next/script` in `TelemetryTagManager` with `useEffect` script injection, and read route state from `useFramework()` in `PageTelemetry` - `common/MetaFavicons/app-router.ts`: drop type-only `Metadata` import from `next` - Moved `MetaFaviconsPagesRouter` to `apps/www/components/MetaFaviconsPagesRouter.tsx` (its sole consumer) - Studio: `toRoutePattern` and `applyBasePath` now live once in `lib/internal-url.ts`, shared by the provider and the `compat/next` shims - `PageTelemetry` throws outside production when no `FrameworkProvider` is mounted, since it would otherwise send only the landing pageview. `useFramework()` itself still falls back to the defaults - `ui-library`: renamed its code-sample framework context to `FrameworkPreferenceProvider` / `useFrameworkPreference` so `FrameworkProvider` only means the `common` one **Removed:** - `learn`'s unused copy of that context (`useCourse` had no callers) - `next` from `packages/common/package.json` peerDependencies App Router adapters set `asPath` to the pathname only, same as the `usePathname`-based telemetry on master (reading search params at the root would opt static pages out of static rendering). ## To test - Run `packages/common` tests and typecheck, and `apps/studio` `StudioFrameworkProvider` / `route-render` / `telemetry` tests - Navigate between routes in Studio, Docs, and WWW and confirm page telemetry fires once per navigation (and does not duplicate on hash-only changes) - Load Studio at `/` (which redirects) and confirm the first page event has the final route - Verify URL params (`useParams`) continue resolving route and search params in Studio --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
a1616e0076 |
docs(cli): supabase init creates config.jsonc for new projects (#53857)
## Problem Since CLI 3.4.0 (released 2026-11-24), `supabase init` creates `supabase/config.jsonc` for new projects instead of `supabase/config.toml`. The file starts with a `$schema` key, so editors get validation and autocomplete straight away. Projects that already have a `config.toml` aren't touched, and the CLI keeps reading it the same way. A handful of guides still say `init` creates `config.toml`. ## Solution - `cli/config-formats.mdx`: the file table marks `config.jsonc` as the one `init` creates in CLI 3.4.0 and later, and the "Minimum CLI version" section says earlier versions create `config.toml`. Under the table there's a short line saying a `config.toml` project keeps working, and pointing at `supabase config convert --to toml` for anyone who wants TOML. The schema section says `init` writes the `$schema` key into `config.jsonc`, rather than the TOML `#:schema` line. - `cli/getting-started.mdx`: the setup admonition and the `supabase init` step name `config.jsonc`, and the step mentions `config convert --to toml` with a link to Config file formats. - `managing-config.mdx`, `cli-workflows.mdx` (step 1 and the key commands table) and `running-multiple-local-projects.mdx` (the `SUPABASE_EXPERIMENTAL_STACK=1 supabase init` bit) had the same "init creates `config.toml`" statement, so I've updated those too. I've left the many "edit `supabase/config.toml`" references across the other guides alone - they're about where a setting lives rather than what `init` creates, and the per-format config examples cover them. ## Review instructions 1. Open Config file formats, CLI getting started, Managing config and Local development workflow on the preview. 2. Check they say `supabase init` creates `config.jsonc` (CLI 3.4.0 and later), and that `config.toml` projects are described as still working. 3. Check the `--to toml` links land on the "Convert back to TOML" section. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
0fa521d64a |
chore: small nano compute docs improvements (#54005)
Make it a bit clearer that Nano instances are for Free Plan and not free in itself |
||
|
|
36e370aa5c |
docs(ai): explain how hnsw.ef_search caps HNSW results and how to set it (#53997)
## Problem The HNSW tuning section said only that a higher `ef_search` gives better accuracy and slower queries. A reader whose query uses a `limit` above `ef_search` gets fewer rows back. The docs didn't explain why, what the range is, or how to change the setting. Related to [FDBKIN-12895](https://linear.app/supabase/issue/FDBKIN-12895/document-performance-trade-offs-of-pgvectors-hnsw-ef-search-parameter) Closes [DOCS-1800](https://linear.app/supabase/issue/DOCS-1800/explain-that-hnswef-search-caps-hnsw-results-and-how-to-set-it) ## Solution The `ef_search` bullet on the "Going to production" guide now names the `hnsw.ef_search` setting, its default, and its valid range. Plain paragraphs after the list explain how it caps the rows an HNSW scan returns and how to set it. They cover a session, one transaction, a transaction-mode pooler, and a database function called through the Data API. They also point to iterative index scans for returning more rows, and don't repeat that explanation. The filtering section of the HNSW indexes page now names `hnsw.ef_search` as the limit, so the two pages agree. ## How to verify 1. Open https://docs-git-tedd-docs-1800-supabase.vercel.app/docs/guides/ai/going-to-prod#hnsw-understanding-efconstruction--efsearch--and-m and https://docs-git-tedd-docs-1800-supabase.vercel.app/docs/guides/ai/vector-indexes/hnsw-indexes#filtering-with-hnsw-indexes. 2. The `ef_search` bullet states the `hnsw.ef_search` default (40) and range (1 to 1,000), and stays one paragraph like the `m` and `ef_construction` bullets. 3. A paragraph after the list says that without iterative index scans, an HNSW index scan returns at most `ef_search` rows, even when the query's `limit` is larger. 4. A SQL block shows a `set` statement and a `set local` statement inside `begin` / `commit`. A second SQL block shows a database function with a `set hnsw.ef_search = 100` clause. 5. The paragraph about setting the value links to "Transaction mode limitations" and to "Querying a vector / embedding", and both links land on those sections. 6. A paragraph links to "Filtering with HNSW indexes", and the link lands on that section. 7. In "Filtering with HNSW indexes", the sentence about selective filters names `hnsw.ef_search` as the limit on rows a scan returns, and its link lands on the going-to-prod HNSW section. ## Checks Ran `pnpm turbo run typecheck`, `pnpm turbo run lint`, and `pnpm exec oxfmt --check` on the changed docs. Ran both SQL blocks in page order on Postgres 18 with pgvector 0.8.1, against 20k random vectors with an HNSW `vector_l2_ops` index and `vector` installed in the `extensions` schema. At the default, `limit 100` returned 40 rows. With `set` or `set local hnsw.ef_search = 100`, it returned 100 rows. The `set local` value reset after `commit`, and `1001` was rejected as outside 1..1000. The function with `set hnsw.ef_search = 100` returned 100 rows for `limit 200`, and the session value stayed at 40. At `ef_search = 1000`, `limit 1500` returned 1000 rows, and 1500 after `set hnsw.iterative_scan = relaxed_order`. Docs tests skipped: they need Docker. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1800](https://linear.app/supabase/issue/DOCS-1800/explain-that-hnswef-search-caps-hnsw-results-and-how-to-set-it). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
528e2d0a98 |
docs(self-hosting): explain how Edge Functions workers are reused across requests (#53996)
## Problem The self-hosted Functions guide lists worker timeouts and idle cleanup, but never says that a running worker serves later requests. The Docker guide says the main worker loads each function from disk per request, which suggests top-level setup runs on every request. Related to [FDBKIN-22732](https://linear.app/supabase/issue/FDBKIN-22732/clarify-edge-functions-worker-lifecycle-and-reuse-strategy-for-self) Closes [DOCS-1799](https://linear.app/supabase/issue/DOCS-1799/explain-how-self-hosted-edge-functions-reuse-workers-across-requests) ## Solution A new "Worker lifecycle" section on the self-hosted Functions guide explains that the default `per_worker` policy sends requests to a function's running workers. Concurrent cold requests can start up to one worker per CPU, and later requests rotate across them. It says that top-level code runs once per worker, so heavy setup belongs there. It also lists the events that stop a worker from taking new requests, including retirement at half of `workerTimeoutMs`, links to the existing timeout and cleanup sections, and names the settings that keep workers alive longer. The Docker guide's sentence now says that a restart stops running workers, so the next request picks up changed code. ## How to verify 1. Open https://docs-git-tedd-docs-1799-supabase.vercel.app/docs/guides/self-hosting/self-hosted-functions#worker-lifecycle and https://docs-git-tedd-docs-1799-supabase.vercel.app/docs/guides/self-hosting/docker#accessing-edge-functions. 2. The Worker lifecycle section says that requests go to a running worker for the function, that concurrent cold requests might each start a worker up to the number of CPUs, and that later requests rotate across those workers. 3. It says that top-level code runs once per worker, that heavy setup goes at the top level, and that top-level state belongs to one worker. 4. It lists reaching half of `workerTimeoutMs`, no requests, idle-worker cleanup, an error or resource limit, and a service restart as events that stop a worker from taking new requests, and says a new worker starts when the function has none left. The links to Timeout errors, Idle-worker cleanup, Per-worker memory limit, and Container memory budget go to those sections. 5. It names `requestAbsentTimeoutMs` and `workerTimeoutMs` as the settings to raise to keep workers alive longer. 6. The Docker guide no longer says functions load from disk per request, and still says a restart picks up new or changed function code. ## Checks Ran `pnpm turbo run lint typecheck` on the changed packages and `pnpm exec oxfmt --check` on the changed files. Checked the facts against `docker/volumes/functions/main/index.ts` and `docker/docker-compose.yml` in this repo, and against `supabase/edge-runtime` at `v1.79.2` (the compose image tag): `cli/src/flags.rs` (`--policy` default), `crates/base/src/worker/pool.rs` (worker reuse, rotation, concurrent creation, and retirement), `crates/base/src/worker/supervisor/strategy_per_worker.rs` (early retirement at half of the wall-clock limit), and `ext/workers/user_workers.js` (`forceCreate` default). Docs tests need Docker and were skipped. Reuse wasn't tested against a running stack. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have checked that the change follows the docs style guide - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1799](https://linear.app/supabase/issue/DOCS-1799/explain-how-self-hosted-edge-functions-reuse-workers-across-requests). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
74cb5aa97a |
docs(rls): warn that an auth.uid() is null branch exposes every row (#53995)
## Problem The RLS guide explains that `auth.uid()` is `null` for a request without a user, but not what happens when a policy tests for `null` on purpose. A condition such as `auth.uid() is null or auth.uid() = user_id` returns every row to such a request. The guide also never says which roles a policy with no `to` clause applies to. Related to [FDBKIN-31059](https://linear.app/supabase/issue/FDBKIN-31059/update-rls-documentation-to-warn-against-common-anon-leak-policy) Closes [DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row) ## Solution The `auth.uid()` section of the RLS guide now states in body text when `auth.uid()` is `null` and what an owner comparison returns then. A `danger` admonition replaces the old caution: it shows the insecure `is null` branch, explains why `to authenticated` alone doesn't fix it, and gives a safe owner-only policy to copy. "Specify roles in your policies" now says that a policy with no `to` clause applies to `public`, which includes `anon`. The old advice to add `auth.uid() IS NOT NULL AND` is removed, because the plain comparison already returns no rows for such requests. ## How to verify 1. Open https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#authuid and https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#specify-roles-in-your-policies. 2. The `auth.uid()` section says it returns `null` for any request whose JWT has no `sub`, including every `anon` request. 3. A danger admonition warns that an `auth.uid() is null` branch returns every row to such requests, and that `to authenticated` doesn't remove the risk. 4. The admonition ends with a copyable policy that uses `to authenticated` and `(select auth.uid()) = user_id`, with no `is null` branch. 5. "Specify roles in your policies" says a policy with no `to` clause applies to `public`, which every role, including `anon`, is a member of. 6. The new link from "Specify roles in your policies" (`#authuid`) jumps to the `auth.uid()` section. ## Checks Ran `pnpm exec oxfmt --check` on the changed page. ESLint ignores MDX files. Ran both SQL snippets in PGlite 0.4.5 with `anon` and `authenticated` roles, Supabase's `auth.uid()` definition, a two-row table with `select` granted to both roles, and RLS on. With the insecure policy and no `to`, `anon` reads both rows. With `to authenticated`, a request with no `sub` reads both rows. With the safe policy, a user reads only their own row and a request with no `sub` reads none. A policy with no `to` lists `public` in `pg_policies.roles`, which matches the Postgres `CREATE POLICY` docs. `pnpm build:guides-markdown` was not run, because its federated-content step needs GitHub credentials. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
13d1f13107 |
docs(platform): explain what a custom domain is for and that it must be a subdomain (#53993)
## Problem The Custom Domains page didn't say what a custom domain is for. The subdomain-only rule appeared only in the CLI prerequisites. A reader who uses the dashboard, or reads only the intro and Limitations, could think they can't use their own domain. They could also think the add-on hosts their website on the root domain. Related to [FDBKIN-15980](https://linear.app/supabase/issue/FDBKIN-15980/clarify-that-custom-domains-are-for-api-endpoints-not-website-hosting) Closes [DOCS-1797](https://linear.app/supabase/issue/DOCS-1797/explain-that-a-custom-domain-replaces-the-project-api-url-and-must-be) ## Solution The intro now says that a custom domain serves the project's API, alongside the default `<project-ref>.supabase.co` domain, for Auth, Storage, Edge Functions, and other API requests. Limitations now states the subdomain rule for every setup path. It also widens the existing hosting bullet: a custom domain isn't intended for hosting frontend apps, and readers can host their website on the root domain with their own hosting provider. The CLI prerequisite keeps the subdomain step without repeating the rule. The intro says "alongside" rather than "replaces", because the default domain keeps working after activation. The hosting bullet keeps the "not intended" framing, because Edge Functions can serve HTML only on a custom domain. Preview: [Custom domains](https://docs-git-tedd-docs-1797-supabase.vercel.app/docs/guides/platform/custom-domains#limitations) ## Checks Ran `pnpm exec oxfmt --check` on the changed file. Checked facts against the page's activation steps, the Edge Functions limits page, and Studio's custom domain form, which asks for a subdomain. Skipped `pnpm build:guides-markdown`: its `build:federated-content` dependency needs GitHub credentials that the build environment didn't have. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1797](https://linear.app/supabase/issue/DOCS-1797/explain-that-a-custom-domain-replaces-the-project-api-url-and-must-be). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
caf7baaf08 |
docs(auth): show RLS policies that match the Firebase user ID (#53992)
## Problem The Firebase Auth guide sets up the client, the integration, the `role` claim, and the issuer check, but never shows how to limit rows to the signed-in Firebase user. The obvious helper, `auth.uid()`, fails with Firebase UIDs. Related to [FDBKIN-16284](https://linear.app/supabase/issue/FDBKIN-16284/provide-a-clear-process-for-connecting-firebase-auth-to-supabase-rls) Closes [DOCS-1796](https://linear.app/supabase/issue/DOCS-1796/show-how-to-write-rls-policies-that-match-the-firebase-user-id) ## Solution Adds a short "Write RLS policies for Firebase users" section to the Firebase Auth guide. It explains that `sub` holds the Firebase `uid`, shows a select policy that compares a `text` column with `(select auth.jwt()->>'sub')`, and says to use `auth.jwt()->>'sub'` in place of `auth.uid()`, which casts `sub` to `uuid`. The snippet uses the same shape and placeholder as the page's other policies and the custom OIDC guide. It points self-hosters to the restrictive issuer policy. ## How to verify 1. Open https://docs-git-tedd-docs-1796-supabase.vercel.app/docs/guides/auth/third-party/firebase-auth#write-rls-policies-for-firebase-users. 2. The section sits between "Add a new Third-Party Auth integration to your project" and the self-hosting restrictive policy section. 3. The SQL snippet creates a select policy on `table_name` for `authenticated` using `user_id = (select auth.jwt()->>'sub')`. 4. The text says `user_id` must be a `text` column, and to use `auth.jwt()->>'sub'` in place of `auth.uid()`, which fails with `invalid input syntax for type uuid`. 5. The text asks only self-hosters to add the restrictive issuer policy. 6. The links to the RLS guide, the `role` claim section, and the restrictive issuer policy section go to the right headings. ## Checks Ran `pnpm exec oxfmt --check` on the changed file. Checked `auth.uid()` against the `supabase/auth` migration `20220224000811_update_auth_functions.up.sql` (it casts `sub` to `uuid`), and the `sub` claim against Firebase's ID token docs. Skipped `pnpm build:guides-markdown`, which needs GitHub credentials that the build environment didn't have. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1796](https://linear.app/supabase/issue/DOCS-1796/show-how-to-write-rls-policies-that-match-the-firebase-user-id). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
c9a093fa81 |
docs(auth): show the hashed nonce in the Google pre-built HTML example (#53991)
## Problem The Google pre-built HTML example on the Google sign-in guide showed `data-nonce=""`, while the nonce step below it said the nonce must go in that attribute. Readers couldn't tell what value belongs in `data-nonce`, whether the attribute is required, or how to set a value that changes on every sign-in. Related to [FDBKIN-45945](https://linear.app/supabase/issue/FDBKIN-45945/clarify-data-nonce-attribute-in-google-login-documentation-html) Closes [DOCS-1795](https://linear.app/supabase/issue/DOCS-1795/show-where-the-hashed-nonce-goes-in-the-google-pre-built-html-example) ## Solution The HTML example now shows a `<HASHED_NONCE>` placeholder. A line below it says to keep the attribute only when you configure a nonce and to remove it otherwise, because Supabase Auth rejects a sign-in whose ID token has a nonce that `signInWithIdToken` doesn't pass (unless the nonce check is skipped). The "Configure a nonce" step now says the hashed nonce goes in `data-nonce` and the raw nonce in the `nonce` option of `signInWithIdToken`, and explains why: Supabase Auth hashes the raw value and compares it with the token's nonce. The step ends with two ways to set a per-sign-in value from code: write the `g_id_onload` element and then load the Google client script, or pass the hashed nonce to `google.accounts.id.initialize` as the Next.js example does. The nonce-generation snippet itself is unchanged. ## How to verify 1. Open https://docs-git-tedd-docs-1795-supabase.vercel.app/docs/guides/auth/social-sign-in/auth-google#google-pre-built. 2. In the "Your final HTML code might look something like this" example, `data-nonce` shows `<HASHED_NONCE>`, not an empty string. 3. Below that example, the page says to keep `data-nonce` only if you configure a nonce, to remove it otherwise, and that Supabase Auth rejects the sign-in when the ID token has a nonce and `signInWithIdToken` doesn't pass one, unless `Skip nonce check` is enabled. 4. The "Configure a nonce" step says the hashed nonce goes in `data-nonce` and the raw nonce in the `nonce` option of `signInWithIdToken`. 5. The end of that step says to generate the `data-nonce` value in page code and gives two options: write the `g_id_onload` element from code and then load the Google client script in place of the `<script>` tag from the first step, or pass the hashed nonce to `google.accounts.id.initialize`. Its "One-tap with Next.js" link jumps to that section. ## Checks Ran `pnpm exec oxfmt --check` on the changed MDX file; it passes. No code changed, so no typecheck, lint, or tests apply. Checked the hashing rule against Supabase Auth's ID-token grant (`internal/api/token_oidc.go`: SHA-256 of the raw nonce, hex-encoded, compared with the token's `nonce` claim; when the nonce check is not skipped, a token nonce without a passed nonce, or the reverse, fails with "Passed nonce and nonce in id_token should either both exist or not.") and the Google Identity Services HTML reference for `data-nonce` (optional). Did not run the docs build in the sandbox. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have kept the change small and focused - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1795](https://linear.app/supabase/issue/DOCS-1795/show-where-the-hashed-nonce-goes-in-the-google-pre-built-html-example). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
b7c1555d94 |
chore: fix order of names in humans.txt (#53982)
- fix order of names in humans.txt Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
24727bd0bf |
fix(docs): cast the SSO provider claim to uuid in the RLS policy (#53846)
## Problem Fixes #53845. The SAML SSO guide's `organization_settings` RLS example has several problems. - It compares `sso_provider_id` (`uuid`) to `auth.jwt()#>>'{amr,0,provider}'` (`text`), so creating the policy fails with `operator does not exist: uuid = text`. - It reads `amr[0]`. After an MFA step, `amr[0]` can be the MFA entry, which has no `provider`, so the expression returns null and the policy rejects the matching row. - It never enables RLS and shows only a restrictive policy, which does not grant access on its own. ## Solution Make the example self-contained: - Enable RLS on the table. - Add a permissive `SELECT` policy for authenticated users. - Keep a restrictive policy that finds the `sso/saml` entry in `amr`, reads its `provider`, and casts it to `uuid`. - Update the `auth.jwt()` provider reference in the same section to point to this lookup. This keeps the comparison as `uuid = uuid` and does not assume the SSO entry is first. This changes one example and the related `auth.jwt()` reference in one `.mdx` file. ## Verification Tested against `supabase/postgres:17.6.1.143` with the real `auth.jwt()` definition. Before, creating the policy fails: ``` using ( sso_provider_id = (select auth.jwt()#>>'{amr,0,provider}') ); ERROR: operator does not exist: uuid = text ``` After, the policy creates. With the MFA entry first (`amr` has `totp`, then `sso/saml`), the MFA-first SSO user sees only their organization's row. With the SSO entry first, the same user sees the same row. A user without an SSO entry sees no rows. Prettier passes on the file. ## Review instructions 1. Open `apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx`. 2. Confirm the table enables RLS, the example has a permissive `SELECT` policy and a restrictive provider policy, the provider lookup finds the `sso/saml` entry and casts it to `uuid`, and the `auth.jwt()` reference points to that lookup. 3. Run the example against a project or local database, including a user with an MFA entry before the SSO entry. The user should see only their organization's row. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) I used AI to help debug and verify this, but I reviewed the change and am submitting the PR myself. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
1006f3590c |
docs(billing): document the $300 minimum for credit top-ups (#53260)
## Problem The [Credits](https://supabase.com/docs/guides/platform/credits) page lists only the $2,000 maximum per credit top-up. The Dashboard also enforces a $300 minimum ("Amount must be between $300 - $2000"), which isn't documented, and customers have asked about it in support tickets. ## Solution Add the $300 minimum to the first sentence of the "Credit top-ups" section, using the same `<Price>` component as the existing maximum and No other content changes. <img width="1004" height="238" alt="Topup-dialog" src="https://github.com/user-attachments/assets/de3f84db-4a35-43d2-923b-0957b75dfa9d" /> ## Preview links | Site | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | Docs | [/docs/guides/platform/credits](https://supabase.com/docs/guides/platform/credits) | [/docs/guides/platform/credits](https://docs-git-docs-credit-top-up-minimum-supabase.vercel.app/docs/guides/platform/credits) | with a minimum of | ## Review instructions 1. Open the live and preview links side by side. 2. In "Credit top-ups", check that the first sentence now gives both the $300 minimum and the $2,000 maximum, and that both amounts render correctly. 3. Optionally, open Organization → Billing → Credit Balance → Top Up in the Dashboard and enter an amount below $300 to see the validation message. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> |
||
|
|
4ea006e7a1 |
add Danny Kulchinsky to humans.txt (#53984)
adding myself to humans.txt |
||
|
|
e44837c256 |
feat(docs): point every docs page at llms.txt in HTML and markdown (#53965)
Closes DOCS-1756 ## Problem No docs page tells an agent that `llms.txt` exists or that a markdown version is available. Agents that send `Accept: text/markdown` already get markdown, but agents that fetch HTML have no signal to try the markdown path. ## Solution - **HTML:** add a visually hidden directive as the first child of `<body>` in the root layout, so it comes before the navigation on every guide and reference page. It links to `https://supabase.com/docs/llms.txt` and says guide pages have a markdown version at the same path with `.md` appended, before any query string or fragment. It's `sr-only` and `aria-hidden`, and the link has `tabindex="-1"`. - **Crawler HTML:** bot requests for SDK reference pages are rewritten to `/api/crawlers`, which skips the root layout. The same directive goes before its `<nav>`. - **Markdown:** add a sentence linking `llms.txt` to the "Note for AI agents" blockquote in the guides markdown route. The agent feedback page skips the feedback text to avoid linking to itself, but it keeps the `llms.txt` line. - Add `LLMS_TXT_URL` and `LLMS_TXT_DIRECTIVE_HTML` to `common/markdown-affordance`, and reuse `LLMS_TXT_URL` in `proxy.ts`. The directive limits the `.md` claim to guides, because reference `.md` requests 404. It doesn't say `llms.txt` lists every page. The link targets `/docs/llms.txt`, the docs index that AFDocs scores for the `/docs` base URL. #53968 makes it a real file. Until that merges, `/docs/llms.txt` 308-redirects to the site-wide `/llms.txt`, so the link works in either merge order. ## Manual testing 1. Open a Vercel preview guide page and view source. Confirm the `llms.txt` directive comes before the navigation markup. 2. Open a reference page and confirm the same. 3. Confirm the directive isn't visible and isn't tabbable. 4. Request a reference section page with a bot user agent, such as `curl -A Googlebot`, and confirm the directive comes before `<nav>`. 5. Request a guide with `.md` appended and confirm the opening blockquote links `llms.txt`. 6. Request `/docs/guides/ai-tools/agent-feedback.md` and confirm the opening blockquote links `llms.txt`. 7. Run AFDocs against the preview and confirm `llms-txt-directive-html` and `llms-txt-directive-md` pass. |
||
|
|
8f76606683 |
docs(kotlin): fix outdated API names and ack wording in guides (#53282)
## Problem Some Kotlin snippets in the guides use names supabase-kt renamed in 2.0, so they don't compile with current supabase-kt (3.9.0). The Apple sign-in page also asks for `gotrue-kt`, which has no 3.x release (3.0.0 replaced it with `auth-kt`). And the Kotlin tab of "Acknowledge messages" in the Broadcast guide says `acknowledgeBroadcasts` sends messages back to the sender, which is what `receiveOwnBroadcasts` does. Closes #53281 ## Solution - `passwords.mdx`: `supabase.gotrue.sendRecoveryEmail` → `supabase.auth.resetPasswordForEmail` in the PKCE flow, the same rename #33564 made in the Implicit flow copy. - `auth-apple.mdx`: `gotrue.signInWith(Apple)` → `auth.signInWith(Apple)`, `install(GoTrue)` → `install(Auth)`, `gotrue-kt` → `auth-kt`. - `postgres-changes.mdx`: `realtime.createChannel` → `channel`, and `connect()` + `join()` → `subscribe()`, which connects on its own. That matches the other Kotlin snippets on the page. `connect()` still exists, it just isn't needed here. - `broadcast.mdx`: the Kotlin ack tab now says the servers acknowledge each message, and that on a subscribed channel `broadcast()` doesn't wait for or return the acknowledgment. `acknowledgeBroadcasts` serializes to `ack` in `RealtimeJoinPayload.kt`, while `broadcast()` returns `Unit` and the server's reply is only logged. The renames come from supabase-kt's MIGRATION.md, and I checked each new name against the 3.9.0 source and the Kotlin reference. `/test-the-docs` doesn't run `kotlin` fences, so nothing was executed. The compose-auth snippet on the Apple page has three more compile errors that aren't renames: `result.error` (`NetworkError` only has `message`), `scope`, which is never declared, and `fullName` on `SignInResultData`, which only exposes `credential` on Apple targets. I left those out and can send them separately. ## Review instructions 1. Open the Kotlin tab of each changed snippet on the preview: passwords (PKCE flow, step 3), Apple sign-in, Postgres Changes `neq` filter, Broadcast "Acknowledge messages". 2. Compare the names with the 2.0 and 3.0 sections of supabase-kt's MIGRATION.md and with the Kotlin reference for `resetPasswordForEmail`, `subscribe` and installing. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
3389756a4c |
fix(docs): correct the JWT team policy example (#53777)
## Problem Fixes #53776 We hit this while adding team-scoped RLS to a project from the guide. Creating the policy fails with: ```text ERROR: operator does not exist: uuid = jsonb ``` The example uses `team_id in (select auth.jwt() -> 'app_metadata' -> 'teams')`. `->` returns a single `jsonb` value, so `in (select ...)` compares `team_id` to that jsonb value. ## Solution Expand the claim with `jsonb_array_elements_text`, cast each team ID to `uuid`, and compare it with `= any (array(...))`: ```sql using ( team_id = any ( array( select (jsonb_array_elements_text((select auth.jwt()) -> 'app_metadata' -> 'teams'))::uuid ) ) ); ``` `app_metadata.teams` must be an array of UUID strings, for example `{"app_metadata": {"teams": ["22222222-2222-2222-2222-222222222222"]}}`. Objects such as `[{"id": "..."}]` fail the cast. Comparing UUID to UUID means uppercase values in the claim still match and Postgres can use an index on `team_id`. The guide and the AI prompt in `examples/prompts/database-rls-policies.md` both document the expected claim shape and that `team_id` is a `uuid`; for other ID types, cast the array element to that type instead. ## Review instructions 1. Open the `auth.jwt()` section of the [RLS guide](https://supabase.com/docs/guides/database/postgres/row-level-security#auth-jwt). 2. Run the updated `create policy` statement against Postgres. It should create without error. 3. Check that a user whose `app_metadata.teams` is an array of UUID strings containing the row's `team_id` sees the row, including when the claim uses an uppercase UUID, and that a user without it does not. I checked these steps on Postgres 14. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) I used AI to help debug this. The fix and this pull request are mine; I reviewed the change before opening it. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
9298ed68c1 |
docs(functions): list all supported sync Deno APIs and cover self-hosted workers (#53971)
## Problem The list of synchronous Deno APIs on the Edge Functions ephemeral storage page leaves out three APIs that the runtime allows during initial script evaluation. The self-hosted Functions guide doesn't say whether these limits apply to self-hosted functions, or where to find them. Related to [FDBKIN-8800](https://linear.app/supabase/issue/FDBKIN-8800/document-which-deno-sync-functions-are-supported-in-self-hosted-edge) Closes [DOCS-1762](https://linear.app/supabase/issue/DOCS-1762/list-every-supported-sync-deno-api-and-say-they-apply-to-self-hosted) ## Solution The ephemeral storage page now lists all 12 sync APIs that edge-runtime allows during initial script evaluation, adding `Deno.lstatSync`, `Deno.makeTempFileSync`, and `Deno.copyFileSync`. The self-hosted Functions guide gets a short "Synchronous file APIs" section: user workers get the same init-only rule and the `blocklisted on the current context` error, and the main worker router isn't restricted. It links to the list instead of repeating it. ## How to verify 1. On `/docs/guides/functions/ephemeral-storage`, the "Using synchronous file APIs" list shows 12 APIs, including `Deno.lstatSync`, `Deno.makeTempFileSync`, and `Deno.copyFileSync`. 2. On `/docs/guides/self-hosting/self-hosted-functions`, a "Synchronous file APIs" section says user-worker functions can use these APIs only during initial script evaluation, names the error thrown otherwise, and says the main worker isn't restricted. 3. The link in that section opens the list on the ephemeral storage page, and the self-hosted page doesn't repeat the list. ## Checks Ran `pnpm exec oxfmt --check` on both pages. Checked the API list, the error text, and the `kind === "user"` gate against `ext/runtime/js/bootstrap.js` in `supabase/edge-runtime` at `v1.79.2`, the version `docker/docker-compose.yml` pins. Checked that `docker/volumes/functions/main/index.ts` doesn't set `useReadSyncFileAPI` when it creates user workers. `pnpm build:guides-markdown` couldn't run in the sandbox: it needs GitHub credentials for federated content. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] The change is docs content only. ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1762](https://linear.app/supabase/issue/DOCS-1762/list-every-supported-sync-deno-api-and-say-they-apply-to-self-hosted). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
ada003c3d7 |
docs(auth): explain how the SSR session carries over between requests (#53975)
## Problem The "How it works" section of the SSR advanced guide says the tokens must be stored in cookies, but not that `@supabase/ssr` does this. A reader who signs a user in on one server route can't tell how a later request gets the session back, so they may pass tokens around and call `setSession` themselves. Related to [FDBKIN-20417](https://linear.app/supabase/issue/FDBKIN-20417/clarify-server-side-session-management-across-multiple-http-requests) Closes [DOCS-1765](https://linear.app/supabase/issue/DOCS-1765/explain-how-a-server-side-session-carries-over-to-the-next-request) ## Solution Two paragraphs in "How it works" on the SSR advanced guide explain the cookie round trip. On sign-in, a code exchange, a refresh, or a user update, the server client writes the session through `setAll`. On the next request, a new server client reads it back through `getAll`, with no `setSession` call. The framework setup stays on "Creating a Supabase client for SSR", which the new text links to. ## How to verify 1. Open `/docs/guides/auth/server-side/advanced-guide` on the preview and go to "How it works". 2. Check that the section says a server-side sign-in with `createServerClient` writes the session, access and refresh tokens included, to the `sb-<project_ref>-auth-token` cookie through `setAll`. 3. Check that it says a new server client on a later request restores the session through `getAll`, with no `setSession` call. 4. Click the "Creating a Supabase client for SSR" link and check that it opens that page. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and `pnpm exec oxfmt --check` on the changed file. Checked the facts against `@supabase/ssr` 0.12.7 (`createServerClient.js`, `cookies.js`, `utils/chunker.js`) and the cookie name on "Creating a Supabase client for SSR". Skipped the docs tests: they need Docker. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1765](https://linear.app/supabase/issue/DOCS-1765/explain-how-a-server-side-session-carries-over-to-the-next-request). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
3a9459fef2 |
docs: say which requests count toward the Management API rate limits (#53974)
## Problem The Management API rate limits section explains the limit, its scope, and its headers, but not which traffic it applies to. Readers can't tell whether CLI commands or calls to their own project, such as Edge Function invocations, count toward it. Related to [FDBKIN-22153](https://linear.app/supabase/issue/FDBKIN-22153/clarify-documentation-for-management-api-rate-limits-and-what-actions) Closes [DOCS-1764](https://linear.app/supabase/issue/DOCS-1764/say-which-requests-count-toward-the-management-api-rate-limit) ## Solution The "Rate limits" section of the Management API introduction now opens by saying that only requests to `https://api.supabase.com` count, and that requests to a project's own URL don't. The "Rate limit scope" subsection ends with a CLI example: `supabase functions deploy` sends at least one Management API request per function, so a large deploy to one project might reach the per-endpoint limit. The example sits after the scope rules so it reads as an application of them. The limits, tables, scope rules, and headers are unchanged. ## How to verify 1. Open `/docs/reference/api/introduction` in the preview and go to "Rate limits". 2. The intro says only requests to `https://api.supabase.com` count, and that requests to `https://<project-ref>.supabase.co`, such as Edge Function invocations and Data API calls, don't. 3. The end of "Rate limit scope" says the Supabase CLI uses the Management API, and that `supabase functions deploy` to one project with many functions might reach the per-endpoint limit. 4. The limit tables, scope list, and response headers match production. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'` (no errors), and `pnpm exec oxfmt --check` on the changed file. Checked the CLI claim against `supabase/cli` `apps/cli/src/shared/functions/deploy.ts`. By default it bundles with Docker and calls `POST /v1/projects/{ref}/functions` or `PATCH /v1/projects/{ref}/functions/{slug}` per function, then one bulk `PUT /v1/projects/{ref}/functions`. With `--use-api`, or when Docker isn't running, it calls `POST /v1/projects/{ref}/functions/deploy` per function. Because of that, the text doesn't name a single endpoint. The Edge Function invocation URL comes from the Edge Functions quickstart. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1764](https://linear.app/supabase/issue/DOCS-1764/say-which-requests-count-toward-the-management-api-rate-limit). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
101afae233 |
docs(auth): warn that users can change their own user metadata (#53973)
## Problem The "Adding and retrieving user metadata" section of the Managing user data guide shows how to set and read user metadata, but never says that users can change it themselves. A reader could store roles or tenant IDs there and trust them in RLS policies or app logic. Related to [FDBKIN-25396](https://linear.app/supabase/issue/FDBKIN-25396/document-that-raw-user-meta-data-is-client-mutable) Closes [DOCS-1763](https://linear.app/supabase/issue/DOCS-1763/warn-that-users-can-change-their-own-user-metadata-in-user-management) ## Solution Adds a danger admonition at the end of the section. It explains that any signed-in user can rewrite their own `user_metadata`, including the claim in the JWT, so it must not hold authorization data or be trusted in RLS. It points readers to `app_metadata` for values users must not change, which only a trusted server with the secret key can set. It links to the existing warnings on the Users page and in the RLS guide instead of repeating them. ## How to verify 1. Open `/docs/guides/auth/managing-user-data` on the preview and scroll to "Adding and retrieving user metadata". 2. Below the retrieval code tabs, a danger callout says that users can change their own user metadata and that it must not hold roles or tenant IDs or be trusted in RLS policies. 3. The callout says to store values that users must not change in `app_metadata`. 4. The links to the user object (`/docs/guides/auth/users#the-user-object`), `auth.jwt()` (`/docs/guides/database/postgres/row-level-security#authjwt`), the secret key page, and `auth.admin.updateUserById()` resolve and land on the right sections. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and `pnpm exec oxfmt --check` on the changed file; all pass. Docs tests skipped because they need Docker. Checked behavior against `supabase/auth` `internal/api/user.go` (`UserUpdate`: `data` updates user metadata with no admin check; `app_metadata` from a non-admin returns `not_admin`) and `internal/models/user.go` (`UpdateUserMetaData` merges keys and deletes null ones). ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] The change is scoped to one docs section and adds no code samples ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1763](https://linear.app/supabase/issue/DOCS-1763/warn-that-users-can-change-their-own-user-metadata-in-user-management). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
962ea89399 |
docs: show which roles can delete the production branch (#53972)
## Problem The project permissions table on the access control page lists Read and Write for the production branch, but not Delete. Readers can't tell whether a Developer can delete the production branch, though the table shows that one can delete development branches. Related to [FDBKIN-36106](https://linear.app/supabase/issue/FDBKIN-36106/clarify-docs-on-branch-deletion-behavior-with-rbac-for-different-user) Closes [DOCS-1760](https://linear.app/supabase/issue/DOCS-1760/show-which-roles-can-delete-the-production-branch-in-the-project) ## Solution The Branching rows on the Access Control page now have a Delete permission for the production branch. Only Owner and Administrator can use it. This matches the minimum role that the authorization model sets for deleting the production branch. The other rows and the footnotes stay the same. ## How to verify 1. Open `/docs/guides/platform/access-control#branching-permissions` on the preview. 2. Under Production Branch, a Delete row shows a check for Owner and Administrator and a cross for Developer and Read-Only. 3. The Development Branches rows (List, Create, Update, Delete) and the footnotes read as before. 4. The new row has the same columns and icons as the rows around it. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and `pnpm exec oxfmt --check` on the changed file. All passed. I checked the roles against `branching_production_delete: 'administrator'` in `apps/studio/components/interfaces/Account/AccessTokens/AccessToken.roles.ts` and against the delete-branch endpoint requirements in `packages/api-types/types/fga-requirements.ts`. I skipped the docs tests because they need Docker. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] The PR title follows the Conventional Commits format. - [x] The change is limited to the scope described above. ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1760](https://linear.app/supabase/issue/DOCS-1760/show-which-roles-can-delete-the-production-branch-in-the-project). Tedd doesn't read comments on this PR. Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
cce655195d |
docs(rls): explain how policy conditions let Postgres use partial indexes (#53970)
## Problem The "Add indexes" section of the Row Level Security guide covers plain and composite btree indexes, but not partial indexes. A reader whose policy filters on a fixed condition, such as a status flag, can't tell how to index it. Related to [FDBKIN-31278](https://linear.app/supabase/issue/FDBKIN-31278/clarify-coordination-between-rls-policies-and-partial-indexes-for) Closes [DOCS-1761](https://linear.app/supabase/issue/DOCS-1761/explain-how-rls-policy-predicates-let-postgres-use-partial-indexes) ## Solution "Add indexes" in the RLS guide now explains that Postgres applies a policy's condition like a `where` clause. A condition that doesn't depend on the user therefore lets queries use a partial index with the same predicate. Postgres matches only some equivalent forms, so the section tells readers to write the policy condition and the index predicate the same way. The example follows the section's existing pattern, a `test_table` policy followed by the index that serves it, and the section links to the partial indexes section of the indexes guide. ## How to verify 1. Open `/docs/guides/database/postgres/row-level-security#add-indexes` on the preview. 2. The section explains that a policy's fixed condition lets queries use a partial index with the same predicate, and that both should be written the same way. 3. The section has a `test_table` policy `using ( not is_archived )`, then a partial index `where not is_archived`, in the same style as the other examples in the section. 4. The section says a `using ( is_archived is false )` policy can't use that index. 5. The "partial index" link opens the Partial indexes section of the indexes guide. ## Checks I ran `pnpm turbo run typecheck`, `pnpm turbo run lint`, and `pnpm exec oxfmt --check` on the changed file. To test the snippets, I ran them in PGlite (Postgres 17) on a 200k-row `test_table`, then ran `explain` as `authenticated` on an `order by created_at desc limit 10` query. Policies `not is_archived` and `is_archived = false` both used the partial index. Policies `is_archived is false` and `using (true)` both used a sequential scan. Behavior checked against the Postgres docs for [partial indexes](https://www.postgresql.org/docs/current/indexes-partial.html) and [CREATE POLICY](https://www.postgresql.org/docs/current/sql-createpolicy.html). I skipped the docs tests because they need Docker. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] My change follows the docs style guide. - [x] I have checked that the links resolve. ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1761](https://linear.app/supabase/issue/DOCS-1761/explain-how-rls-policy-predicates-let-postgres-use-partial-indexes). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
76b8dfd2e5 |
chore: ssl enforcement doesn't restart db (#53860)
## Problem SSL enforcement currently warns that the database will be restarted. This is no longer the case. ## Solution SSL enforcement no longer restarts the database. Update references to indicate that only non-SSL enabled connections are disabled. Only display warning when enabling SSL enforcement. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
9c0e1c7dc3 |
Add myself to humans.txt (#53948)
Add myself to humans.txt |