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

Use getattr for oauth2_error access (#633) #716

Merged
merged 2 commits into from
Jun 7, 2019
Merged

Use getattr for oauth2_error access (#633) #716

merged 2 commits into from
Jun 7, 2019

Conversation

george-pearson
Copy link
Contributor

If the request doesn't have a oauth2_error property the
authenticate_header method errors. This can happen when the
oauthlib_core.verify_request method raises exceptions in authenticate.
It is useful to be able to raise AuthenticationFailed exceptions from
within a custom validate_bearer_token method which causes this.

@coveralls
Copy link

coveralls commented May 29, 2019

Pull Request Test Coverage Report for Build 1111

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 94.697%

Totals Coverage Status
Change from base Build 1108: 0.004%
Covered Lines: 1250
Relevant Lines: 1320

💛 - Coveralls

Copy link
Contributor

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add test for this?

George Pearson added 2 commits May 29, 2019 18:29
Added a test for if an authenticate method that returns
None is used. This should result in a HTTP 401 response
for any request.
If the request doesn't have a oauth2_error property the
authenticate_header method errors. This can happen when the
oauthlib_core.verify_request method raises exceptions in authenticate.
It is useful to be able to raise AuthenticationFailed exceptions from
within a custom validate_bearer_token method which causes this.
@george-pearson
Copy link
Contributor Author

Hi @auvipy, I've added a simple test that will highlight the problem if run on master.

@auvipy auvipy merged commit f86dfb8 into jazzband:master Jun 7, 2019
@n2ygk
Copy link
Member

n2ygk commented Mar 1, 2020

@auvipy please close #633 if you agree this merged PR fixes that issue.

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.

4 participants