Skip to content
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

Added a report collector plugin which can be used to generate a collector handler. #95

Merged
merged 13 commits into from Sep 2, 2020

Conversation

mattiasgrenfeldt
Copy link
Contributor

It can be used to create a reports collector handler for CSP reports. The user can provide a collector object which will be called with each incoming report.

Fixes #75

@mattiasgrenfeldt mattiasgrenfeldt added enhancement New feature or request plugin labels Aug 18, 2020
@mattiasgrenfeldt mattiasgrenfeldt self-assigned this Aug 18, 2020
safehttp/plugins/reportscollector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/reportscollector/collector.go Outdated Show resolved Hide resolved
@mattiasgrenfeldt mattiasgrenfeldt force-pushed the grenfeldt-reports-collector-first-version branch from 3a88826 to 91b9626 Compare August 20, 2020 12:36
@mattiasgrenfeldt
Copy link
Contributor Author

Rebased on top of master so that tests don't fail

safehttp/plugins/collector/collector_test.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
@mattiasgrenfeldt
Copy link
Contributor Author

This has now changed quite a bit to accommodate reports with Content-Type: application/reports+json. So please take another look.

safehttp/incoming_request.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector_test.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector_test.go Outdated Show resolved Hide resolved
@mattiasgrenfeldt
Copy link
Contributor Author

This is failing for the same reason as #104. The CI is broken! #128

@mattiasgrenfeldt mattiasgrenfeldt force-pushed the grenfeldt-reports-collector-first-version branch from a7454a9 to 1c121cb Compare August 28, 2020 11:59
safehttp/status.go Outdated Show resolved Hide resolved
@kele
Copy link
Collaborator

kele commented Sep 1, 2020

Please rebase and I can merge.

@mattiasgrenfeldt mattiasgrenfeldt force-pushed the grenfeldt-reports-collector-first-version branch from 1c121cb to 94083a3 Compare September 1, 2020 10:53
@mattiasgrenfeldt
Copy link
Contributor Author

Done! @kele

@mattiasgrenfeldt mattiasgrenfeldt force-pushed the grenfeldt-reports-collector-first-version branch 2 times, most recently from 9720583 to 0a10330 Compare September 2, 2020 11:28
@mattiasgrenfeldt
Copy link
Contributor Author

Done! @kele

safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
safehttp/plugins/collector/collector.go Outdated Show resolved Hide resolved
It can be used to create a reports collector handler for CSP reports. The user can provide a collector object which will be called with each incoming report.
@mattiasgrenfeldt mattiasgrenfeldt force-pushed the grenfeldt-reports-collector-first-version branch from 0a10330 to 9953ab6 Compare September 2, 2020 14:42
@kele kele merged commit b6a55e4 into master Sep 2, 2020
@mattiasgrenfeldt mattiasgrenfeldt deleted the grenfeldt-reports-collector-first-version branch September 3, 2020 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a reports collector
4 participants