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

Fix azure oauth issues #7587

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Fix azure oauth issues #7587

merged 3 commits into from
Jan 13, 2025

Conversation

MarcSkovMadsen
Copy link
Collaborator

Closing #7586 and more issues identified while trying to get azure oauth working.

@@ -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)
Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen Jan 5, 2025

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"):
Copy link
Collaborator Author

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.

panel/command/__init__.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.22%. Comparing base (79e183c) to head (3af8691).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
panel/auth.py 66.66% 2 Missing ⚠️
panel/command/__init__.py 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@philippjfr philippjfr merged commit a4b9a87 into main Jan 13, 2025
18 checks passed
@philippjfr philippjfr deleted the fix/raise-error-null-body branch January 13, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants