Skip to content

Commit

Permalink
feat(rulesets): check security on operation level
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed Jun 27, 2022
1 parent dab3521 commit e336c84
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Expand Up @@ -26,6 +26,25 @@ testRule('asyncapi-operation-security', [
errors: [],
},

{
name: 'valid case (without security field)',
document: {
asyncapi: '2.4.0',
channels: {
channel: {
publish: {},
subscribe: {},
},
},
components: {
securitySchemes: {
petstore_auth: {},
},
},
},
errors: [],
},

{
name: 'valid case (oauth2)',
document: {
Expand Down
Expand Up @@ -24,6 +24,22 @@ testRule('asyncapi-server-security', [
errors: [],
},

{
name: 'valid case (without security field)',
document: {
asyncapi: '2.0.0',
servers: {
production: {},
},
components: {
securitySchemes: {
petstore_auth: {},
},
},
},
errors: [],
},

{
name: 'valid case (oauth2)',
document: {
Expand Down

0 comments on commit e336c84

Please sign in to comment.