Skip to content

Commit 8a0b06c

Browse files
authored
Merge pull request #230 from maykinmedia/dep/oaf-8.0.0
⬆️ update open-api-framework to 8.0.0
2 parents 7839e59 + 976caef commit 8a0b06c

File tree

5 files changed

+50
-6
lines changed

5 files changed

+50
-6
lines changed

CHANGELOG.rst

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
Change history
33
==============
44

5+
6+
2.2.0
7+
=====
8+
9+
**New features**
10+
11+
* updated open-api-framework to 0.8.0, which includes adding CSRF, CSP and HSTS settings (#438).
12+
All new environment variables are added to the `documentation <https://objects-and-objecttypes-api.readthedocs.io/en/latest/installation/config.html>`_
13+
14+
.. warning::
15+
16+
``SECURE_HSTS_SECONDS`` has been added with a default of 31536000 seconds, ensure that
17+
before upgrading to this version of open-api-framework, your entire application is served
18+
over HTTPS, otherwise this setting can break parts of your application (see https://docs.djangoproject.com/en/4.2/ref/middleware/#http-strict-transport-security)
19+
20+
21+
522
2.1.0
623
=====
724

docs/installation/config.rst

+15-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Required
1919

2020
* ``SECRET_KEY``: Secret key that's used for certain cryptographic utilities. You should generate one via `miniwebtool <https://www.miniwebtool.com/django-secret-key-generator>`_.
2121
* ``ALLOWED_HOSTS``: a comma separated (without spaces!) list of domains that serve the installation. Used to protect against Host header attacks. Defaults to: ``(empty string)``.
22+
* ``CACHE_DEFAULT``: redis cache address for the default cache (this **MUST** be set when using Docker). Defaults to: ``localhost:6379/0``.
23+
* ``CACHE_AXES``: redis cache address for the brute force login protection cache (this **MUST** be set when using Docker). Defaults to: ``localhost:6379/0``.
24+
* ``EMAIL_HOST``: hostname for the outgoing e-mail server (this **MUST** be set when using Docker). Defaults to: ``localhost``.
2225

2326

2427
Database
@@ -49,16 +52,25 @@ Elastic APM
4952
* ``ELASTIC_APM_TRANSACTION_SAMPLE_RATE``: By default, the agent will sample every transaction (e.g. request to your service). To reduce overhead and storage requirements, set the sample rate to a value between 0.0 and 1.0. Defaults to: ``0.1``.
5053

5154

55+
Content Security Policy
56+
-----------------------
57+
58+
* ``CSP_EXTRA_DEFAULT_SRC``: Extra default source URLs for CSP other than ``self``. Used for ``img-src``, ``style-src`` and ``script-src``. Defaults to: ``[]``.
59+
* ``CSP_REPORT_URI``: URI of the``report-uri`` directive. Defaults to: ``None``.
60+
* ``CSP_REPORT_PERCENTAGE``: Percentage of requests that get the ``report-uri`` directive. Defaults to: ``0``.
61+
* ``CSP_EXTRA_FORM_ACTION``: Add additional ``form-action`` source to the default . Defaults to: ``[]``.
62+
* ``CSP_FORM_ACTION``: Override the default ``form-action`` source. Defaults to: ``['"\'self\'"']``.
63+
* ``CSP_EXTRA_IMG_SRC``: Extra ``img-src`` sources for CSP other than ``CSP_DEFAULT_SRC``. Defaults to: ``[]``.
64+
* ``CSP_OBJECT_SRC``: ``object-src`` urls. Defaults to: ``['"\'none\'"']``.
65+
66+
5267
Optional
5368
--------
5469

5570
* ``SITE_ID``: The database ID of the site object. You usually won't have to touch this. Defaults to: ``1``.
5671
* ``DEBUG``: Only set this to ``True`` on a local development environment. Various other security settings are derived from this setting!. Defaults to: ``False``.
5772
* ``USE_X_FORWARDED_HOST``: whether to grab the domain/host from the X-Forwarded-Host header or not. This header is typically set by reverse proxies (such as nginx, traefik, Apache...). Note: this is a header that can be spoofed and you need to ensure you control it before enabling this. Defaults to: ``False``.
5873
* ``IS_HTTPS``: Used to construct absolute URLs and controls a variety of security settings. Defaults to the inverse of ``DEBUG``.
59-
* ``CACHE_DEFAULT``: redis cache address for the default cache. Defaults to: ``localhost:6379/0``.
60-
* ``CACHE_AXES``: redis cache address for the brute force login protection cache. Defaults to: ``localhost:6379/0``.
61-
* ``EMAIL_HOST``: hostname for the outgoing e-mail server. Defaults to: ``localhost``.
6274
* ``EMAIL_PORT``: port number of the outgoing e-mail server. Note that if you're on Google Cloud, sending e-mail via port 25 is completely blocked and you should use 487 for TLS. Defaults to: ``25``.
6375
* ``EMAIL_HOST_USER``: username to connect to the mail server. Defaults to: ``(empty string)``.
6476
* ``EMAIL_HOST_PASSWORD``: password to connect to the mail server. Defaults to: ``(empty string)``.

requirements/base.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ django==4.2.15
7676
# django-appconf
7777
# django-axes
7878
# django-cors-headers
79+
# django-csp
7980
# django-filter
8081
# django-formtools
8182
# django-jsonform
@@ -111,6 +112,8 @@ django-axes==6.5.1
111112
# via open-api-framework
112113
django-cors-headers==4.4.0
113114
# via open-api-framework
115+
django-csp==3.8
116+
# via open-api-framework
114117
django-filter==24.2
115118
# via
116119
# commonground-api-common
@@ -228,7 +231,7 @@ mozilla-django-oidc-db==0.19.0
228231
# via open-api-framework
229232
notifications-api-common==0.2.2
230233
# via commonground-api-common
231-
open-api-framework==0.7.1
234+
open-api-framework==0.8.0
232235
# via -r requirements/base.in
233236
orderedmultidict==1.0.1
234237
# via furl

requirements/ci.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ django==4.2.15
153153
# django-appconf
154154
# django-axes
155155
# django-cors-headers
156+
# django-csp
156157
# django-filter
157158
# django-formtools
158159
# django-jsonform
@@ -200,6 +201,11 @@ django-cors-headers==4.4.0
200201
# -c requirements/base.txt
201202
# -r requirements/base.txt
202203
# open-api-framework
204+
django-csp==3.8
205+
# via
206+
# -c requirements/base.txt
207+
# -r requirements/base.txt
208+
# open-api-framework
203209
django-filter==24.2
204210
# via
205211
# -c requirements/base.txt
@@ -487,7 +493,7 @@ notifications-api-common==0.2.2
487493
# -c requirements/base.txt
488494
# -r requirements/base.txt
489495
# commonground-api-common
490-
open-api-framework==0.7.1
496+
open-api-framework==0.8.0
491497
# via
492498
# -c requirements/base.txt
493499
# -r requirements/base.txt

requirements/dev.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ django==4.2.15
181181
# django-appconf
182182
# django-axes
183183
# django-cors-headers
184+
# django-csp
184185
# django-debug-toolbar
185186
# django-extensions
186187
# django-filter
@@ -230,6 +231,11 @@ django-cors-headers==4.4.0
230231
# -c requirements/ci.txt
231232
# -r requirements/ci.txt
232233
# open-api-framework
234+
django-csp==3.8
235+
# via
236+
# -c requirements/ci.txt
237+
# -r requirements/ci.txt
238+
# open-api-framework
233239
django-debug-toolbar==4.4.6
234240
# via -r requirements/dev.in
235241
django-extensions==3.2.3
@@ -556,7 +562,7 @@ notifications-api-common==0.2.2
556562
# -c requirements/ci.txt
557563
# -r requirements/ci.txt
558564
# commonground-api-common
559-
open-api-framework==0.7.1
565+
open-api-framework==0.8.0
560566
# via
561567
# -c requirements/ci.txt
562568
# -r requirements/ci.txt

0 commit comments

Comments
 (0)