mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add schema for key rotation (#14662)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP TABLE "crypto_keys";
|
||||
DROP TYPE "crypto_key_feature";
|
||||
@@ -0,0 +1,16 @@
|
||||
CREATE TYPE crypto_key_feature AS ENUM (
|
||||
'workspace_apps',
|
||||
'oidc_convert',
|
||||
'tailnet_resume'
|
||||
);
|
||||
|
||||
CREATE TABLE crypto_keys (
|
||||
feature crypto_key_feature NOT NULL,
|
||||
sequence integer NOT NULL,
|
||||
secret text NULL,
|
||||
secret_key_id text NULL REFERENCES dbcrypt_keys(active_key_digest),
|
||||
starts_at timestamptz NOT NULL,
|
||||
deletes_at timestamptz NULL,
|
||||
PRIMARY KEY (feature, sequence)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
INSERT INTO crypto_keys (feature, sequence, starts_at, secret) VALUES
|
||||
('workspace_apps', 1, now(), 'abc'),
|
||||
('oidc_convert', 1, now(), 'def'),
|
||||
('tailnet_resume', 1, now(), 'ghi');
|
||||
Reference in New Issue
Block a user