Generate Security Header Endpoint with Sentry.csp_report_uri from DSN#1507
Merged
Generate Security Header Endpoint with Sentry.csp_report_uri from DSN#1507
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1507 +/- ##
==========================================
+ Coverage 98.19% 98.74% +0.54%
==========================================
Files 220 125 -95
Lines 10718 6921 -3797
==========================================
- Hits 10525 6834 -3691
+ Misses 193 87 -106 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rhcarvalho
reviewed
Jul 19, 2021
Contributor
rhcarvalho
left a comment
There was a problem hiding this comment.
Generally I find it okay to add this. Would consider adding some escaping code instead of plain string concatenation.
aa97492 to
ff8c1be
Compare
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.
Sentry requires a separated
Security Header Endpointfor Security Policy Reporting. But the endpoint's major components like project id, public key or host are all identical with the SDK's DSN. Also, the additional environment or release information are also obtained by the SDK.So this PR adds a helper
Sentry.csp_report_urito generate theSecurity Header Endpointfor users who report CSP events to the same project as DSN's (as suggested in #1499). It'll reduce the number of values they need to manage.Take Rails' csp configuration for example:
Without helper
With the helper