-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(csp): Validate CSP reports with JSON schema #6340
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
Conversation
Generated by 🚫 danger |
| # NB this schema validates the version of the CSP report we create after | ||
| # validate_data() which changes hyphens to underscores in the key names. | ||
|
|
||
| CSP_POLICY_VIOLATION_REPORT_SCHEMA = { |
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.
From the department of redundancy department.
mattrobenolt
left a comment
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 don't really know json schema, but since it passes current tests, lgtm. 🍪
mitsuhiko
left a comment
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 diff is surprisingly hard to read. It's good but note that filter returns a generator on 3.x. It works atm but maybe name it uris_iter so that is clear.
|
I'd generally say avoid using |
In preparation for accepting other types of browser security reports, start using JSON schema to validate the structure of these documents to avoid duplicating a bunch of manual validation for the different report types.
9ca3c8d to
7c6351a
Compare
|
Superseded by #6417 |
In preparation for accepting other types of browser security reports,
start using JSON schema to validate the structure of these documents
to avoid duplicating a bunch of manual validation for the different
report types.