Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(csp): Add support for Reporting API #3277

Merged
merged 11 commits into from
Mar 20, 2024
Merged

feat(csp): Add support for Reporting API #3277

merged 11 commits into from
Mar 20, 2024

Conversation

olksdr
Copy link
Contributor

@olksdr olksdr commented Mar 15, 2024

This PR adds support for Reporting API to CSP security reports.

Reporting API has slightly different format for the CSP report body, but the biggest difference that browser sends the CSP reports in batches.

Since we also want to support old format, I've tried to minimize the changes and re-used as much code as I could.

related: getsentry/sentry-docs#9440
fix: #2645
related: getsentry/sentry#38940

@olksdr olksdr self-assigned this Mar 15, 2024
@olksdr olksdr requested a review from a team as a code owner March 15, 2024 14:19
@olksdr
Copy link
Contributor Author

olksdr commented Mar 15, 2024

cc. @oioki once this is merged, we will have support for new CSP format

ty: String,
body: CspRaw,

/// For forward compatibility.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field seems unused and the struct is also never serialized, seems like that does nothing and can be removed.

relay-event-schema/src/protocol/security_report.rs Outdated Show resolved Hide resolved
relay-event-schema/src/protocol/security_report.rs Outdated Show resolved Hide resolved
relay-event-schema/src/protocol/security_report.rs Outdated Show resolved Hide resolved
relay-event-schema/src/protocol/security_report.rs Outdated Show resolved Hide resolved
@olksdr olksdr requested review from Dav1dde and a team March 19, 2024 08:53
relay-event-schema/src/protocol/security_report.rs Outdated Show resolved Hide resolved
relay-event-schema/src/protocol/security_report.rs Outdated Show resolved Hide resolved
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept csp-violation reports?
2 participants