Repository navigation
feat(docs): add docs on data api selective grants - #42046
Conversation
Add docs on selective grants for Data API, including the new Dashboard UI toggles. Also includes edits to the 42501 troubleshooting doc to help users when problems arise because of revoked grants.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
WalkthroughUpdates documentation for the Data API security and troubleshooting: expands hardening guidance with RLS auto-enablement and table-level privilege controls, and revises 42501 troubleshooting to focus on diagnosing and granting table-level privileges with concrete SQL examples and security notes. Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/docs/content/guides/database/hardening-data-api.mdx (1)
1-1: Fix Prettier formatting issues before merging.The pipeline indicates code style issues were found in this file. Run Prettier to fix formatting:
npx prettier --write apps/docs/content/guides/database/hardening-data-api.mdx
ChrisChinchilla
left a comment
There was a problem hiding this comment.
Minor formatting fixes
| </Admonition> | ||
|
|
||
| 1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard. | ||
| 1. Select the table you want to configure. |
There was a problem hiding this comment.
| 1. Select the table you want to configure. | |
| 2. Select the table you want to configure. |
There was a problem hiding this comment.
markdown will automatically re-number these when they are rendered right? It could be good for maintainability to keep them all as 1.
There was a problem hiding this comment.
will automatically re-number these
Yep, I personally prefer letting them auto-number (easier changes, no accidental misnumbering) but happy to follow any current formatting guidelines
There was a problem hiding this comment.
I admit I was always fussy about it, and here has been the first place I've seen so many come as "1", assuming everyone had some editor setting. It does render correctly, yes, ideally they would be correct for other non-rendered readers, such as machines (SEO, AI, etc), but it's minor, I may look to formalise it later, but i have generally been correcting them as I find them, which is also something we can automate. But all tools will treat them differently, too. tldr; I like to do markdown right, whatever that means…
|
|
||
| 1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard. | ||
| 1. Select the table you want to configure. | ||
| 1. Click the vertical dots icon to open the table menu and select "Edit table". |
There was a problem hiding this comment.
| 1. Click the vertical dots icon to open the table menu and select "Edit table". | |
| 3. Click the vertical dots icon to open the table menu and select "Edit table". |
| 1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard. | ||
| 1. Select the table you want to configure. | ||
| 1. Click the vertical dots icon to open the table menu and select "Edit table". | ||
| 1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**. |
There was a problem hiding this comment.
| 1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**. | |
| 4. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**. |
| 1. Select the table you want to configure. | ||
| 1. Click the vertical dots icon to open the table menu and select "Edit table". | ||
| 1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**. | ||
| 1. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant. |
There was a problem hiding this comment.
| 1. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant. | |
| 5. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant. |
| 1. Click the vertical dots icon to open the table menu and select "Edit table". | ||
| 1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**. | ||
| 1. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant. | ||
| 1. Click **Save**. |
There was a problem hiding this comment.
| 1. Click **Save**. | |
| 6. Click **Save**. |
| grant select, insert, update, delete on table public.your_table to anon, authenticated; | ||
| ``` | ||
|
|
||
| Note that granting privileges will allow access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data. |
There was a problem hiding this comment.
| Note that granting privileges will allow access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data. | |
| <Admonition type="note"> | |
| Granting privileges allows access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data. |
|
|
||
| Note that granting privileges will allow access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data. | ||
|
|
||
| For more information, see [Adjusting table-level privileges](/docs/guides/database/hardening-data-api#adjusting-table-level-privileges). |
There was a problem hiding this comment.
| For more information, see [Adjusting table-level privileges](/docs/guides/database/hardening-data-api#adjusting-table-level-privileges). | |
| For more information, see [Adjusting table-level privileges](/docs/guides/database/hardening-data-api#adjusting-table-level-privileges). | |
| </Admonition> |
| </Admonition> | ||
|
|
||
| 1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard. | ||
| 1. Select the table you want to configure. |
There was a problem hiding this comment.
markdown will automatically re-number these when they are rendered right? It could be good for maintainability to keep them all as 1.
|
|
||
| You can use an [event trigger](/docs/guides/database/postgres/event-triggers#example-trigger-function---auto-enable-row-level-security) to automatically enable RLS whenever a new table is created in the `public` schema. This ensures that no table is accidentally left exposed without RLS protection. | ||
|
|
||
| ## Adjusting table-level privileges |
There was a problem hiding this comment.
could just simplify to Table privileges or Table Grants?
Braintrust eval report
|
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Documentation update
What is the current behavior?
No documentation exists for Data API selective grants or the new Dashboard UI toggles for managing them.
What is the new behavior?
Add docs on selective grants for Data API, including the new Dashboard UI toggles. Also includes edits to the 42501 troubleshooting doc to help users when problems arise because of revoked grants.
Additional context
Resolves DOCS-666
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.