-
Notifications
You must be signed in to change notification settings - Fork 630
update google_auth.py - Not an RSA key (#3388) #3408
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
base: master
Are you sure you want to change the base?
Changes from all commits
e536a6c
ccfbe1e
ede79e5
f872cde
1882ee2
18a9a79
cf3550b
72c5ae2
ae7896c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -310,8 +310,11 @@ def get_public_key_for_jwt(encoded_jwt: str, url: str): | |||||||||||||||||
if "keys" in keys_json: | ||||||||||||||||||
_new_keys_dict = {} | ||||||||||||||||||
for key_dict in keys_json["keys"]: | ||||||||||||||||||
public_key = jwt.algorithms.RSAAlgorithm.from_jwk(json.dumps(key_dict)) | ||||||||||||||||||
_new_keys_dict[key_dict["kid"]] = public_key | ||||||||||||||||||
try: | ||||||||||||||||||
public_key = jwt.algorithms.RSAAlgorithm.from_jwk(json.dumps(key_dict)) | ||||||||||||||||||
_new_keys_dict[key_dict["kid"]] = public_key | ||||||||||||||||||
except Exception as e: | ||||||||||||||||||
print(f"[ERROR] Error processing key ID {key_dict['kid']}: {e}") | ||||||||||||||||||
Comment on lines
+316
to
+317
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Consider including the exception type in the log message for better debugging.2 Style Guide References
Suggested change
Footnotes |
||||||||||||||||||
key_cache = _new_keys_dict | ||||||||||||||||||
else: | ||||||||||||||||||
key_cache = keys_json | ||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
So from what I understand, the only thing added is a try catch with a very broad catch, not sure how that fixes an error.
Please correct the
print()
to be a logging statement, and I would like to see a unit test for the case you explain if possible?And is there a possibility to make the broad
except
more specific?