Validate before joining
Unknown directives, unsupported sources and conflicting none values produce errors instead of a partial header.
Day 073 / Security / Policy Drafts
Generate a deterministic report-only CSP header from explicit source lists with a small offline Python CLI.
Unknown directives, unsupported sources and conflicting none values produce errors instead of a partial header.
The tool never adds sources or omitted directives. Default-src does not supply base-uri or frame-ancestors.
Deliver report-only drafts as HTTP response headers and inspect browser violations. This tool does not collect reports or switch enforcement on.
Explicit source lists
Nine supported directives
Deterministic header output
Offline and dependency-free
Twelve passing tests
Argparse, JSON, pathlib and regular expressions provide a small CLI with no third-party dependencies.
Tests exercise ordering, required and unknown directives, source validation, ports, duplicate JSON keys and explicit omissions.