-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Content Security Policy builder #14
Conversation
- Adjust SecurityHeaders., SecurityHeadersFactory for new CSP builder - Modify tests for new CSP builder
- SwiftLint: (https://github.com/realm/SwiftLint) - SwiftFormat (https://github.com/nicklockwood/SwiftFormat)
- Mark CSPReportToEndpoint and CSPReportTo initializers public - Mark CSPKeywords static constants public
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.
Looks awesome! Few minor changes
Sources/VaporSecurityHeaders/Configurations/ContentSecurityPolicyConfiguration.swift
Outdated
Show resolved
Hide resolved
- Format CSP builder directives - Add custom header via ContentSecurityPolicy().set(value) or ContentSecurityPolicyConfiguration(value) - Fix configure CSP missing step
- Better names for constants - Remove semicolon on expectedCSPHeaderValue - Merge middleware test fix
Codecov Report
@@ Coverage Diff @@
## master #14 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 10 10
Lines 130 218 +88
=====================================
+ Hits 130 218 +88
Continue to review full report at Codecov.
|
- Make CSPReportTo and CSPReportToEndpoint Equatable - SwiftLint corrections
Report-To
DirectiveContent-Security-Policy: default-src 'none'; script-src https://static.brokenhands.io; style-src https://static.brokenhands.io; img-src https://static.brokenhands.io; font-src https://static.brokenhands.io; connect-src https://*.brokenhands.io; form-action 'self'; upgrade-insecure-requests; block-all-mixed-content; require-sri-for script style; report-uri https://csp-report.brokenhands.io