Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding treatment for ORs & ANDs #1100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Danfs64
Copy link

@Danfs64 Danfs64 commented Nov 3, 2023

My attempt to fix the issue I reported (#1092). I decided to go with the behaviour that any side of the OR having a relevant permission is enough to generate a security requirement

The mypy linting reports some errors that I am unable to even figure out why they are errors. I tested the code both with the ./runtests.py script and using the new code on a project I created for testing, and both work fine.

P.S.: Although I fixed the issue I reported, the behaviour of the function as it is (and as it was) feels a little funky. It feels weird that it returns on the first permission that matches any of the three relevant ones (TokenMatchesOASRequirements, IsAuthenticatedOrTokenHasScope or TokenHasScope), but I'm not really familiar with Swagger nor OpenAPI in general to have an informed opinion on the subject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant