fix: enforce tenant isolation on credit storage
CI (SIAX Cloud) / integration (push) Skipped
CI (SIAX Cloud) / sonar (push) Skipped
masterplan-lock / check (push) Successful in 5s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 6s
CI (SIAX Cloud) / security (push) Successful in 20s
Security Scan (SIAX Cloud) / security (push) Successful in 19s
CI (SIAX Cloud) / security (pull_request) Successful in 16s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / quality (push) Successful in 52s
CI (SIAX Cloud) / integration (pull_request) Successful in 51s
CI (SIAX Cloud) / quality (pull_request) Successful in 1m9s
CI (SIAX Cloud) / integration (push) Skipped
CI (SIAX Cloud) / sonar (push) Skipped
masterplan-lock / check (push) Successful in 5s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 6s
CI (SIAX Cloud) / security (push) Successful in 20s
Security Scan (SIAX Cloud) / security (push) Successful in 19s
CI (SIAX Cloud) / security (pull_request) Successful in 16s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / quality (push) Successful in 52s
CI (SIAX Cloud) / integration (pull_request) Successful in 51s
CI (SIAX Cloud) / quality (pull_request) Successful in 1m9s
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
-- The GUC is transaction-local and supplied only by trusted server code.
|
||||
-- RLS is a defense against missing tenant predicates, not authentication.
|
||||
ALTER TABLE opt_credit_accounts ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE opt_credit_accounts FORCE ROW LEVEL SECURITY;
|
||||
CREATE POLICY opt_credit_accounts_tenant ON opt_credit_accounts
|
||||
USING (tenant_id = current_setting('app.opt_credit_tenant_id', true))
|
||||
WITH CHECK (tenant_id = current_setting('app.opt_credit_tenant_id', true));
|
||||
|
||||
ALTER TABLE opt_credit_reservations ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE opt_credit_reservations FORCE ROW LEVEL SECURITY;
|
||||
CREATE POLICY opt_credit_reservations_tenant ON opt_credit_reservations
|
||||
USING (tenant_id = current_setting('app.opt_credit_tenant_id', true))
|
||||
WITH CHECK (tenant_id = current_setting('app.opt_credit_tenant_id', true));
|
||||
|
||||
ALTER TABLE opt_credit_events ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE opt_credit_events FORCE ROW LEVEL SECURITY;
|
||||
CREATE POLICY opt_credit_events_tenant ON opt_credit_events
|
||||
USING (tenant_id = current_setting('app.opt_credit_tenant_id', true))
|
||||
WITH CHECK (tenant_id = current_setting('app.opt_credit_tenant_id', true));
|
||||
|
||||
ALTER TABLE opt_credit_purchases ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE opt_credit_purchases FORCE ROW LEVEL SECURITY;
|
||||
CREATE POLICY opt_credit_purchases_tenant ON opt_credit_purchases
|
||||
USING (tenant_id = current_setting('app.opt_credit_tenant_id', true))
|
||||
WITH CHECK (tenant_id = current_setting('app.opt_credit_tenant_id', true));
|
||||
Reference in New Issue
Block a user