Skip to content

Add insforge pg utils for role privileges - #3

Merged
Fermionic-Lyu merged 2 commits into
mainfrom
add-insforge-pg-utils
May 24, 2026
Merged

Fermionic-Lyu merged 2 commits into
mainfrom
add-insforge-pg-utils

Conversation

@Fermionic-Lyu

@Fermionic-Lyu Fermionic-Lyu commented May 24, 2026 •

Copy link
Copy Markdown
Member

Allow project_admin to manage RLS policies without being the table owner


Summary by cubic

Adds a PostgreSQL preload utility insforge_pg_utils that lets insforge.policy_grant_role (default project_admin) manage RLS policies on allowlisted tables without being the table owner. Also updates the Postgres image workflow to skip registry login and pushes on pull requests.

  • New Features

    • New shared-preload library insforge_pg_utils with a ProcessUtility hook.
    • Supports create/alter/drop/rename policy and enable/disable RLS.
    • Runs these statements as the table owner for allowlisted tables.
    • Controlled by insforge.policy_grant_role and insforge.policy_grant_tables (comma-separated, schema-qualified).
  • Migration

    • Add insforge_pg_utils to shared_preload_libraries and restart Postgres.
    • Set insforge.policy_grant_role (optional, defaults to project_admin).
    • Set insforge.policy_grant_tables with the managed tables list.
    • No CREATE EXTENSION needed; it exposes no SQL objects.

Written for commit 8510757. Summary will update on new commits. Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="postgres/insforge_pg_utils/src/insforge_pg_utils.c">

<violation number="1" location="postgres/insforge_pg_utils/src/insforge_pg_utils.c:246">
P1: Delegated policy-management escalation also permits disabling row-level security, which bypasses policy enforcement on allowlisted tables.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread postgres/insforge_pg_utils/src/insforge_pg_utils.c
Comment thread README.md Outdated
@Fermionic-Lyu
Fermionic-Lyu merged commit ab89303 into main May 24, 2026
2 checks passed
@Fermionic-Lyu
Fermionic-Lyu deleted the add-insforge-pg-utils branch May 24, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants