Open
Conversation
Contributor
|
@sachin-panayil what type of user IDs do we expect in the system, and why is it important to hash them in the logs? |
Collaborator
Author
@tspecht-cms the user id we're capturing is the sequential number. so if your the 5th user, your user id would be 5. logging these raw would expose how many users exist and make it trivial to correlate user activity in the logs. since they're not UUIDs, hashing them before they hit the logs make them opaque. this also solves the opaqueness requirement in the acceptance criteria. |
This file contains hidden or 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
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.
Adding UserID Logging
Jira Ticket #757
Problem
We were not logging the user ID when users made a request which gives us less of an ability to see how users are interacting with our API.
Solution
Add logging that fires on every request via signal. We store the username as is and the ID as a hashed id so that it is opaque.
Result
Proper user logging is now made on every request.
Some important notes regarding the summary line:
Test Plan
bin/npr python manage.py shell