Repository navigation
Docs/rls grant truncate fixes - #48388
tagadearpit wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
@tagadearpit is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe PR updates PostgreSQL security documentation with guidance on default privileges, RLS coverage, permission revocation, and an INSERT policy schema example. ChangesRLS documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
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/postgres/row-level-security.mdx (1)
18-28: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winSeparate existing grants from future default privileges.
REVOKE ON TABLEonly affects the named existing table, but the RLS note implies this covers Supabase’s default table grants for future objects. Keepinformation_schema.role_table_grantsfor current grants, and either add explicitALTER DEFAULT PRIVILEGES/pg_default_aclguidance or clearly scope the RLS section to existing objects only.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/content/guides/database/postgres/row-level-security.mdx` around lines 18 - 28, Clarify the privilege guidance so existing-table grants are distinguished from future default privileges: update the RLS section in apps/docs/content/guides/database/postgres/row-level-security.mdx (lines 18-28) to scope REVOKE ON TABLE guidance to existing objects or add ALTER DEFAULT PRIVILEGES/pg_default_acl instructions, while preserving information_schema.role_table_grants for current grants. Apply the corresponding clarification at apps/docs/content/guides/deployment/going-into-prod.mdx (line 29), explicitly distinguishing current grants from future defaults.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/content/guides/database/postgres/row-level-security.mdx`:
- Line 213: Correct the profiles table definition by removing the duplicated
uuid type from the id column declaration, changing `id uuid uuid primary key` to
a single uuid type followed by the primary key constraint.
---
Outside diff comments:
In `@apps/docs/content/guides/database/postgres/row-level-security.mdx`:
- Around line 18-28: Clarify the privilege guidance so existing-table grants are
distinguished from future default privileges: update the RLS section in
apps/docs/content/guides/database/postgres/row-level-security.mdx (lines 18-28)
to scope REVOKE ON TABLE guidance to existing objects or add ALTER DEFAULT
PRIVILEGES/pg_default_acl instructions, while preserving
information_schema.role_table_grants for current grants. Apply the corresponding
clarification at apps/docs/content/guides/deployment/going-into-prod.mdx (line
29), explicitly distinguishing current grants from future defaults.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5380db9a-57be-49db-8b20-1e537764824f
📒 Files selected for processing (2)
apps/docs/content/guides/database/postgres/row-level-security.mdxapps/docs/content/guides/deployment/going-into-prod.mdx
| -- 1. Create table | ||
| create table profiles ( | ||
| id uuid primary key, | ||
| id uuid uuid primary key, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "File context:"
sed -n '200,220p' apps/docs/content/guides/database/postgres/row-level-security.mdx
echo
echo "Postgres CREATE TABLE attribute_type examples in PostgreSQL docs availability is not local: checking local source context and simple parser grammar expectation"
python3 - <<'PY'
from pathlib import Path
p = Path('apps/docs/content/guides/database/postgres/row-level-security.mdx')
text = p.read_text()
needles = ['id uuid uuid primary key', 'id uuid primary key']
for n in needles:
print(n, text.find(n))
# Deterministic check against documented SQL grammar property:
# SQL create_table column_def ::= column_name data_type ... can include zero or one data_type.
# Two identical data_type tokens is not the documented syntax.
print('two type tokens after column name:', ' id uuid uuid primary key,' in text)
PYRepository: supabase/supabase
Length of output: 1093
Fix the duplicated uuid type.
The profiles table example uses invalid CREATE TABLE syntax with id uuid uuid primary key; change it to id uuid primary key.
Proposed fix
- id uuid uuid primary key,
+ id uuid primary key,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| id uuid uuid primary key, | |
| id uuid primary key, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/docs/content/guides/database/postgres/row-level-security.mdx` at line
213, Correct the profiles table definition by removing the duplicated uuid type
from the id column declaration, changing `id uuid uuid primary key` to a single
uuid type followed by the primary key constraint.
I have read the CONTRIBUTING.md file.
YES/NO
What kind of change does this PR introduce?
Bug fix, feature, docs update, ...
What is the current behavior?
Please link any relevant issues here.
What is the new behavior?
Feel free to include screenshots if it includes visual changes.
Additional context
Add any other context or screenshots.
Summary by CodeRabbit
TRUNCATEoperations.