mirror of
https://github.com/block/buzz.git
synced 2026-11-27 11:41:21 +00:00
Canonical O4 slice: 04_protected_authority Final-tree source: e45553ea65b66631771c16908513f983d3c0b881 Signed-off-by: Cea Stapleton Cordasco <261786559+cea-block@users.noreply.github.com>
17 lines
716 B
PL/PgSQL
17 lines
716 B
PL/PgSQL
-- Protected-domain activation is a one-way V1 cutover. Removing the marker
|
|
-- would disable database lifecycle fencing and let an unaware release treat
|
|
-- the domain as legacy. O4 has no witnessed downgrade operation, so direct
|
|
-- marker removal remains unavailable.
|
|
|
|
CREATE FUNCTION deny_protected_domain_marker_delete() RETURNS trigger
|
|
LANGUAGE plpgsql AS $$
|
|
BEGIN
|
|
RAISE EXCEPTION 'protected domain activation cannot be removed without a separately witnessed authority model'
|
|
USING ERRCODE = 'check_violation';
|
|
END
|
|
$$;
|
|
|
|
CREATE TRIGGER protected_domain_marker_delete_guard
|
|
BEFORE DELETE ON authorization_invalidation_domains
|
|
FOR EACH ROW EXECUTE FUNCTION deny_protected_domain_marker_delete();
|