apis-acdhch-default-settings 2.13.0__tar.gz → 2.15.0__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.
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.github/workflows/add-to-project.yml +1 -1
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.github/workflows/linters.yml +7 -7
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/CHANGELOG.md +18 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/PKG-INFO +3 -3
- apis_acdhch_default_settings-2.15.0/apis_acdhch_default_settings/ldapauth.py +25 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/settings.py +6 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/pyproject.toml +3 -3
- apis_acdhch_default_settings-2.13.0/apis_acdhch_default_settings/ldapauth.py +0 -12
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.github/dependabot.yml +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.github/workflows/publish.yml +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.github/workflows/release-please.yml +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.gitignore +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/LICENSE +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/README.md +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/__init__.py +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.mo +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.po +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/querysets.py +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/templates/base.html +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/templates/e53_place_from_typesense_autocomplete_result.html +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/templates/imprint.html +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/templates/partials/footer.html +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/urls.py +0 -0
- {apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/apis_acdhch_default_settings/views.py +0 -0
|
@@ -13,7 +13,7 @@ on:
|
|
|
13
13
|
|
|
14
14
|
jobs:
|
|
15
15
|
add-to-project:
|
|
16
|
-
uses: acdh-oeaw/prosnet-workflows/.github/workflows/add-to-project.yml@v0.
|
|
16
|
+
uses: acdh-oeaw/prosnet-workflows/.github/workflows/add-to-project.yml@v0.6.0
|
|
17
17
|
secrets:
|
|
18
18
|
ADD_TO_PROJECT_TOKEN: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
|
|
19
19
|
with:
|
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
- uses: actions/checkout@v5
|
|
14
14
|
|
|
15
15
|
- name: Install uv
|
|
16
|
-
uses: astral-sh/setup-uv@
|
|
16
|
+
uses: astral-sh/setup-uv@v7
|
|
17
17
|
|
|
18
18
|
- name: Run ruff format
|
|
19
19
|
run: uv run --only-dev ruff format --check .
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
- uses: actions/checkout@v5
|
|
26
26
|
|
|
27
27
|
- name: Install uv
|
|
28
|
-
uses: astral-sh/setup-uv@
|
|
28
|
+
uses: astral-sh/setup-uv@v7
|
|
29
29
|
|
|
30
30
|
- name: Run ruff check
|
|
31
31
|
run: uv run --only-dev ruff check .
|
|
@@ -37,9 +37,9 @@ jobs:
|
|
|
37
37
|
- uses: actions/checkout@v5
|
|
38
38
|
|
|
39
39
|
- name: Install uv
|
|
40
|
-
uses: astral-sh/setup-uv@
|
|
40
|
+
uses: astral-sh/setup-uv@v7
|
|
41
41
|
|
|
42
|
-
- name: Run
|
|
42
|
+
- name: Run djLint formatter
|
|
43
43
|
run: uv run --only-dev djlint --check .
|
|
44
44
|
|
|
45
45
|
djlint-linter:
|
|
@@ -49,9 +49,9 @@ jobs:
|
|
|
49
49
|
- uses: actions/checkout@v5
|
|
50
50
|
|
|
51
51
|
- name: Install uv
|
|
52
|
-
uses: astral-sh/setup-uv@
|
|
52
|
+
uses: astral-sh/setup-uv@v7
|
|
53
53
|
|
|
54
|
-
- name: Run
|
|
54
|
+
- name: Run djLint linter
|
|
55
55
|
run: uv run --only-dev djlint --lint .
|
|
56
56
|
|
|
57
57
|
deptry:
|
|
@@ -61,7 +61,7 @@ jobs:
|
|
|
61
61
|
- uses: actions/checkout@v5
|
|
62
62
|
|
|
63
63
|
- name: Install uv
|
|
64
|
-
uses: astral-sh/setup-uv@
|
|
64
|
+
uses: astral-sh/setup-uv@v7
|
|
65
65
|
|
|
66
66
|
- name: Run deptry
|
|
67
67
|
run: uv run --only-dev deptry .
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.15.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.14.0...v2.15.0) (2025-10-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **ldapauth:** add debug log if user not in list ([9c746bf](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/9c746bf04999cce5ba862909e5592e7ab0bee175))
|
|
9
|
+
* **ldapauth:** allow to define the user list in a file ([bfb5cf4](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/bfb5cf4726f72ee6d2985a8b9d13965bc673abe8)), closes [#252](https://github.com/acdh-oeaw/apis-acdhch-default-settings/issues/252)
|
|
10
|
+
* **settings:** add *.acdh-dev.oeaw.ac.at to CSP_IMG_SRC ([0edf189](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/0edf18911f92f641d555576600e004ebe2d7136b)), closes [#259](https://github.com/acdh-oeaw/apis-acdhch-default-settings/issues/259)
|
|
11
|
+
|
|
12
|
+
## [2.14.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.13.0...v2.14.0) (2025-09-24)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **settings:** add AuditlogMiddleware to MIDDLEWAREs ([e69a47e](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/e69a47e31081cf6e7d6f98f44e3846e1dce54a33))
|
|
18
|
+
* **settings:** add HtmxMessageMiddleware to MIDDLEWAREs ([233a00c](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/233a00cb7f43d2b9fa0813ee7f37945fab49f1b5))
|
|
19
|
+
* **settings:** add uris to INSTALLED_APPS ([37ff4df](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/37ff4df3849f13f3da725b515d8d1e6f654f5df4)), closes [#247](https://github.com/acdh-oeaw/apis-acdhch-default-settings/issues/247)
|
|
20
|
+
|
|
3
21
|
## [2.13.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.12.2...v2.13.0) (2025-09-08)
|
|
4
22
|
|
|
5
23
|
|
|
@@ -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
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import pathlib
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
from django_auth_ldap.backend import LDAPBackend
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CustomLDAPBackend(LDAPBackend):
|
|
11
|
+
def authenticate_ldap_user(self, user, *args, **kwargs):
|
|
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)
|
|
19
|
+
user_list = list(map(str.strip, user_list))
|
|
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
|
+
)
|
|
24
|
+
return None
|
|
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,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "apis-acdhch-default-settings"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.15.0"
|
|
4
4
|
description = "Default settings for APIS instances at the ACDH-CH"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.13"
|
|
7
7
|
authors = [{ name = "Birger Schacht", email = "birger.schacht@oeaw.ac.at" }]
|
|
8
8
|
license = "MIT"
|
|
9
9
|
dependencies = [
|
|
@@ -21,7 +21,7 @@ dependencies = [
|
|
|
21
21
|
"opentelemetry-distro",
|
|
22
22
|
"django-removals>=1.0.5,<=2.0",
|
|
23
23
|
"django>=5",
|
|
24
|
-
"apis-core-rdf>=0.
|
|
24
|
+
"apis-core-rdf>=0.54.0",
|
|
25
25
|
"requests>=2",
|
|
26
26
|
"django-auditlog>=3.1.2",
|
|
27
27
|
"apis-acdhch-django-auditlog>=0.2.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
from django_auth_ldap.backend import LDAPBackend
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class CustomLDAPBackend(LDAPBackend):
|
|
7
|
-
def authenticate_ldap_user(self, user, *args, **kwargs):
|
|
8
|
-
user_list = os.environ.get("AUTH_LDAP_USER_LIST", "").split(",")
|
|
9
|
-
user_list = list(map(str.strip, user_list))
|
|
10
|
-
if user._username not in user_list:
|
|
11
|
-
return None
|
|
12
|
-
return super().authenticate_ldap_user(user, *args, **kwargs)
|
{apis_acdhch_default_settings-2.13.0 → apis_acdhch_default_settings-2.15.0}/.github/dependabot.yml
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|