Proposal: lint for RLS policies whose role lacks the table privilege (policy_without_privilege)

未关闭
#196 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@larik15 已经在做这个了。

开始于 2026年10月5日。

  • #197 来自 @larik15 —— 未关闭
  • #198 来自 @mattmuller —— 未关闭
  • #200 来自 @mattmuller —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
1/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
postgresql, sql
领域
databases, testing

调研方向

The issue describes a tested implementation, but a linked open pull request (#197) already carries the work. Review that PR for the lint, docs, tests, and expected output; the proposed lint is done when its behavior and output match the issue and the test suite passes on the stated PostgreSQL versions.

由索引模型根据 Issue 内容生成。

描述

What the lint catches

A permissive RLS policy for anon or authenticated on a table in an exposed schema, where that role has no table privilege for the policy's command (SELECT/INSERT/UPDATE/DELETE). Postgres checks privileges before RLS, so the policy never takes effect and API requests fail with 42501 permission denied instead of being filtered by the policy. Proposed as an INFO-level lint, 0031_policy_without_privilege.

Why it matters now

Supabase no longer grants anon/authenticated privileges on new public tables automatically: for new projects since 2026-05-30, and for all projects on 2026-10-30 (changelog). A migration that creates a table and its policies but no GRANT now ships a policy that silently does nothing, and none of the existing lints flag a policy that has no effect because the targeted role lacks the table privilege. I searched open and closed issues and PRs in this repo and found nothing covering this.

Status

A tested implementation is ready (lint, docs, tests, expected output). The full suite passes on supabase/postgres 15.14.1.169 and 17.6.1.169. I'll open a PR linking this issue right after filing it. Happy to adjust the approach or renumber if you prefer.

主要语言
PLpgSQL
星标
284
派生
110
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

supabase/splinter 的其他 Issue

查看 supabase/splinter 的全部 Issue

相似的 Issue

更多 Databases Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。