Metadata-Version: 2.1
Name: har2csp
Version: 1.0.0
Summary: A library to generate CSP headers from HAR files
Home-page: https://github.com/johngrimes/har2csp
Author: John Grimes
Author-email: john@grimes.id.au
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE

# har2csp

`har2csp` is a command-line tool that generates Content Security Policy (CSP) headers from HTTP Archive (HAR) files. It analyzes the network requests in the HAR file and generates CSP directives that allow those requests, helping you to create a CSP for your website that doesn't break anything.

## Installation

```bash
pip install har2csp
```

## Usage

```bash
har2csp [-h] [-s SELF_URL] har_file_path
```

### Positional Arguments

- `har_file_path`: The path to the HAR file to generate CSP directives from.

### Optional Arguments

- `-h, --help`: Show a help message and exit.
- `-s SELF_URL, --self-url SELF_URL`: The URL of the website that the HAR file was recorded from. Any requests to this URL will be ignored when generating the CSP directives.

## Example

```bash
har2csp -s https://www.example.com example.har
```

This command will generate CSP directives from `example.har`, ignoring any requests to `https://www.example.com`. The directives will be printed to the console.

## License

This project is licensed under the terms of the [Apache 2.0 Licence](./LICENSE).
