apis-acdhch-default-settings 2.13.0__py3-none-any.whl → 2.15.0__py3-none-any.whl
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.
- apis_acdhch_default_settings/ldapauth.py +14 -1
- apis_acdhch_default_settings/settings.py +6 -0
- {apis_acdhch_default_settings-2.13.0.dist-info → apis_acdhch_default_settings-2.15.0.dist-info}/METADATA +3 -3
- {apis_acdhch_default_settings-2.13.0.dist-info → apis_acdhch_default_settings-2.15.0.dist-info}/RECORD +6 -6
- {apis_acdhch_default_settings-2.13.0.dist-info → apis_acdhch_default_settings-2.15.0.dist-info}/WHEEL +0 -0
- {apis_acdhch_default_settings-2.13.0.dist-info → apis_acdhch_default_settings-2.15.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import pathlib
|
|
3
|
+
import logging
|
|
2
4
|
|
|
3
5
|
from django_auth_ldap.backend import LDAPBackend
|
|
4
6
|
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
class CustomLDAPBackend(LDAPBackend):
|
|
7
11
|
def authenticate_ldap_user(self, user, *args, **kwargs):
|
|
8
|
-
|
|
12
|
+
env = os.environ.get("AUTH_LDAP_USER_LIST", "")
|
|
13
|
+
user_list = env.split(",")
|
|
14
|
+
if env.startswith("file://"):
|
|
15
|
+
try:
|
|
16
|
+
user_list = pathlib.Path.from_uri(env).read_text().splitlines()
|
|
17
|
+
except Exception as e:
|
|
18
|
+
logger.debug("Error reading user list from file: %s", e)
|
|
9
19
|
user_list = list(map(str.strip, user_list))
|
|
10
20
|
if user._username not in user_list:
|
|
21
|
+
logger.debug(
|
|
22
|
+
"User %s not in AUTH_LDAP_USER_LIST, passing on", user._username
|
|
23
|
+
)
|
|
11
24
|
return None
|
|
12
25
|
return super().authenticate_ldap_user(user, *args, **kwargs)
|
|
@@ -32,6 +32,7 @@ INSTALLED_APPS = [
|
|
|
32
32
|
"apis_core.generic",
|
|
33
33
|
"apis_core.collections",
|
|
34
34
|
"apis_core.history",
|
|
35
|
+
"apis_core.uris",
|
|
35
36
|
"apis_core.relations",
|
|
36
37
|
"apis_core.apis_entities",
|
|
37
38
|
"apis_core.apis_metainfo",
|
|
@@ -70,6 +71,7 @@ CSP_DEFAULT_SRC = (
|
|
|
70
71
|
CSP_IMG_SRC = [
|
|
71
72
|
"'self'",
|
|
72
73
|
"*.acdh.oeaw.ac.at",
|
|
74
|
+
"*.acdh-dev.oeaw.ac.at",
|
|
73
75
|
"data:",
|
|
74
76
|
"*.openstreetmap.org",
|
|
75
77
|
"cdnjs.cloudflare.com",
|
|
@@ -119,6 +121,10 @@ MIDDLEWARE = [
|
|
|
119
121
|
"crum.CurrentRequestUserMiddleware",
|
|
120
122
|
# this is used by the apis_core.history module:
|
|
121
123
|
"simple_history.middleware.HistoryRequestMiddleware",
|
|
124
|
+
# a middleware to add Django messages to response headers
|
|
125
|
+
"apis_core.generic.middleware.HtmxMessageMiddleware",
|
|
126
|
+
# allow auditlog to automatically set the actor for log entries
|
|
127
|
+
"auditlog.middleware.AuditlogMiddleware",
|
|
122
128
|
]
|
|
123
129
|
|
|
124
130
|
# https://docs.djangoproject.com/en/stable/ref/settings/#root-urlconf
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apis-acdhch-default-settings
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.15.0
|
|
4
4
|
Summary: Default settings for APIS instances at the ACDH-CH
|
|
5
5
|
Project-URL: source, https://github.com/acdh-oeaw/apis-acdhch-default-settings
|
|
6
6
|
Project-URL: changelog, https://github.com/acdh-oeaw/apis-acdhch-default-settings/blob/main/CHANGELOG.md
|
|
@@ -8,9 +8,9 @@ Project-URL: issues, https://github.com/acdh-oeaw/apis-acdhch-default-settings/i
|
|
|
8
8
|
Author-email: Birger Schacht <birger.schacht@oeaw.ac.at>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.13
|
|
12
12
|
Requires-Dist: apis-acdhch-django-auditlog>=0.2.1
|
|
13
|
-
Requires-Dist: apis-core-rdf>=0.
|
|
13
|
+
Requires-Dist: apis-core-rdf>=0.54.0
|
|
14
14
|
Requires-Dist: dj-database-url<4.0,>=2.0.0
|
|
15
15
|
Requires-Dist: django-allow-cidr<0.9,>=0.6
|
|
16
16
|
Requires-Dist: django-auditlog>=3.1.2
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apis_acdhch_default_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
apis_acdhch_default_settings/ldapauth.py,sha256=
|
|
2
|
+
apis_acdhch_default_settings/ldapauth.py,sha256=pvb_oak-dGeg0iN8M0M4iwL3wBBwtVXdzNdmj7fKvr4,873
|
|
3
3
|
apis_acdhch_default_settings/querysets.py,sha256=zu1NLUSV48vITX-2QuPR59zMBPe-lvQwvLl6yTIyFhE,1598
|
|
4
|
-
apis_acdhch_default_settings/settings.py,sha256=
|
|
4
|
+
apis_acdhch_default_settings/settings.py,sha256=NGsTodeW8LTdzBFIM-FM2VHIfEj3jMZseFABdF6TO88,9226
|
|
5
5
|
apis_acdhch_default_settings/urls.py,sha256=WZNKn2PhxPlDlQSitK1XRgqxVK8UB9vBfLGr-wC8Atg,1069
|
|
6
6
|
apis_acdhch_default_settings/views.py,sha256=Xffr0DkaIr81BTj0xlqUMd38C8XGYubL9RJkBxrcAyE,1044
|
|
7
7
|
apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.mo,sha256=ca6G5CeEdkrD7cVblXxxJNNiSJcP2Hq1AbMnG7usF18,422
|
|
@@ -10,7 +10,7 @@ apis_acdhch_default_settings/templates/base.html,sha256=GMvCi3Vci-GhM31ILNN3zQjS
|
|
|
10
10
|
apis_acdhch_default_settings/templates/e53_place_from_typesense_autocomplete_result.html,sha256=Tpkes1Q5MDn3A4vHznA2YBG5AJAVA4A4cmxvr0P60jE,589
|
|
11
11
|
apis_acdhch_default_settings/templates/imprint.html,sha256=8P6TUA0bkhXTQAhCiFZONe_xJhPt8YvNTzNmAWNWZ0k,270
|
|
12
12
|
apis_acdhch_default_settings/templates/partials/footer.html,sha256=CgKfS8KA8RAEeccpoinrpF8Zub3IWhOmPl9gv39uKSc,648
|
|
13
|
-
apis_acdhch_default_settings-2.
|
|
14
|
-
apis_acdhch_default_settings-2.
|
|
15
|
-
apis_acdhch_default_settings-2.
|
|
16
|
-
apis_acdhch_default_settings-2.
|
|
13
|
+
apis_acdhch_default_settings-2.15.0.dist-info/METADATA,sha256=axByoj5XxL1zwGqewXLxTE2EF-xCFBaccwVRwFCZ8bk,1482
|
|
14
|
+
apis_acdhch_default_settings-2.15.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
apis_acdhch_default_settings-2.15.0.dist-info/licenses/LICENSE,sha256=cMJgiPvvZVbZQcWrf-s1Es1W2b8sxKA0C7HlD4n8_Oo,1146
|
|
16
|
+
apis_acdhch_default_settings-2.15.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|