apis-acdhch-default-settings 2.14.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.
@@ -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
- user_list = os.environ.get("AUTH_LDAP_USER_LIST", "").split(",")
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)
@@ -71,6 +71,7 @@ CSP_DEFAULT_SRC = (
71
71
  CSP_IMG_SRC = [
72
72
  "'self'",
73
73
  "*.acdh.oeaw.ac.at",
74
+ "*.acdh-dev.oeaw.ac.at",
74
75
  "data:",
75
76
  "*.openstreetmap.org",
76
77
  "cdnjs.cloudflare.com",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apis-acdhch-default-settings
3
- Version: 2.14.0
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,7 +8,7 @@ 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
11
+ Requires-Python: >=3.13
12
12
  Requires-Dist: apis-acdhch-django-auditlog>=0.2.1
13
13
  Requires-Dist: apis-core-rdf>=0.54.0
14
14
  Requires-Dist: dj-database-url<4.0,>=2.0.0
@@ -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=P1NDgWG2Pp4JzqoETq3VDC3DtECoEIXWBA3Lzn6CUIA,423
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=dgu_j_50bPxsIxJCArr5AWqcvMLLMt8QYQfzGsBXZP4,9197
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.0.dist-info/METADATA,sha256=oOoFMnHx7eaoK3MNyx_-_EUtSpjkHEEi9S8ZOWc1EMw,1482
14
- apis_acdhch_default_settings-2.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- apis_acdhch_default_settings-2.14.0.dist-info/licenses/LICENSE,sha256=cMJgiPvvZVbZQcWrf-s1Es1W2b8sxKA0C7HlD4n8_Oo,1146
16
- apis_acdhch_default_settings-2.14.0.dist-info/RECORD,,
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,,