mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Add agent authentication based on instance ID (#336)
* feat: Add agent authentication based on instance ID Each cloud has it's own unique instance identity signatures, which can be used for zero-token authentication. This change adds support for tracking by "instance_id", and automatically authenticating with Google Cloud. * Add test for CLI * Fix workspace agent request name * Fix race with adding to wait group * Fix name of instance identity token
This commit is contained in:
+12
-1
@@ -328,6 +328,16 @@ WHERE
|
||||
LIMIT
|
||||
1;
|
||||
|
||||
-- name: GetWorkspaceResourceByInstanceID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
workspace_resource
|
||||
WHERE
|
||||
instance_id = @instance_id :: text
|
||||
ORDER BY
|
||||
created_at;
|
||||
|
||||
-- name: GetWorkspaceResourcesByHistoryID :many
|
||||
SELECT
|
||||
*
|
||||
@@ -596,12 +606,13 @@ INSERT INTO
|
||||
id,
|
||||
created_at,
|
||||
workspace_history_id,
|
||||
instance_id,
|
||||
type,
|
||||
name,
|
||||
workspace_agent_token
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6) RETURNING *;
|
||||
($1, $2, $3, $4, $5, $6, $7) RETURNING *;
|
||||
|
||||
-- name: UpdateAPIKeyByID :exec
|
||||
UPDATE
|
||||
|
||||
Reference in New Issue
Block a user