Skip to content

Add a rule to validate security in the operations #2162

@magicmatatjahu

Description

@magicmatatjahu

User story.
As a user I want to know if the operation has the correct security defined (that given security key has reference to the schemes defined in the components.securitySchemes).

Is your feature request related to a problem?
The following AsyncAPI document is invalid and Spectral should throw errors due to not defined security schemes inside one of operation:

asyncapi: '2.0.0',
channels:
  'user/signup':
    publish:
      security:
        - not_defined: []
components:
  securitySchemes:
    petstore_auth:
      ...

Additional context
Part of #2100

Metadata

Metadata

Assignees

No one assigned

    Labels

    AsyncAPIIssues related to the AsyncAPI rulesetenhancementNew feature or requestreleased

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions