build(dev): connect as non-superuser role so row-level security applies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-21 23:48:02 +01:00
1 parent e9c7394c8b
commit c615c21af1
2 files changed
+12 -5

No files matched your search

+5 -5
View File
@@ -4,13 +4,13 @@ services:
timescaledb: timescaledb:
image: timescale/timescaledb:2.30.1-pg16 image: timescale/timescaledb:2.30.1-pg16
environment: environment:
POSTGRES_USER: uptime POSTGRES_PASSWORD: postgres
POSTGRES_PASSWORD: uptime
POSTGRES_DB: uptime
ports: ["5432:5432"] ports: ["5432:5432"]
volumes: [pgdata:/var/lib/postgresql/data] volumes:
- pgdata:/var/lib/postgresql/data
- ./deploy/dev/postgres-init.sql:/docker-entrypoint-initdb.d/10-uptime.sql:ro
healthcheck: healthcheck:
test: ["CMD", "pg_isready", "-U", "uptime"] test: ["CMD", "pg_isready", "-U", "uptime", "-d", "uptime"]
interval: 2s interval: 2s
retries: 30 retries: 30
+7
View File
@@ -0,0 +1,7 @@
-- Superusers bypass row-level security even with FORCE, so the application
-- must connect as an ordinary role for tenant isolation to be enforced.
CREATE ROLE uptime LOGIN PASSWORD 'uptime';
CREATE DATABASE uptime OWNER uptime;
\connect uptime
CREATE EXTENSION IF NOT EXISTS timescaledb;
CREATE EXTENSION IF NOT EXISTS citext;