Add rls-safe-mode module: Hibernate 8.0.0.CR2 HQL safe mode and PostgreSQL row-level security for @TenantId

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
This commit is contained in:
Ankur Mhatre
2026-12-01 08:08:31 +05:30
co-authored by Claude Sonnet 5.5
parent 54c6d606ff
commit 1c9d9423c0
20 changed files with 817 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Creates the role and database the tests expect on a PostgreSQL you already run.
# The application role must NOT be a superuser and must NOT have BYPASSRLS, or row-level security is skipped.
# Usage: PGHOST=localhost PGPORT=5432 PGUSER=postgres ./scripts/setup-postgres.sh
set -euo pipefail
psql -v ON_ERROR_STOP=1 -c "create role app login password 'app' nosuperuser nobypassrls"
psql -v ON_ERROR_STOP=1 -c "create database tenantdemo owner app"
echo "Done. Tests connect to \${PG_URL:-jdbc:postgresql://localhost:5433/tenantdemo} as app/app."
echo "The superuser comparison in 03-isolation connects as 'postgres' with an empty password (trust auth)."