-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Fix azure oauth issues #7587
Fix azure oauth issues #7587
Conversation
@@ -54,6 +54,7 @@ def decode_response_body(response): | |||
body = codecs.decode(response.body, 'ascii') | |||
except Exception: | |||
body = codecs.decode(response.body, 'utf-8') | |||
body = re.sub("\'", '\\"', body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a workaround as just below you replace both " and '. It works. But its hard to do right as there are no existing test cases explaining what the other re.sub
are handling.
@@ -450,10 +451,17 @@ def _raise_error(self, response, body=None, status=400): | |||
log.warning(f"{provider} OAuth provider failed to fully " | |||
f"authenticate returning the following response:" | |||
f"{body}.") | |||
if hasattr(body, "get"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my case body
was None
due to the decoding error triggering an AttributeError
.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7587 +/- ##
==========================================
+ Coverage 82.11% 82.22% +0.11%
==========================================
Files 340 341 +1
Lines 51483 51562 +79
==========================================
+ Hits 42273 42398 +125
+ Misses 9210 9164 -46 ☔ View full report in Codecov by Sentry. |
Closing #7586 and more issues identified while trying to get azure oauth working.