mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore: add workspace proxies to the backend (#7032)
Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
@ -0,0 +1,6 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE workspace_proxies
|
||||
DROP COLUMN token_hashed_secret;
|
||||
|
||||
COMMIT;
|
@ -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;
|
@ -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
|
||||
);
|
15
coderd/database/migrations/testdata/fixtures/000118_workspace_proxy_token.up.sql
vendored
Normal file
15
coderd/database/migrations/testdata/fixtures/000118_workspace_proxy_token.up.sql
vendored
Normal 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
|
||||
);
|
Reference in New Issue
Block a user