mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
feat: add keys to organization provision daemons (#14627)
This commit is contained in:
@@ -33,7 +33,8 @@ INSERT INTO
|
||||
last_seen_at,
|
||||
"version",
|
||||
organization_id,
|
||||
api_version
|
||||
api_version,
|
||||
key_id
|
||||
)
|
||||
VALUES (
|
||||
gen_random_uuid(),
|
||||
@@ -44,14 +45,16 @@ VALUES (
|
||||
@last_seen_at,
|
||||
@version,
|
||||
@organization_id,
|
||||
@api_version
|
||||
@api_version,
|
||||
@key_id
|
||||
) ON CONFLICT("organization_id", "name", LOWER(COALESCE(tags ->> 'owner'::text, ''::text))) DO UPDATE SET
|
||||
provisioners = @provisioners,
|
||||
tags = @tags,
|
||||
last_seen_at = @last_seen_at,
|
||||
"version" = @version,
|
||||
api_version = @api_version,
|
||||
organization_id = @organization_id
|
||||
organization_id = @organization_id,
|
||||
key_id = @key_id
|
||||
RETURNING *;
|
||||
|
||||
-- name: UpdateProvisionerDaemonLastSeenAt :exec
|
||||
|
||||
@@ -37,6 +37,23 @@ WHERE
|
||||
AND
|
||||
lower(name) = lower(@name);
|
||||
|
||||
-- name: ListProvisionerKeysByOrganizationExcludeReserved :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
provisioner_keys
|
||||
WHERE
|
||||
organization_id = $1
|
||||
AND
|
||||
-- exclude reserved built-in key
|
||||
id != '00000000-0000-0000-0000-000000000001'::uuid
|
||||
AND
|
||||
-- exclude reserved user-auth key
|
||||
id != '00000000-0000-0000-0000-000000000002'::uuid
|
||||
AND
|
||||
-- exclude reserved psk key
|
||||
id != '00000000-0000-0000-0000-000000000003'::uuid;
|
||||
|
||||
-- name: ListProvisionerKeysByOrganization :many
|
||||
SELECT
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user