fix(ux): ensure that optional security schema is rendered without padlock. (#6839)
This commit is contained in:
35
test/e2e-cypress/static/documents/security/anonymous.yaml
Normal file
35
test/e2e-cypress/static/documents/security/anonymous.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: Test anonymous operations
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/withBoth:
|
||||
get:
|
||||
security: [{}, {"apikeyScheme": []}, {"apikeyScheme2": []}]
|
||||
responses:
|
||||
200:
|
||||
description: asdadasd
|
||||
/onlyEmpty:
|
||||
get:
|
||||
security: [{}]
|
||||
responses:
|
||||
200:
|
||||
description: asdadasd
|
||||
/required:
|
||||
get:
|
||||
security: [{"apikeyScheme": []}]
|
||||
responses:
|
||||
200:
|
||||
description: asdadasd
|
||||
security:
|
||||
- apikeyScheme: []
|
||||
components:
|
||||
securitySchemes:
|
||||
apikeyScheme:
|
||||
name: test
|
||||
type: apiKey
|
||||
in: header
|
||||
apikeyScheme2:
|
||||
name: test2
|
||||
type: apiKey
|
||||
in: header
|
||||
22
test/e2e-cypress/tests/security/anonymous.js
Normal file
22
test/e2e-cypress/tests/security/anonymous.js
Normal file
@@ -0,0 +1,22 @@
|
||||
describe("#6767: Operation should be considered anonymous if its security only includes empty object (this was decided by implementation choice and may change or be extended in the future)", () => {
|
||||
it("Should consider method anonymous if security contains only empty object", () => {
|
||||
cy
|
||||
.visit("/?url=/documents/security/anonymous.yaml")
|
||||
.get("#operations-default-get_onlyEmpty .authorization__btn")
|
||||
.should("not.exist")
|
||||
})
|
||||
|
||||
it("Should consider method as secured if security contains no empty object", () => {
|
||||
cy
|
||||
.visit("/?url=/documents/security/anonymous.yaml")
|
||||
.get("#operations-default-get_required .authorization__btn")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it("Should consider method as secured if security contains empty object but has at least one more security defined", () => {
|
||||
cy
|
||||
.visit("/?url=/documents/security/anonymous.yaml")
|
||||
.get("#operations-default-get_withBoth .authorization__btn")
|
||||
.should("exist")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user