chore: add workspace proxies to the backend (#7032)

Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
Steven Masley
2023-04-17 14:57:21 -05:00
committed by GitHub
parent dc5e16ae22
commit 658246d5f2
61 changed files with 3641 additions and 757 deletions

View File

@ -0,0 +1,6 @@
BEGIN;
ALTER TABLE workspace_proxies
DROP COLUMN token_hashed_secret;
COMMIT;

View File

@ -0,0 +1,22 @@
BEGIN;
-- It's difficult to generate tokens for existing proxies, so we'll just delete
-- them if they exist.
--
-- No one is using this feature yet as of writing this migration, so this is
-- fine.
DELETE FROM workspace_proxies;
ALTER TABLE workspace_proxies
ADD COLUMN token_hashed_secret bytea NOT NULL;
COMMENT ON COLUMN workspace_proxies.token_hashed_secret
IS 'Hashed secret is used to authenticate the workspace proxy using a session token.';
COMMENT ON COLUMN workspace_proxies.deleted
IS 'Boolean indicator of a deleted workspace proxy. Proxies are soft-deleted.';
COMMENT ON COLUMN workspace_proxies.icon
IS 'Expects an emoji character. (/emojis/1f1fa-1f1f8.png)';
COMMIT;

View File

@ -1,14 +0,0 @@
INSERT INTO workspace_proxies
(id, name, display_name, icon, url, wildcard_hostname, created_at, updated_at, deleted)
VALUES
(
'cf8ede8c-ff47-441f-a738-d92e4e34a657',
'us',
'United States',
'/emojis/us.png',
'https://us.coder.com',
'*.us.coder.com',
'2023-03-30 12:00:00.000+02',
'2023-03-30 12:00:00.000+02',
false
);

View File

@ -0,0 +1,15 @@
INSERT INTO workspace_proxies
(id, name, display_name, icon, url, wildcard_hostname, created_at, updated_at, deleted, token_hashed_secret)
VALUES
(
'cf8ede8c-ff47-441f-a738-d92e4e34a657',
'us',
'United States',
'/emojis/us.png',
'https://us.coder.com',
'*.us.coder.com',
'2023-03-30 12:00:00.000+02',
'2023-03-30 12:00:00.000+02',
false,
'abc123'::bytea
);