feat(backend-postgres): isolate rows per owner with row-level security #44
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core!44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/backend-postgres-row-isolation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
One database can hold the data of several owners that never see each other's rows, including when a query forgets its filter.
config.sessionSettings: function returning settings applied to each statement for one transaction only, so pooled connections never keep them.rowIsolationSql(): DDL enabling and forcing row-level security on a table, comparing its owner column with a session setting.assertRowSecurityRole(): start-up check that the role does not bypass policies.Without an owner, protected tables look empty and refuse writes. The adapter behaves as before when
sessionSettingsis absent.A restricted role cannot create tables: automatic table creation does not apply to it, tables come from migrations (README and new
HOWTO.md).Depends on #33
This branch is built on
feat/backend-unique-properties. Until #33 is merged, the diff also shows its commits; merge #33 first.Tests
RowIsolation.test.tsneeds a PostgreSQL database and is skipped without one.To decide
RowIsolationOptionshas noInterfacesuffix.src/__test__, like the existing ones.Closes #42
🤖 Generated with Claude Code