Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: improve validation of Security tag in swaggerparser#15660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
defelmnq merged 5 commits intomainfrom15605-improve-swagger-parser
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletioncoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 1 addition & 1 deletioncoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

7 changes: 6 additions & 1 deletioncoderd/coderdtest/swaggerparser.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -300,6 +300,11 @@ func assertPathParametersDefined(t *testing.T, comment SwaggerComment) {
}

func assertSecurityDefined(t *testing.T, comment SwaggerComment) {
authorizedSecurityTags := []string{
"CoderSessionToken",
"CoderProvisionerKey",
}

if comment.router == "/updatecheck" ||
comment.router == "/buildinfo" ||
comment.router == "/" ||
Expand All@@ -308,7 +313,7 @@ func assertSecurityDefined(t *testing.T, comment SwaggerComment) {
comment.router == "/users/otp/change-password" {
return // endpoints do not require authorization
}
assert.Equal(t,"CoderSessionToken", comment.security, "@Security must beequal CoderSessionToken")
assert.Containsf(t,authorizedSecurityTags, comment.security, "@Security must beeither of these options: %v", authorizedSecurityTags)
}

func assertAccept(t *testing.T, comment SwaggerComment) {
Expand Down
3 changes: 1 addition & 2 deletionsdocs/reference/api/enterprise.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 1 addition & 1 deletionenterprise/coderd/provisionerkeys.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -202,7 +202,7 @@ func (api *API) deleteProvisionerKey(rw http.ResponseWriter, r *http.Request) {

// @Summary Fetch provisioner key details
// @ID fetch-provisioner-key-details
// @SecurityCoderSessionToken
// @SecurityCoderProvisionerKey
// @Produce json
// @Tags Enterprise
// @Param provisionerkey path string true "Provisioner Key"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp