Repository navigation
fix(logs): mask the email codes in the access log, keep error texts private - #2833
Merged
Merged
Conversation
…rivate - The access log writes the paths of the email links (registration, password reset, email change) with the code masked; only its purpose stays, for the greps. - The engines hide the values of the SQL queries in the error texts. - The Navitia views answer error ids instead of the text of unexpected exceptions (URL and query of the call, database errors); the text goes to the logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -1 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
What
Access log: the paths of the email links (
/users/validate_register_email/…,validate_new_password/…,validate_change_email/…) are logged with the code masked, e.g./users/validate_new_password/newpass_***, in the message and in thepathfield. Follows fix(user): store the hash of the email codes, reset link valid 1 day #2830, which stopped storing these codes in clear.SQL errors: the engines of the API and of the ES scripts are created with
hide_parameters=True, so the values of a query stay out of the error texts. Not the Alembic migrations, run by hand.Navitia: errors that are not Navitia's own answers no longer reach the client as raw text:
navitia_internal_error(already translated by the UI);unknown_error(already translated);job_error/unknown error.Navitia's error ids (
no_solution,date_out_of_bounds…) are unchanged; the full text goes to the logs.Tests
Masked paths for the 3 routes (other paths kept),
hide_parameterspassed bycreate_app, the Navitia answers above. The new tests fail on master.The HAProxy access log still writes these paths: a separate change in v6-docker-compose, later.
🤖 Generated with Claude Code