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:
co-authored by
Claude Sonnet 5.5
parent
54c6d606ff
commit
1c9d9423c0
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# Runs the whole suite and prints the transcripts it wrote to output/. Needs JDK 25, Maven and PostgreSQL 16+.
|
||||
# Override the connection with PG_URL, PG_USER, PG_PASSWORD (default jdbc:postgresql://localhost:5433/tenantdemo, app/app).
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
mvn -B -q test
|
||||
for f in output/*.txt; do
|
||||
echo "##### $f"
|
||||
cat "$f"
|
||||
echo
|
||||
done
|
||||
Executable
+9
@@ -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)."
|
||||
Reference in New Issue
Block a user