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

Bugfix/missing infofuncs #1375

Merged
merged 2 commits into from
Jul 2, 2021
Merged

Conversation

Ruwann
Copy link
Member

@Ruwann Ruwann commented Jul 2, 2021

In PR #869 , the check for token_info was changed from if token_info is None to if token_info is cls.no_value. However, the initial value for token_info is None, so if there are no auth_funcs (due to missing x-XXXInfoFuncs), the OAuthProblem branch isn't entered and token_info.get() will raise an AttributeError, leading to a 500 Internal Server Error.

Changes proposed in this pull request:

  • Change the default value of token_info from None to cls.no_value so that an OAuthProblem is raised

This situation occurs when a x-infoFunc is missing in the openapi
document. Then this security scheme is skipped and the auth_funcs
is an empty list if there are no other security schemes.
When the auth_funcs argument is the empty list, an AttributeError
is raised because the token_info is None and does not have a
'get' attribute. This leads to a 500 error.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.145% when pulling 56533e6 on Ruwann:bugfix/missing-infofuncs into d4657e7 on zalando:main.

@hjacobs
Copy link
Contributor

hjacobs commented Jul 2, 2021

👍

@hjacobs hjacobs merged commit f46551c into spec-first:main Jul 2, 2021
@Ruwann Ruwann deleted the bugfix/missing-infofuncs branch July 2, 2021 14:58
@hjacobs hjacobs added this to the 2.8 milestone Jul 8, 2021
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

3 participants