Skip to content

Add support to automatically use a non-privileged role #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kmewhort
Copy link
Contributor

While the force option for policies solves the issue of a table owner bypassing RLS, we hit other issues removing SUPERUSER from the primary database account used for migrations and other tasks.

These changes add an alternative approach where the session is optionally switched to another non-privileged role whenever RLS is enabled.

@sbiastoch
Copy link
Member

This is actually a very nice idea! We face the same issues like you described, which makes schema modifications here and there a bit brittle. The only issue I see is that the default state is unsafe. If due to a bug RLS was not enabled, no RLS policies are applied. I am also wondering if changing the role might have any side effects on transaction level.

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