Skip to content

Commit

Permalink
Add security to /secure endpoint in test with empty global security
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTeaCat authored and daveshanley committed Jan 30, 2024
1 parent 00c68f7 commit b7528da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/owasp/check_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ paths:
/secure:
put:
responses: {}
security:
- BasicAuth: []
components:
securitySchemes:
BasicAuth:
Expand Down Expand Up @@ -277,9 +279,7 @@ components:

res := CheckSecurity{}.RunRule(nil, ctx)

assert.Len(t, res, 2)
assert.Len(t, res, 1)
assert.Equal(t, "`security` was not defined for path `/insecure` in method `put`", res[0].Message)
assert.Equal(t, "$.paths['/insecure'].put", res[0].Path)
assert.Equal(t, "`security` was not defined for path `/secure` in method `put`", res[1].Message)
assert.Equal(t, "$.paths['/secure'].put", res[1].Path)
}

0 comments on commit b7528da

Please sign in to comment.