open-api-framework 0.9.6__tar.gz → 0.10.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/CHANGELOG.rst +28 -0
- {open_api_framework-0.9.6/open_api_framework.egg-info → open_api_framework-0.10.1}/PKG-INFO +9 -8
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/README.rst +5 -4
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/admin.py +0 -2
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/conf/base.py +21 -5
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/conf/utils.py +37 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1/open_api_framework.egg-info}/PKG-INFO +9 -8
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework.egg-info/SOURCES.txt +0 -1
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework.egg-info/requires.txt +3 -3
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/pyproject.toml +5 -12
- open_api_framework-0.10.1/setup.cfg +4 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/tests/test_admin.py +0 -3
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/tests/test_generate_envvar_docs.py +20 -15
- open_api_framework-0.10.1/tests/test_settings.py +26 -0
- open_api_framework-0.9.6/setup.cfg +0 -8
- open_api_framework-0.9.6/tests/test_settings.py +0 -8
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/LICENSE +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/MANIFEST.in +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/__init__.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/apps.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/conf/__init__.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/context_processors.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/management/__init__.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/management/commands/__init__.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/management/commands/generate_envvar_docs.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/py.typed +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/static/open_api_framework/css/admin.css +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templates/open_api_framework/admin/base_site.html +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templates/open_api_framework/components/environment.html +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templates/open_api_framework/components/version.html +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templates/open_api_framework/env_config.rst +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templatetags/__init__.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templatetags/doc_tags.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templatetags/open_api_framework.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/utils.py +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework.egg-info/dependency_links.txt +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework.egg-info/top_level.txt +0 -0
- {open_api_framework-0.9.6 → open_api_framework-0.10.1}/tests/test_config_helpers.py +0 -0
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
0.10.1 (2025-05-26)
|
|
5
|
+
-------------------
|
|
6
|
+
|
|
7
|
+
**Bugfixes**
|
|
8
|
+
|
|
9
|
+
* Do not use ``save_outgoing_requests`` log handler if ``LOG_REQUESTS`` is set to false
|
|
10
|
+
|
|
11
|
+
**Maintenance**
|
|
12
|
+
|
|
13
|
+
* [#132] Replace ``check_sphinx.py`` with ``make``
|
|
14
|
+
* [#133] Replace ``black``, ``isort`` and ``flake8`` with ``ruff`` and update code-quality workflow
|
|
15
|
+
* [#140] Upgrade python to 3.12
|
|
16
|
+
* Upgrade codecov action to v4
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
0.10.0 (2025-05-19)
|
|
20
|
+
-------------------
|
|
21
|
+
|
|
22
|
+
**New features**
|
|
23
|
+
|
|
24
|
+
* Add separate "Logging" group for logging related environment variables in docs
|
|
25
|
+
* Add ``open_api_framework.conf.utils.mute_logging`` util to silence logging in CI
|
|
26
|
+
* [maykinmedia/objects-api#592] Silence log events in Sentry if structlog is used
|
|
27
|
+
|
|
28
|
+
**Bugfixes**
|
|
29
|
+
|
|
30
|
+
* [#127] Make ``LOGIN_URL`` non-lazy to avoid errors when using ``django-rosetta``
|
|
31
|
+
|
|
4
32
|
0.9.6 (2025-03-28)
|
|
5
33
|
------------------
|
|
6
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: open-api-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.1
|
|
4
4
|
Summary: A metapackage for registration components, that bundles the dependencies shared between these components and provides generic settings
|
|
5
5
|
Author-email: Maykin Media <support@maykinmedia.nl>
|
|
6
6
|
License: Copyright © Maykin 2024
|
|
@@ -65,10 +65,10 @@ Requires-Dist: pytest; extra == "tests"
|
|
|
65
65
|
Requires-Dist: pytest-django; extra == "tests"
|
|
66
66
|
Requires-Dist: pytest-env; extra == "tests"
|
|
67
67
|
Requires-Dist: tox; extra == "tests"
|
|
68
|
-
Requires-Dist:
|
|
69
|
-
Requires-Dist: black; extra == "tests"
|
|
70
|
-
Requires-Dist: flake8; extra == "tests"
|
|
68
|
+
Requires-Dist: ruff; extra == "tests"
|
|
71
69
|
Requires-Dist: factory-boy; extra == "tests"
|
|
70
|
+
Requires-Dist: django-rosetta; extra == "tests"
|
|
71
|
+
Requires-Dist: django-webtest; extra == "tests"
|
|
72
72
|
Provides-Extra: coverage
|
|
73
73
|
Requires-Dist: pytest-cov; extra == "coverage"
|
|
74
74
|
Provides-Extra: docs
|
|
@@ -82,11 +82,11 @@ Dynamic: license-file
|
|
|
82
82
|
Open API Framework
|
|
83
83
|
==================
|
|
84
84
|
|
|
85
|
-
:Version: 0.
|
|
85
|
+
:Version: 0.10.1
|
|
86
86
|
:Source: https://github.com/maykinmedia/open-api-framework
|
|
87
87
|
:Keywords: metapackage, dependencies
|
|
88
88
|
|
|
89
|
-
|build-status| |code-quality| |
|
|
89
|
+
|build-status| |code-quality| |ruff| |coverage| |docs|
|
|
90
90
|
|
|
91
91
|
|python-versions| |django-versions| |pypi-version|
|
|
92
92
|
|
|
@@ -127,8 +127,9 @@ Licensed under the `MIT license`.
|
|
|
127
127
|
:alt: Code quality checks
|
|
128
128
|
:target: https://github.com/maykinmedia/open-api-framework/actions?query=workflow%3A%22Code+quality+checks%22
|
|
129
129
|
|
|
130
|
-
.. |
|
|
131
|
-
:target: https://github.com/
|
|
130
|
+
.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
131
|
+
:target: https://github.com/astral-sh/ruff
|
|
132
|
+
:alt: Ruff
|
|
132
133
|
|
|
133
134
|
.. |coverage| image:: https://codecov.io/gh/maykinmedia/open-api-framework/branch/main/graph/badge.svg
|
|
134
135
|
:target: https://codecov.io/gh/maykinmedia/open-api-framework
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Open API Framework
|
|
2
2
|
==================
|
|
3
3
|
|
|
4
|
-
:Version: 0.
|
|
4
|
+
:Version: 0.10.1
|
|
5
5
|
:Source: https://github.com/maykinmedia/open-api-framework
|
|
6
6
|
:Keywords: metapackage, dependencies
|
|
7
7
|
|
|
8
|
-
|build-status| |code-quality| |
|
|
8
|
+
|build-status| |code-quality| |ruff| |coverage| |docs|
|
|
9
9
|
|
|
10
10
|
|python-versions| |django-versions| |pypi-version|
|
|
11
11
|
|
|
@@ -46,8 +46,9 @@ Licensed under the `MIT license`.
|
|
|
46
46
|
:alt: Code quality checks
|
|
47
47
|
:target: https://github.com/maykinmedia/open-api-framework/actions?query=workflow%3A%22Code+quality+checks%22
|
|
48
48
|
|
|
49
|
-
.. |
|
|
50
|
-
:target: https://github.com/
|
|
49
|
+
.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
50
|
+
:target: https://github.com/astral-sh/ruff
|
|
51
|
+
:alt: Ruff
|
|
51
52
|
|
|
52
53
|
.. |coverage| image:: https://codecov.io/gh/maykinmedia/open-api-framework/branch/main/graph/badge.svg
|
|
53
54
|
:target: https://codecov.io/gh/maykinmedia/open-api-framework
|
|
@@ -11,7 +11,6 @@ class SessionProfileAdmin(admin.ModelAdmin):
|
|
|
11
11
|
|
|
12
12
|
@property
|
|
13
13
|
def SessionStore(self):
|
|
14
|
-
|
|
15
14
|
return get_session_store()
|
|
16
15
|
|
|
17
16
|
def get_queryset(self, request):
|
|
@@ -33,7 +32,6 @@ class SessionProfileAdmin(admin.ModelAdmin):
|
|
|
33
32
|
super().delete_model(request, obj)
|
|
34
33
|
|
|
35
34
|
def delete_queryset(self, request, queryset):
|
|
36
|
-
|
|
37
35
|
for session_profile in queryset.iterator():
|
|
38
36
|
self.SessionStore(session_profile.session_key).flush()
|
|
39
37
|
|
|
@@ -347,7 +347,10 @@ DEFAULT_FROM_EMAIL = config(
|
|
|
347
347
|
# LOGGING
|
|
348
348
|
#
|
|
349
349
|
LOG_STDOUT = config(
|
|
350
|
-
"LOG_STDOUT",
|
|
350
|
+
"LOG_STDOUT",
|
|
351
|
+
default=True,
|
|
352
|
+
help_text="whether to log to stdout or not",
|
|
353
|
+
group="Logging",
|
|
351
354
|
)
|
|
352
355
|
LOG_LEVEL = config(
|
|
353
356
|
"LOG_LEVEL",
|
|
@@ -356,6 +359,7 @@ LOG_LEVEL = config(
|
|
|
356
359
|
"control the verbosity of logging output. "
|
|
357
360
|
"Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``"
|
|
358
361
|
),
|
|
362
|
+
group="Logging",
|
|
359
363
|
)
|
|
360
364
|
LOG_QUERIES = config(
|
|
361
365
|
"LOG_QUERIES",
|
|
@@ -364,9 +368,17 @@ LOG_QUERIES = config(
|
|
|
364
368
|
"enable (query) logging at the database backend level. Note that you "
|
|
365
369
|
"must also set ``DEBUG=1``, which should be done very sparingly!"
|
|
366
370
|
),
|
|
371
|
+
group="Logging",
|
|
367
372
|
)
|
|
373
|
+
# XXX: this should be renamed to `LOG_OUTGOING_REQUESTS` in the next major release
|
|
368
374
|
LOG_REQUESTS = config(
|
|
369
|
-
"LOG_REQUESTS",
|
|
375
|
+
"LOG_REQUESTS",
|
|
376
|
+
default=False,
|
|
377
|
+
help_text=(
|
|
378
|
+
"enable logging of the outgoing requests. "
|
|
379
|
+
"This must be enabled along with `LOG_OUTGOING_REQUESTS_DB_SAVE` to save outgoing request logs in the database."
|
|
380
|
+
),
|
|
381
|
+
group="Logging",
|
|
370
382
|
)
|
|
371
383
|
if LOG_QUERIES and not DEBUG:
|
|
372
384
|
warnings.warn(
|
|
@@ -379,6 +391,7 @@ CELERY_LOGLEVEL = config(
|
|
|
379
391
|
default="INFO",
|
|
380
392
|
help_text="control the verbosity of logging output for celery, independent of ``LOG_LEVEL``."
|
|
381
393
|
" Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``",
|
|
394
|
+
group="Celery",
|
|
382
395
|
)
|
|
383
396
|
|
|
384
397
|
LOGGING_DIR = Path(BASE_DIR) / "log"
|
|
@@ -519,7 +532,7 @@ LOGGING = {
|
|
|
519
532
|
"handlers": (
|
|
520
533
|
["log_outgoing_requests", "save_outgoing_requests"]
|
|
521
534
|
if LOG_REQUESTS
|
|
522
|
-
else [
|
|
535
|
+
else []
|
|
523
536
|
),
|
|
524
537
|
"level": "DEBUG",
|
|
525
538
|
"propagate": True,
|
|
@@ -564,8 +577,7 @@ SESSION_COOKIE_AGE = config(
|
|
|
564
577
|
help_text="For how long, in seconds, the session cookie will be valid.",
|
|
565
578
|
)
|
|
566
579
|
|
|
567
|
-
|
|
568
|
-
LOGIN_URL = reverse_lazy("admin:login")
|
|
580
|
+
LOGIN_URL = "admin:login"
|
|
569
581
|
LOGIN_REDIRECT_URL = reverse_lazy("admin:index")
|
|
570
582
|
LOGOUT_REDIRECT_URL = reverse_lazy("admin:index")
|
|
571
583
|
|
|
@@ -953,22 +965,26 @@ LOG_OUTGOING_REQUESTS_EMIT_BODY = config(
|
|
|
953
965
|
"LOG_OUTGOING_REQUESTS_EMIT_BODY",
|
|
954
966
|
default=True,
|
|
955
967
|
help_text="Whether or not outgoing request bodies should be logged",
|
|
968
|
+
group="Logging",
|
|
956
969
|
)
|
|
957
970
|
LOG_OUTGOING_REQUESTS_DB_SAVE = config(
|
|
958
971
|
"LOG_OUTGOING_REQUESTS_DB_SAVE",
|
|
959
972
|
default=False,
|
|
960
973
|
help_text="Whether or not outgoing request logs should be saved to the database",
|
|
974
|
+
group="Logging",
|
|
961
975
|
)
|
|
962
976
|
LOG_OUTGOING_REQUESTS_DB_SAVE_BODY = config(
|
|
963
977
|
"LOG_OUTGOING_REQUESTS_DB_SAVE_BODY",
|
|
964
978
|
default=True,
|
|
965
979
|
help_text="Whether or not outgoing request bodies should be saved to the database",
|
|
980
|
+
group="Logging",
|
|
966
981
|
)
|
|
967
982
|
LOG_OUTGOING_REQUESTS_RESET_DB_SAVE_AFTER = None
|
|
968
983
|
LOG_OUTGOING_REQUESTS_MAX_AGE = config(
|
|
969
984
|
"LOG_OUTGOING_REQUESTS_MAX_AGE",
|
|
970
985
|
default=7,
|
|
971
986
|
help_text="The amount of time after which request logs should be deleted from the database",
|
|
987
|
+
group="Logging",
|
|
972
988
|
) # number of days
|
|
973
989
|
|
|
974
990
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging # noqa: TID251
|
|
1
2
|
import sys
|
|
2
3
|
from dataclasses import dataclass
|
|
3
4
|
from pathlib import Path
|
|
@@ -6,6 +7,7 @@ from urllib.parse import urlparse
|
|
|
6
7
|
|
|
7
8
|
from decouple import Csv, Undefined, config as _config, undefined
|
|
8
9
|
from sentry_sdk.integrations import DidNotEnable, django, redis
|
|
10
|
+
from sentry_sdk.integrations.logging import LoggingIntegration
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
@dataclass
|
|
@@ -103,6 +105,20 @@ def get_sentry_integrations() -> list:
|
|
|
103
105
|
else:
|
|
104
106
|
extra.append(celery.CeleryIntegration())
|
|
105
107
|
|
|
108
|
+
try:
|
|
109
|
+
import structlog # type: ignore # noqa
|
|
110
|
+
except ImportError:
|
|
111
|
+
pass
|
|
112
|
+
else:
|
|
113
|
+
extra.append(
|
|
114
|
+
LoggingIntegration(
|
|
115
|
+
level=logging.INFO, # breadcrumbs
|
|
116
|
+
# do not send any logs as event to Sentry at all - these must be scraped by
|
|
117
|
+
# the (container) infrastructure instead.
|
|
118
|
+
event_level=None,
|
|
119
|
+
),
|
|
120
|
+
)
|
|
121
|
+
|
|
106
122
|
return [*default, *extra]
|
|
107
123
|
|
|
108
124
|
|
|
@@ -119,3 +135,24 @@ def get_django_project_dir() -> str:
|
|
|
119
135
|
# Get the path of the importing module
|
|
120
136
|
base_dirname = get_project_dirname()
|
|
121
137
|
return Path(sys.modules[base_dirname].__file__).parent
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def mute_logging(config: dict) -> None: # pragma: no cover
|
|
141
|
+
"""
|
|
142
|
+
Disable (console) output from logging.
|
|
143
|
+
:arg config: The logging config, typically the django LOGGING setting.
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
# set up the null handler for all loggers so that nothing gets emitted
|
|
147
|
+
for name, logger in config["loggers"].items():
|
|
148
|
+
if name == "flaky_tests":
|
|
149
|
+
continue
|
|
150
|
+
logger["handlers"] = ["null"]
|
|
151
|
+
|
|
152
|
+
# some tooling logs to a logger which isn't defined, and that ends up in the root
|
|
153
|
+
# logger -> add one so that we can mute that output too.
|
|
154
|
+
config["loggers"].update(
|
|
155
|
+
{
|
|
156
|
+
"": {"handlers": ["null"], "level": "CRITICAL", "propagate": False},
|
|
157
|
+
}
|
|
158
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: open-api-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.1
|
|
4
4
|
Summary: A metapackage for registration components, that bundles the dependencies shared between these components and provides generic settings
|
|
5
5
|
Author-email: Maykin Media <support@maykinmedia.nl>
|
|
6
6
|
License: Copyright © Maykin 2024
|
|
@@ -65,10 +65,10 @@ Requires-Dist: pytest; extra == "tests"
|
|
|
65
65
|
Requires-Dist: pytest-django; extra == "tests"
|
|
66
66
|
Requires-Dist: pytest-env; extra == "tests"
|
|
67
67
|
Requires-Dist: tox; extra == "tests"
|
|
68
|
-
Requires-Dist:
|
|
69
|
-
Requires-Dist: black; extra == "tests"
|
|
70
|
-
Requires-Dist: flake8; extra == "tests"
|
|
68
|
+
Requires-Dist: ruff; extra == "tests"
|
|
71
69
|
Requires-Dist: factory-boy; extra == "tests"
|
|
70
|
+
Requires-Dist: django-rosetta; extra == "tests"
|
|
71
|
+
Requires-Dist: django-webtest; extra == "tests"
|
|
72
72
|
Provides-Extra: coverage
|
|
73
73
|
Requires-Dist: pytest-cov; extra == "coverage"
|
|
74
74
|
Provides-Extra: docs
|
|
@@ -82,11 +82,11 @@ Dynamic: license-file
|
|
|
82
82
|
Open API Framework
|
|
83
83
|
==================
|
|
84
84
|
|
|
85
|
-
:Version: 0.
|
|
85
|
+
:Version: 0.10.1
|
|
86
86
|
:Source: https://github.com/maykinmedia/open-api-framework
|
|
87
87
|
:Keywords: metapackage, dependencies
|
|
88
88
|
|
|
89
|
-
|build-status| |code-quality| |
|
|
89
|
+
|build-status| |code-quality| |ruff| |coverage| |docs|
|
|
90
90
|
|
|
91
91
|
|python-versions| |django-versions| |pypi-version|
|
|
92
92
|
|
|
@@ -127,8 +127,9 @@ Licensed under the `MIT license`.
|
|
|
127
127
|
:alt: Code quality checks
|
|
128
128
|
:target: https://github.com/maykinmedia/open-api-framework/actions?query=workflow%3A%22Code+quality+checks%22
|
|
129
129
|
|
|
130
|
-
.. |
|
|
131
|
-
:target: https://github.com/
|
|
130
|
+
.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
131
|
+
:target: https://github.com/astral-sh/ruff
|
|
132
|
+
:alt: Ruff
|
|
132
133
|
|
|
133
134
|
.. |coverage| image:: https://codecov.io/gh/maykinmedia/open-api-framework/branch/main/graph/badge.svg
|
|
134
135
|
:target: https://codecov.io/gh/maykinmedia/open-api-framework
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "open-api-framework"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.10.1"
|
|
8
8
|
description = "A metapackage for registration components, that bundles the dependencies shared between these components and provides generic settings"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Maykin Media", email = "support@maykinmedia.nl"}
|
|
@@ -71,10 +71,10 @@ tests = [
|
|
|
71
71
|
"pytest-django",
|
|
72
72
|
"pytest-env",
|
|
73
73
|
"tox",
|
|
74
|
-
"
|
|
75
|
-
"black",
|
|
76
|
-
"flake8",
|
|
74
|
+
"ruff",
|
|
77
75
|
"factory-boy",
|
|
76
|
+
"django-rosetta",
|
|
77
|
+
"django-webtest"
|
|
78
78
|
]
|
|
79
79
|
coverage = [
|
|
80
80
|
"pytest-cov",
|
|
@@ -92,13 +92,6 @@ release = [
|
|
|
92
92
|
include = ["open_api_framework*"]
|
|
93
93
|
namespaces = false
|
|
94
94
|
|
|
95
|
-
[tool.isort]
|
|
96
|
-
profile = "black"
|
|
97
|
-
combine_as_imports = true
|
|
98
|
-
known_django = "django"
|
|
99
|
-
known_first_party="open_api_framework"
|
|
100
|
-
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
|
|
101
|
-
|
|
102
95
|
[tool.pytest.ini_options]
|
|
103
96
|
testpaths = ["tests"]
|
|
104
97
|
pythonpath = "."
|
|
@@ -109,7 +102,7 @@ env = [
|
|
|
109
102
|
]
|
|
110
103
|
|
|
111
104
|
[tool.bumpversion]
|
|
112
|
-
current_version = "0.
|
|
105
|
+
current_version = "0.10.1"
|
|
113
106
|
files = [
|
|
114
107
|
{filename = "pyproject.toml"},
|
|
115
108
|
{filename = "README.rst"},
|
|
@@ -18,7 +18,6 @@ def session_changelist_url():
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def test_session_profile_sanity(client, admin_user, session_changelist_url):
|
|
21
|
-
|
|
22
21
|
client.force_login(admin_user)
|
|
23
22
|
response = client.get(session_changelist_url)
|
|
24
23
|
assert response.status_code == 200
|
|
@@ -32,7 +31,6 @@ def test_session_profile_sanity(client, admin_user, session_changelist_url):
|
|
|
32
31
|
def test_only_session_profile_of_user_shown(
|
|
33
32
|
client, admin_user, django_user_model, session_changelist_url
|
|
34
33
|
):
|
|
35
|
-
|
|
36
34
|
other_admin = django_user_model.objects.create_superuser("garry")
|
|
37
35
|
|
|
38
36
|
client.force_login(other_admin)
|
|
@@ -168,7 +166,6 @@ def test_delete_action_with_session_db_backend(
|
|
|
168
166
|
def test_delete_action_with_session_cache_backend(
|
|
169
167
|
client, admin_user, session_changelist_url
|
|
170
168
|
):
|
|
171
|
-
|
|
172
169
|
client.force_login(admin_user)
|
|
173
170
|
sessions = SessionProfileFactory.create_batch(5, user=admin_user)
|
|
174
171
|
|
|
@@ -35,21 +35,35 @@ Database
|
|
|
35
35
|
* ``DB_PORT``: port number of the database. Defaults to: ``5432``.
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
Logging
|
|
39
|
+
-------
|
|
40
40
|
|
|
41
|
-
* ``
|
|
42
|
-
* ``
|
|
43
|
-
* ``
|
|
44
|
-
* ``
|
|
41
|
+
* ``LOG_STDOUT``: whether to log to stdout or not. Defaults to: ``True``.
|
|
42
|
+
* ``LOG_LEVEL``: control the verbosity of logging output. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``WARNING``.
|
|
43
|
+
* ``LOG_QUERIES``: enable (query) logging at the database backend level. Note that you must also set ``DEBUG=1``, which should be done very sparingly!. Defaults to: ``False``.
|
|
44
|
+
* ``LOG_REQUESTS``: enable logging of the outgoing requests. This must be enabled along with `LOG_OUTGOING_REQUESTS_DB_SAVE` to save outgoing request logs in the database. Defaults to: ``False``.
|
|
45
|
+
* ``LOG_OUTGOING_REQUESTS_EMIT_BODY``: Whether or not outgoing request bodies should be logged. Defaults to: ``True``.
|
|
46
|
+
* ``LOG_OUTGOING_REQUESTS_DB_SAVE``: Whether or not outgoing request logs should be saved to the database. Defaults to: ``False``.
|
|
47
|
+
* ``LOG_OUTGOING_REQUESTS_DB_SAVE_BODY``: Whether or not outgoing request bodies should be saved to the database. Defaults to: ``True``.
|
|
48
|
+
* ``LOG_OUTGOING_REQUESTS_MAX_AGE``: The amount of time after which request logs should be deleted from the database. Defaults to: ``7``.
|
|
45
49
|
|
|
46
50
|
|
|
47
51
|
Celery
|
|
48
52
|
------
|
|
49
53
|
|
|
54
|
+
* ``CELERY_LOGLEVEL``: control the verbosity of logging output for celery, independent of ``LOG_LEVEL``. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``INFO``.
|
|
50
55
|
* ``CELERY_RESULT_BACKEND``: the URL of the backend/broker that will be used by Celery to send the notifications. Defaults to: ``redis://localhost:6379/1``.
|
|
51
56
|
|
|
52
57
|
|
|
58
|
+
Cross-Origin-Resource-Sharing
|
|
59
|
+
-----------------------------
|
|
60
|
+
|
|
61
|
+
* ``CORS_ALLOW_ALL_ORIGINS``: allow cross-domain access from any client. Defaults to: ``False``.
|
|
62
|
+
* ``CORS_ALLOWED_ORIGINS``: explicitly list the allowed origins for cross-domain requests. Example: http://localhost:3000,https://some-app.gemeente.nl. Defaults to: ``[]``.
|
|
63
|
+
* ``CORS_ALLOWED_ORIGIN_REGEXES``: same as ``CORS_ALLOWED_ORIGINS``, but supports regular expressions. Defaults to: ``[]``.
|
|
64
|
+
* ``CORS_EXTRA_ALLOW_HEADERS``: headers that are allowed to be sent as part of the cross-domain request. By default, Authorization, Accept-Crs and Content-Crs are already included. The value of this variable is added to these already included headers. Defaults to: ``[]``.
|
|
65
|
+
|
|
66
|
+
|
|
53
67
|
Elastic APM
|
|
54
68
|
-----------
|
|
55
69
|
|
|
@@ -83,11 +97,6 @@ Optional
|
|
|
83
97
|
* ``EMAIL_HOST_PASSWORD``: password to connect to the mail server. Defaults to: ``(empty string)``.
|
|
84
98
|
* ``EMAIL_USE_TLS``: whether to use TLS or not to connect to the mail server. Should be True if you're changing the ``EMAIL_PORT`` to 487. Defaults to: ``False``.
|
|
85
99
|
* ``DEFAULT_FROM_EMAIL``: The default email address from which emails are sent. Defaults to: ``testapp@example.com``.
|
|
86
|
-
* ``LOG_STDOUT``: whether to log to stdout or not. Defaults to: ``True``.
|
|
87
|
-
* ``LOG_LEVEL``: control the verbosity of logging output. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``WARNING``.
|
|
88
|
-
* ``LOG_QUERIES``: enable (query) logging at the database backend level. Note that you must also set ``DEBUG=1``, which should be done very sparingly!. Defaults to: ``False``.
|
|
89
|
-
* ``LOG_REQUESTS``: enable logging of the outgoing requests. Defaults to: ``False``.
|
|
90
|
-
* ``CELERY_LOGLEVEL``: control the verbosity of logging output for celery, independent of ``LOG_LEVEL``. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``INFO``.
|
|
91
100
|
* ``SESSION_COOKIE_AGE``: For how long, in seconds, the session cookie will be valid. Defaults to: ``1209600``.
|
|
92
101
|
* ``SESSION_COOKIE_SAMESITE``: The value of the SameSite flag on the session cookie. This flag prevents the cookie from being sent in cross-site requests thus preventing CSRF attacks and making some methods of stealing session cookie impossible.Currently interferes with OIDC. Keep the value set at Lax if used. Defaults to: ``Lax``.
|
|
93
102
|
* ``CSRF_COOKIE_SAMESITE``: The value of the SameSite flag on the CSRF cookie. This flag prevents the cookie from being sent in cross-site requests. Defaults to: ``Strict``.
|
|
@@ -100,10 +109,6 @@ Optional
|
|
|
100
109
|
* ``SITE_DOMAIN``: Defines the primary domain where the application is hosted. Defaults to: ``(empty string)``.
|
|
101
110
|
* ``SENTRY_DSN``: URL of the sentry project to send error reports to. Default empty, i.e. -> no monitoring set up. Highly recommended to configure this.
|
|
102
111
|
* ``DISABLE_2FA``: Whether or not two factor authentication should be disabled. Defaults to: ``False``.
|
|
103
|
-
* ``LOG_OUTGOING_REQUESTS_EMIT_BODY``: Whether or not outgoing request bodies should be logged. Defaults to: ``True``.
|
|
104
|
-
* ``LOG_OUTGOING_REQUESTS_DB_SAVE``: Whether or not outgoing request logs should be saved to the database. Defaults to: ``False``.
|
|
105
|
-
* ``LOG_OUTGOING_REQUESTS_DB_SAVE_BODY``: Whether or not outgoing request bodies should be saved to the database. Defaults to: ``True``.
|
|
106
|
-
* ``LOG_OUTGOING_REQUESTS_MAX_AGE``: The amount of time after which request logs should be deleted from the database. Defaults to: ``7``.
|
|
107
112
|
|
|
108
113
|
|
|
109
114
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from django.conf import settings
|
|
2
|
+
from django.urls import reverse
|
|
3
|
+
|
|
4
|
+
import requests_mock
|
|
5
|
+
from django_webtest import WebTest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_sentry_settings():
|
|
9
|
+
"""
|
|
10
|
+
test that sentry settings are initialized
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
assert hasattr(settings, "SENTRY_CONFIG") is True
|
|
14
|
+
assert hasattr(settings, "SENTRY_DSN") is True
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@requests_mock.Mocker()
|
|
18
|
+
class RosettaTests(WebTest):
|
|
19
|
+
def test_rosetta_redirect_fails_with_lazy_login_url(self, m):
|
|
20
|
+
response = self.app.get("/admin/rosetta/files/project/")
|
|
21
|
+
|
|
22
|
+
expected_login_url = (
|
|
23
|
+
reverse(settings.LOGIN_URL) + "?next=/admin/rosetta/files/project/"
|
|
24
|
+
)
|
|
25
|
+
self.assertEqual(response.status_code, 302)
|
|
26
|
+
self.assertEqual(response.location, expected_login_url)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/context_processors.py
RENAMED
|
File without changes
|
{open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/management/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templatetags/__init__.py
RENAMED
|
File without changes
|
{open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework/templatetags/doc_tags.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{open_api_framework-0.9.6 → open_api_framework-0.10.1}/open_api_framework.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|