Organize device inventory by customer and restrict token access to its audience

This commit is contained in:
2026-11-17 21:55:24 +01:00
parent aeb9adc649
commit 0afaca1d64
39 changed files with 1950 additions and 225 deletions
@@ -0,0 +1,13 @@
-- A bootstrap worker published with the operator's starter release for this customer.
-- The administrator's explicit per-customer rotation file takes precedence.
CREATE TABLE customer_starter_workers (
tenant_id uuid NOT NULL REFERENCES tenants,
platform text NOT NULL,
sha256 text NOT NULL CHECK(sha256 ~ '^[0-9a-f]{64}$'),
size_bytes bigint NOT NULL CHECK(size_bytes BETWEEN 1 AND 268435456),
PRIMARY KEY(tenant_id,platform)
);
ALTER TABLE customer_starter_workers ENABLE ROW LEVEL SECURITY;
ALTER TABLE customer_starter_workers FORCE ROW LEVEL SECURITY;
CREATE POLICY tenant_scope ON customer_starter_workers USING (tenant_id::text=current_setting('app.tenant_id',true));
GRANT SELECT,INSERT ON customer_starter_workers TO rmm_app;