Skip to content

Commit 51967a5

Browse files
committed
update external agent credentials summary and adjust authorization checks for new endpoint
1 parent 682ea60 commit 51967a5

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

coderd/coderdtest/swaggerparser.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ func assertSecurityDefined(t *testing.T, comment SwaggerComment) {
310310
comment.router == "/" ||
311311
comment.router == "/users/login" ||
312312
comment.router == "/users/otp/request" ||
313-
comment.router == "/users/otp/change-password" {
313+
comment.router == "/users/otp/change-password" ||
314+
comment.router == "/init-script/{os}/{arch}" {
314315
return // endpoints do not require authorization
315316
}
316317
assert.Containsf(t, authorizedSecurityTags, comment.security, "@Security must be either of these options: %v", authorizedSecurityTags)
@@ -361,7 +362,8 @@ func assertProduce(t *testing.T, comment SwaggerComment) {
361362
(comment.router == "/licenses/{id}" && comment.method == "delete") ||
362363
(comment.router == "/debug/coordinator" && comment.method == "get") ||
363364
(comment.router == "/debug/tailnet" && comment.method == "get") ||
364-
(comment.router == "/workspaces/{workspace}/acl" && comment.method == "patch") {
365+
(comment.router == "/workspaces/{workspace}/acl" && comment.method == "patch") ||
366+
(comment.router == "/init-script/{os}/{arch}" && comment.method == "get") {
365367
return // Exception: HTTP 200 is returned without response entity
366368
}
367369

coderd/database/migrations/000358_external_agents.down.sql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
ALTER TABLE template_versions DROP COLUMN has_external_agent;
2-
31
DROP VIEW template_version_with_user;
2+
DROP VIEW workspace_build_with_user;
3+
4+
ALTER TABLE template_versions DROP COLUMN has_external_agent;
5+
ALTER TABLE workspace_builds DROP COLUMN has_external_agent;
46

57
-- Recreate `template_version_with_user` as defined in dump.sql
68
CREATE VIEW template_version_with_user AS
@@ -32,10 +34,7 @@ FROM
3234

3335
COMMENT ON VIEW template_version_with_user IS 'Joins in the username + avatar url of the created by user.';
3436

35-
ALTER TABLE workspace_builds DROP COLUMN has_external_agent;
36-
37-
DROP VIEW workspace_build_with_user;
38-
37+
-- Recreate `workspace_build_with_user` as defined in dump.sql
3938
CREATE VIEW workspace_build_with_user AS
4039
SELECT
4140
workspace_builds.id,
@@ -75,3 +74,5 @@ FROM
7574
);
7675

7776
COMMENT ON VIEW workspace_build_with_user IS 'Joins in the username + avatar url of the initiated by user.';
77+
78+

coderd/workspaceagents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ func convertWorkspaceAgentLog(logEntry database.WorkspaceAgentLog) codersdk.Work
21862186
}
21872187
}
21882188

2189-
// @Summary Get external agent credentials
2189+
// @Summary Get workspace external agent credentials
21902190
// @ID get-workspace-external-agent-credentials
21912191
// @Security CoderSessionToken
21922192
// @Produce json

0 commit comments

Comments
 (0)