Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR moves RLS policy references from the Auth domain to the Database domain by updating docs links, component imports, navigation routes, layouts, menu structure, and a legacy redirect; one test import was adjusted to the Database policy utils. ChangesMigrate RLS Policies from Auth to Database Module
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. |
🎭 Playwright Test ResultsDetails
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/studio/components/interfaces/Integrations/Queues/QueueTab.tsx (1)
183-189:⚠️ Potential issue | 🟡 MinorStale "Auth" label when linking to Database policies.
The link now routes to
/project/${ref}/database/policies, but the button text still says "Auth policy/policies". Update the label to match the new location so the button and its destination stay consistent with the rest of the PR's rename.Proposed fix
- href={`/project/${ref}/database/policies?search=${queueTable?.id}&schema=pgmq`} - > - Auth {queuePolicies.length > 1 ? 'policies' : 'policy'} + href={`/project/${ref}/database/policies?search=${queueTable?.id}&schema=pgmq`} + > + RLS {queuePolicies.length > 1 ? 'policies' : 'policy'}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/studio/components/interfaces/Integrations/Queues/QueueTab.tsx` around lines 183 - 189, The button label is stale ("Auth ...") in QueueTab.tsx while the Link routes to the database policies page; update the Link/Button text to reflect the new destination by replacing the "Auth {queuePolicies.length > 1 ? 'policies' : 'policy'}" fragment with "Database {queuePolicies.length > 1 ? 'policies' : 'policy'}" (the change should be made where the Link component using href={`/project/${ref}/database/policies?search=${queueTable?.id}&schema=pgmq`} and the queuePolicies and queueTable?.id variables are referenced).
🧹 Nitpick comments (1)
apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts (1)
75-80: Point the Policies menu URL directly to the new database route.The
rightIconnow indicates this item navigates outside the Auth section, buturlstill resolves to/project/${ref}/auth/policies. Relying on the redirect works, but it adds an extra hop and means theProductMenuwill mark the item as "active" based on the old auth path rather than the real destination. Prefer linking to the canonical URL directly.♻️ Suggested change
{ name: 'Policies', key: 'policies', - url: `${baseUrl}/policies`, + url: `/project/${ref}/database/policies`, rightIcon: ExternalLinkIcon, items: [], },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts` around lines 75 - 80, The Policies menu item (name: 'Policies', key: 'policies') currently uses url: `${baseUrl}/policies` which points to the auth route and causes an extra redirect; update its url to the canonical database route (e.g. `/project/${ref}/database/policies`) so the ProductMenu links directly to the DB policies page and active state matches the real destination.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@apps/studio/components/interfaces/Integrations/Queues/QueueTab.tsx`:
- Around line 183-189: The button label is stale ("Auth ...") in QueueTab.tsx
while the Link routes to the database policies page; update the Link/Button text
to reflect the new destination by replacing the "Auth {queuePolicies.length > 1
? 'policies' : 'policy'}" fragment with "Database {queuePolicies.length > 1 ?
'policies' : 'policy'}" (the change should be made where the Link component
using
href={`/project/${ref}/database/policies?search=${queueTable?.id}&schema=pgmq`}
and the queuePolicies and queueTable?.id variables are referenced).
---
Nitpick comments:
In `@apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts`:
- Around line 75-80: The Policies menu item (name: 'Policies', key: 'policies')
currently uses url: `${baseUrl}/policies` which points to the auth route and
causes an extra redirect; update its url to the canonical database route (e.g.
`/project/${ref}/database/policies`) so the ProductMenu links directly to the DB
policies page and active state matches the real destination.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: bdaf3eb0-b80a-402e-8931-fbefcebbf7d8
📒 Files selected for processing (62)
apps/docs/content/guides/api/securing-your-api.mdxapps/docs/content/guides/auth/general-configuration.mdxapps/docs/content/guides/auth/oauth-server/token-security.mdxapps/docs/content/guides/deployment/going-into-prod.mdxapps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsxapps/studio/components/interfaces/App/CommandMenu/PolicySearchResults.tsxapps/studio/components/interfaces/Auth/BasicAuthSettingsForm.tsxapps/studio/components/interfaces/Database/Policies/Policies.constants.tsapps/studio/components/interfaces/Database/Policies/Policies.tsxapps/studio/components/interfaces/Database/Policies/Policies.types.tsapps/studio/components/interfaces/Database/Policies/Policies.utils.test.tsapps/studio/components/interfaces/Database/Policies/Policies.utils.tsapps/studio/components/interfaces/Database/Policies/PoliciesDataContext.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditor/PolicyAllowedOperation.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditor/PolicyDefinition.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditor/PolicyEditorFooter.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditor/PolicyName.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditor/PolicyRoles.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditor/index.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorModal/PolicyEditorModal.constants.tsapps/studio/components/interfaces/Database/Policies/PolicyEditorModal/PolicyEditorModalTitle.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorModal/index.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/LockedQuerySection.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/PolicyDetailsV2.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/PolicyEditorPanel.utils.tsapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/PolicyEditorPanelHeader.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/PolicyTemplates.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/QueryError.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/RLSCodeEditor.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/index.tsxapps/studio/components/interfaces/Database/Policies/PolicyReview.tsxapps/studio/components/interfaces/Database/Policies/PolicySelection.tsxapps/studio/components/interfaces/Database/Policies/PolicyTableRow/PolicyRow.tsxapps/studio/components/interfaces/Database/Policies/PolicyTableRow/PolicyTableRow.types.tsapps/studio/components/interfaces/Database/Policies/PolicyTableRow/PolicyTableRow.utils.test.tsapps/studio/components/interfaces/Database/Policies/PolicyTableRow/PolicyTableRow.utils.tsapps/studio/components/interfaces/Database/Policies/PolicyTableRow/PolicyTableRowHeader.tsxapps/studio/components/interfaces/Database/Policies/PolicyTableRow/index.tsxapps/studio/components/interfaces/Database/Policies/PolicyTemplates/PolicyTemplates.constants.tsapps/studio/components/interfaces/Database/Policies/PolicyTemplates/TemplatePreview.tsxapps/studio/components/interfaces/Database/Policies/PolicyTemplates/TemplatesList.tsxapps/studio/components/interfaces/Database/Policies/PolicyTemplates/index.tsxapps/studio/components/interfaces/Integrations/Queues/QueueTab.tsxapps/studio/components/interfaces/Linter/Linter.utils.tsxapps/studio/components/interfaces/Realtime/Policies.tsxapps/studio/components/interfaces/Storage/Storage.types.tsapps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicies.tsxapps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketRow.tsxapps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsxapps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsxapps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsxapps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsxapps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsxapps/studio/components/layouts/AuthLayout/Auth.Commands.tsxapps/studio/components/layouts/AuthLayout/AuthLayout.utils.tsapps/studio/components/layouts/DatabaseLayout/Database.Commands.tsxapps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsxapps/studio/components/layouts/ProjectSettingsLayout/ProjectSettings.Commands.tsxapps/studio/components/layouts/TableEditorLayout/EntityListItem.tsxapps/studio/components/ui/AIAssistantPanel/AIAssistant.utils.tsapps/studio/next.config.tsapps/studio/pages/project/[ref]/database/policies.tsx
ChrisChinchilla
left a comment
There was a problem hiding this comment.
Makes sense, would also help the confusion people have around anon with auth and Postgres roles.
|
Closing in favor of #47433 |
## Context Previous PR was [here](#45143) but it got stale with lots of conflicts so figured it'll be easier redo it off the latest master Moves policies page from Auth to Database under an Access Control section along with Roles. This moves all existing files, applies redirects, and updates urls to point to the new route <img width="274" height="412" alt="image" src="https://github.com/user-attachments/assets/7952c185-64ae-4355-ba36-45397efe1787" /> <img width="453" height="471" alt="image" src="https://github.com/user-attachments/assets/04b3dcb3-48a5-4049-9893-d01109fb46a9" /> ## To test - [ ] Verify that policies now live under Database correctly <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a quick navigation shortcut to open **Database > Policies (RLS)**. * **Bug Fixes** * Updated Policies and RLS-related links across the product to open the **Database policies** area (menus, command palette, context actions, alerts, and link-outs). * Added a permanent redirect from the old **auth policies** URL to the new **database policies** URL. * **Documentation** * Updated RLS Dashboard and security checklist instructions to reference **Database > Policies**. * **Tests** * Adjusted automated tests to validate the new Policies route. <!-- end of auto-generated comment: release notes by coderabbit.ai -->


Proposal to move policies page from Auth to Database under an Access Control section along with Roles. This moves all existing files, applies redirects, and updates urls to point to the new route.
Summary by CodeRabbit
New Features
Documentation
Navigation & UI Updates