-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add impersonation to django admin log #44
Conversation
0de2db8
to
58c0dca
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
=======================================
Coverage 95.20% 95.21%
=======================================
Files 578 578
Lines 14455 14474 +19
=======================================
+ Hits 13762 13781 +19
Misses 693 693
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Codecov Report
@@ Coverage Diff @@
## main #44 +/- ##
=======================================
+ Coverage 95.26 95.27 +0.01
=======================================
Files 691 691
Lines 14626 14645 +19
=======================================
+ Hits 13933 13952 +19
Misses 693 693
Flags with carried forward coverage won't be shown. Click here to find out more.
|
b960169
to
7f6bc18
Compare
2d0f8e3
to
04b7750
Compare
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.
accepting with feedback - please add comments or more test cases to illustrate what the arguments to log()
are supposed to represent conceptually
codecov_auth/helpers.py
Outdated
add = ADDITION | ||
change = CHANGE | ||
delete = DELETION |
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 you may as well just use the pre-existing constants
|
||
class History: | ||
@staticmethod | ||
def log(objects, message, user, action_flag=None, add_traceback=False): |
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.
could you add a comment describing what these arguments are meant to be? particularly objects
and action_flag
.
looking at the tests, you are logging that orig_owner
made a change
related to impersonated_user
, but that could also be a list of impersonated users? what are some other use cases of this that would want a list of objects?
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 helper is just being used in the case where we're impersonating users, but in the future we might use this helper to log other actions in the admin log, some of those actions may involve multiple objects instead of just one.
e15225a
to
b21ac0f
Compare
- Create History helper class to add logs to admin log - Add History.log to log in impersonate_owner - Add tests for History.log() Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
b21ac0f
to
4ec4ed1
Compare
Purpose/Motivation
Links to relevant tickets
codecov/engineering-team#116
What does this PR do?
__str__
method to UserNotes to Reviewer
Anything to note to the team? Any tips on how to review, or where to start?
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.