feat: add keys to organization provision daemons (#14627)

This commit is contained in:
Garrett Delfosse
2024-09-16 16:02:08 -04:00
committed by GitHub
parent 4afce19fb7
commit 335eb05223
32 changed files with 728 additions and 72 deletions

View File

@ -0,0 +1,5 @@
ALTER TABLE provisioner_daemons DROP COLUMN key_id;
DELETE FROM provisioner_keys WHERE name = 'built-in';
DELETE FROM provisioner_keys WHERE name = 'psk';
DELETE FROM provisioner_keys WHERE name = 'user-auth';

View File

@ -0,0 +1,6 @@
INSERT INTO provisioner_keys (id, created_at, organization_id, name, hashed_secret, tags) VALUES ('00000000-0000-0000-0000-000000000001'::uuid, NOW(), (SELECT id FROM organizations WHERE is_default = true), 'built-in', ''::bytea, '{}');
INSERT INTO provisioner_keys (id, created_at, organization_id, name, hashed_secret, tags) VALUES ('00000000-0000-0000-0000-000000000002'::uuid, NOW(), (SELECT id FROM organizations WHERE is_default = true), 'user-auth', ''::bytea, '{}');
INSERT INTO provisioner_keys (id, created_at, organization_id, name, hashed_secret, tags) VALUES ('00000000-0000-0000-0000-000000000003'::uuid, NOW(), (SELECT id FROM organizations WHERE is_default = true), 'psk', ''::bytea, '{}');
ALTER TABLE provisioner_daemons ADD COLUMN key_id UUID REFERENCES provisioner_keys(id) ON DELETE CASCADE DEFAULT '00000000-0000-0000-0000-000000000001'::uuid NOT NULL;
ALTER TABLE provisioner_daemons ALTER COLUMN key_id DROP DEFAULT;