Skip to content

Having heterogeneous combinations of security handlers does not work properly #736

Closed
@mohak2006

Description

@mohak2006

If a particular endpoint spec contains multiple security handlers with both AND and OR conditions according to the "Using Multiple Authentication Types" section on this link: https://swagger.io/docs/specification/authentication/, then the behaviour of the API is not as expected.

For e.g. take following scenario:

paths:
  /health_check:
    get:
      security:
        - Handler1ThatReturnTrue: []
          Handler2ThatReturnFalse: []
        - Handler3ThatReturnTrue: []
          Handler4ThatReturnTrue: []

The Above one will fail authorization.

If you change the above scenario to:

paths:
  /health_check:
    get:
      security:
        - Handler1ThatReturnTrue: []
          Handler2ThatReturnTrue: []
        - Handler3ThatReturnTrue: []
          Handler4ThatReturnFalse: []

This scenario will pass authorization.

Somehow when you use both AND and OR combinations of security handlers, then only the first combination is respected. Can you please check and provide a fix or a workaround for this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions