(t *testing.T, comment SwaggerComment)
| 342 | } |
| 343 | |
| 344 | func 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 | |
| 363 | func assertAccept(t *testing.T, comment SwaggerComment) { |
| 364 | var hasRequestBody bool |
no outgoing calls
no test coverage detected