-
Notifications
You must be signed in to change notification settings - Fork 249
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
[logging] Log identity as part of API call logging #14793
Open
cjllanwarne
wants to merge
5
commits into
hail-is:main
Choose a base branch
from
cjllanwarne:cjl_log_user
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
patrick-schultz
requested changes
Jan 16, 2025
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.
Looks good, just a minor code style suggestion.
hail/python/hailtop/hail_logging.py
Outdated
Comment on lines
67
to
75
if 'username' in userdata_maybe: | ||
extra['username'] = userdata_maybe['username'] | ||
if 'login_id' in userdata_maybe: | ||
extra['login_id'] = userdata_maybe['login_id'] | ||
if 'is_developer' in userdata_maybe: | ||
extra['is_developer'] = userdata_maybe['is_developer'] | ||
if 'hail_identity' in userdata_maybe: | ||
extra['hail_identity'] = userdata_maybe['hail_identity'] | ||
|
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.
I think this can be simplified to something more pythonic like (untested)
id_keys = ['username', 'login_id', 'is_developer', 'hail_identity']
extra.update((k, userdata_maybe[k]) for k in id_keys if k in userdata_maybe)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
Security Assessment
Impact Description
(Reviewers: please confirm the security impact before approving)