MCPcopy Index your code
hub / github.com/coder/coder / assertSecurityDefined

Function assertSecurityDefined

coderd/coderdtest/swaggerparser.go:344–361  ·  view source on GitHub ↗
(t *testing.T, comment SwaggerComment)

Source from the content-addressed store, hash-verified

342}
343
344func assertSecurityDefined(t *testing.T, comment SwaggerComment) {
345 authorizedSecurityTags := []string{
346 "CoderSessionToken",
347 "CoderProvisionerKey",
348 }
349
350 if comment.router == "/api/v2/updatecheck" ||
351 comment.router == "/api/v2/buildinfo" ||
352 comment.router == "/api/v2/" ||
353 comment.router == "/api/v2/auth/scopes" ||
354 comment.router == "/api/v2/users/login" ||
355 comment.router == "/api/v2/users/otp/request" ||
356 comment.router == "/api/v2/users/otp/change-password" ||
357 comment.router == "/api/v2/init-script/{os}/{arch}" {
358 return // endpoints do not require authorization
359 }
360 assert.Containsf(t, authorizedSecurityTags, comment.security, "@Security must be either of these options: %v", authorizedSecurityTags)
361}
362
363func assertAccept(t *testing.T, comment SwaggerComment) {
364 var hasRequestBody bool

Callers 1

VerifySwaggerDefinitionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected