Skip to content

Commit

Permalink
Bump version to 0.10.0
Browse files Browse the repository at this point in the history
Add CHANGELOG
  • Loading branch information
hugorodgerbrown committed Feb 17, 2023
1 parent 09ca1fc commit 4e3f309
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

## [0.10.0] - 2023-02-17

- Improve admin list view to include date filters and value search [#8]
- Implement directive downgrades [#6]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ highlight these the corresponding directive choice labels have been
amended. Treat with caution as setting these attributes may have
unintended consequences.

#### Downgrading directives

In some instances you may want to "downgrade" a directive - for instance
converting all `script-src-elem` directives to `script-src` (for
compatibility reasons). This can be done using the
`CSP_REPORT_DIRECTIVE_DOWNGRADE` setting.

## Settings

### `CSP_ENABLED`
Expand All @@ -76,6 +83,21 @@ unintended consequences.

Kill switch for the middleware. Defaults to `False` (disabled).

### `CSP_REPORT_DIRECTIVE_DOWNGRADE`

`dict[str, str]`, default =
```python
{
"script-src-elem": "script-src",
"script-src-attr": "script-src",
"style-src-elem": "style-src",
"style-src-attr": "style-src",
}
```

This is used to transparently "downgrade" any directives to a different
directive, and is primarily used for managing compatibility.

### `CSP_REPORT_ONLY`

`bool`, default = `True`
Expand Down
2 changes: 1 addition & 1 deletion csp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# universally supported, then convert it to "script-src" on the fly.
CSP_REPORT_DIRECTIVE_DOWNGRADE: dict[str, str] = getattr(
settings,
"CSP_REPORT_DIRECTIVE_MAP",
"CSP_REPORT_DIRECTIVE_DOWNGRADE",
{
"script-src-elem": "script-src",
"script-src-attr": "script-src",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-csp-plus"
version = "0.9.3"
version = "0.10.0"
description = "CSP tracking and violation report endpoint."
license = "MIT"
authors = ["YunoJuno <[email protected]>"]
Expand Down

0 comments on commit 4e3f309

Please sign in to comment.