Scrub bug report text before Sentry ingest#383
Open
silentgeckoaudit3801 wants to merge 5 commits into
Open
Conversation
|
|
||
|
|
||
| def test_bug_report_endpoint_sends_only_scrubbed_description_to_sentry(): | ||
| assert "safe_description = scrub_user_text_for_sentry(report.bug_description)" in USER_API |
|
|
||
| def test_bug_report_endpoint_sends_only_scrubbed_description_to_sentry(): | ||
| assert "safe_description = scrub_user_text_for_sentry(report.bug_description)" in USER_API | ||
| assert 'extras={"description": safe_description}' in USER_API |
| def test_bug_report_endpoint_sends_only_scrubbed_description_to_sentry(): | ||
| assert "safe_description = scrub_user_text_for_sentry(report.bug_description)" in USER_API | ||
| assert 'extras={"description": safe_description}' in USER_API | ||
| assert '"description": report.bug_description' not in USER_API |
| assert "safe_description = scrub_user_text_for_sentry(report.bug_description)" in USER_API | ||
| assert 'extras={"description": safe_description}' in USER_API | ||
| assert '"description": report.bug_description' not in USER_API | ||
| assert 'extras={"description": report.bug_description}' not in USER_API |
|
|
||
|
|
||
| def test_sentry_before_send_hook_is_registered(): | ||
| assert "from web_app.api.sentry_hooks import before_send" in MAIN_API |
|
|
||
|
|
||
| def test_before_send_enforces_scrub_on_context_and_extra_payloads(): | ||
| assert 'BUG_REPORT_CONTEXT = "bug_report"' in HOOKS |
|
|
||
| def test_before_send_enforces_scrub_on_context_and_extra_payloads(): | ||
| assert 'BUG_REPORT_CONTEXT = "bug_report"' in HOOKS | ||
| assert 'DESCRIPTION_FIELD = "description"' in HOOKS |
| def test_before_send_enforces_scrub_on_context_and_extra_payloads(): | ||
| assert 'BUG_REPORT_CONTEXT = "bug_report"' in HOOKS | ||
| assert 'DESCRIPTION_FIELD = "description"' in HOOKS | ||
| assert 'contexts.get(BUG_REPORT_CONTEXT)' in HOOKS |
| assert 'BUG_REPORT_CONTEXT = "bug_report"' in HOOKS | ||
| assert 'DESCRIPTION_FIELD = "description"' in HOOKS | ||
| assert 'contexts.get(BUG_REPORT_CONTEXT)' in HOOKS | ||
| assert 'event.get("extra")' in HOOKS |
| assert 'DESCRIPTION_FIELD = "description"' in HOOKS | ||
| assert 'contexts.get(BUG_REPORT_CONTEXT)' in HOOKS | ||
| assert 'event.get("extra")' in HOOKS | ||
| assert "scrub_user_text_for_sentry(" in HOOKS No newline at end of file |
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.
Summary
html.escape-based scrubber for user-controlled Sentry textbefore_sendhook that re-scrubs bug-report context and event extra descriptions before persistence/api/save-bug-reportTesting
quantara/web_app/tests/test_sentry_bug_report_scrub_static.pyfor CI.Closes #199