Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Issues with logical AND/OR tests #419

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thefotios
Copy link

@thefotios thefotios commented Aug 25, 2016

I know these were old issues (#296, #305) that were explained, but this came up again for me.
The explanations totally make sense, but the tests still do not seem to support them.

I modified what I believe are the test security definitions to match

# OR
security:
  - handler1: []
  - handler2: []

# AND
security:
  - handler1: []
    handler2: []
// OR
"security": 
  { "handler1": [] },
  { "handler2": [] }
]

// AND
"security": [
  {
    "handler1": [],
    "handler2":[]
  }
]

i'd like to bring this up here with an example just to make sure I'm not crazy before I embark on trying to fix this.

I also noticed that this block might be better written as:

async.some(securityReqs, function (secReq, cb) { // logical OR - any one can allow
  ...          
  async.every(Object.keys(secReq), function (name, cb) { // logical AND - all must allow

but this would require changing the callbacks and whatnot to not have to short circuit them.

Questions

  1. Am I completely missing something with those tests that I changed? Not sure if the helpers are doing something that I missed.
  2. If this is a bug, should it be fixed? If so, it has been live for a long time and may have serious repercussions.

@thefotios thefotios force-pushed the swagger_security_logical_and_or branch from 7e4e192 to 1e86b1f Compare August 25, 2016 05:21
@whitlockjc
Copy link
Member

Do you mind looking into this @theganyo?

@thefotios thefotios changed the title Issues with logical AND/OR tests (#296, #305) Issues with logical AND/OR tests Aug 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants