apis-acdhch-default-settings 2.14.0__tar.gz → 2.16.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.
Files changed (24) hide show
  1. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/.github/workflows/add-to-project.yml +1 -1
  2. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/.github/workflows/linters.yml +10 -10
  3. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/.github/workflows/publish.yml +3 -3
  4. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/.github/workflows/release-please.yml +1 -1
  5. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/CHANGELOG.md +16 -0
  6. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/PKG-INFO +3 -3
  7. apis_acdhch_default_settings-2.16.0/apis_acdhch_default_settings/ldapauth.py +25 -0
  8. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/querysets.py +8 -3
  9. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/settings.py +1 -0
  10. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/pyproject.toml +3 -3
  11. apis_acdhch_default_settings-2.14.0/apis_acdhch_default_settings/ldapauth.py +0 -12
  12. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/.github/dependabot.yml +0 -0
  13. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/.gitignore +0 -0
  14. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/LICENSE +0 -0
  15. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/README.md +0 -0
  16. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/__init__.py +0 -0
  17. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.mo +0 -0
  18. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/locale/de/LC_MESSAGES/django.po +0 -0
  19. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/templates/base.html +0 -0
  20. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/templates/e53_place_from_typesense_autocomplete_result.html +0 -0
  21. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/templates/imprint.html +0 -0
  22. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/templates/partials/footer.html +0 -0
  23. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.0}/apis_acdhch_default_settings/urls.py +0 -0
  24. {apis_acdhch_default_settings-2.14.0 → apis_acdhch_default_settings-2.16.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.5.2
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:
@@ -10,10 +10,10 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v5
13
+ - uses: actions/checkout@v6
14
14
 
15
15
  - name: Install uv
16
- uses: astral-sh/setup-uv@v6
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 .
@@ -22,10 +22,10 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
 
24
24
  steps:
25
- - uses: actions/checkout@v5
25
+ - uses: actions/checkout@v6
26
26
 
27
27
  - name: Install uv
28
- uses: astral-sh/setup-uv@v6
28
+ uses: astral-sh/setup-uv@v7
29
29
 
30
30
  - name: Run ruff check
31
31
  run: uv run --only-dev ruff check .
@@ -34,10 +34,10 @@ jobs:
34
34
  runs-on: ubuntu-latest
35
35
 
36
36
  steps:
37
- - uses: actions/checkout@v5
37
+ - uses: actions/checkout@v6
38
38
 
39
39
  - name: Install uv
40
- uses: astral-sh/setup-uv@v6
40
+ uses: astral-sh/setup-uv@v7
41
41
 
42
42
  - name: Run djLint formatter
43
43
  run: uv run --only-dev djlint --check .
@@ -46,10 +46,10 @@ jobs:
46
46
  runs-on: ubuntu-latest
47
47
 
48
48
  steps:
49
- - uses: actions/checkout@v5
49
+ - uses: actions/checkout@v6
50
50
 
51
51
  - name: Install uv
52
- uses: astral-sh/setup-uv@v6
52
+ uses: astral-sh/setup-uv@v7
53
53
 
54
54
  - name: Run djLint linter
55
55
  run: uv run --only-dev djlint --lint .
@@ -58,10 +58,10 @@ jobs:
58
58
  runs-on: ubuntu-latest
59
59
 
60
60
  steps:
61
- - uses: actions/checkout@v5
61
+ - uses: actions/checkout@v6
62
62
 
63
63
  - name: Install uv
64
- uses: astral-sh/setup-uv@v6
64
+ uses: astral-sh/setup-uv@v7
65
65
 
66
66
  - name: Run deptry
67
67
  run: uv run --only-dev deptry .
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
 
13
13
  steps:
14
- - uses: actions/checkout@v5
14
+ - uses: actions/checkout@v6
15
15
  - name: Set up Python
16
16
  uses: actions/setup-python@v6
17
17
  with:
@@ -31,7 +31,7 @@ jobs:
31
31
  - name: Build a binary wheel and a source tarball
32
32
  run: python3 -m build
33
33
  - name: Store the distribution packages
34
- uses: actions/upload-artifact@v4
34
+ uses: actions/upload-artifact@v5
35
35
  with:
36
36
  name: python-package-distributions
37
37
  path: dist/
@@ -48,7 +48,7 @@ jobs:
48
48
 
49
49
  steps:
50
50
  - name: Download all the dists
51
- uses: actions/download-artifact@v5
51
+ uses: actions/download-artifact@v6
52
52
  with:
53
53
  name: python-package-distributions
54
54
  path: dist/
@@ -21,7 +21,7 @@ jobs:
21
21
  with:
22
22
  release-type: python
23
23
  package-name: apis-acdhch-default-settings
24
- - uses: actions/checkout@v5
24
+ - uses: actions/checkout@v6
25
25
  - run: gh workflow run publish.yml
26
26
  env:
27
27
  GH_TOKEN: ${{ github.token }}
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.16.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.15.0...v2.16.0) (2025-12-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **querysets:** add data-mapping to autocompletes ([d39ce20](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/d39ce20ddbab95b225d75dc7f16d20b61c54751b))
9
+
10
+ ## [2.15.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.14.0...v2.15.0) (2025-10-10)
11
+
12
+
13
+ ### Features
14
+
15
+ * **ldapauth:** add debug log if user not in list ([9c746bf](https://github.com/acdh-oeaw/apis-acdhch-default-settings/commit/9c746bf04999cce5ba862909e5592e7ab0bee175))
16
+ * **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)
17
+ * **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)
18
+
3
19
  ## [2.14.0](https://github.com/acdh-oeaw/apis-acdhch-default-settings/compare/v2.13.0...v2.14.0) (2025-09-24)
4
20
 
5
21
 
@@ -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.16.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
11
+ Requires-Python: >=3.13
12
12
  Requires-Dist: apis-acdhch-django-auditlog>=0.2.1
13
- Requires-Dist: apis-core-rdf>=0.54.0
13
+ Requires-Dist: apis-core-rdf>=0.58.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)
@@ -13,7 +13,8 @@ class E74_GroupExternalAutocomplete(ExternalAutocomplete):
13
13
  params={
14
14
  "filter": "type:CorporateBody",
15
15
  "format": "json:preferredName,geographicAreaCode,dateOfEstablishment,broaderTermInstantial",
16
- }
16
+ },
17
+ data_mapping={"label": "label"},
17
18
  ),
18
19
  ]
19
20
 
@@ -28,12 +29,14 @@ class E53_PlaceExternalAutocomplete(ExternalAutocomplete):
28
29
  template="e53_place_from_typesense_autocomplete_result.html",
29
30
  token=os.getenv("TYPESENSE_TOKEN", None),
30
31
  server=os.getenv("TYPESENSE_SERVER", None),
32
+ data_mapping={"label": ["document", "label"]},
31
33
  ),
32
34
  LobidAutocompleteAdapter(
33
35
  params={
34
36
  "filter": "type:PlaceOrGeographicName",
35
37
  "format": "json:preferredName",
36
- }
38
+ },
39
+ data_mapping={"label": "label"},
37
40
  ),
38
41
  ]
39
42
 
@@ -44,11 +47,13 @@ class E21_PersonExternalAutocomplete(ExternalAutocomplete):
44
47
  collections="prosnet-wikidata-person-index",
45
48
  token=os.getenv("TYPESENSE_TOKEN", None),
46
49
  server=os.getenv("TYPESENSE_SERVER", None),
50
+ data_mapping={"surname": ["document", "label"]},
47
51
  ),
48
52
  LobidAutocompleteAdapter(
49
53
  params={
50
54
  "filter": "type:Person",
51
55
  "format": "json:preferredName,professionOrOccupation",
52
- }
56
+ },
57
+ data_mapping={"surname": "label"},
53
58
  ),
54
59
  ]
@@ -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,9 +1,9 @@
1
1
  [project]
2
2
  name = "apis-acdhch-default-settings"
3
- version = "2.14.0"
3
+ version = "2.16.0"
4
4
  description = "Default settings for APIS instances at the ACDH-CH"
5
5
  readme = "README.md"
6
- requires-python = ">=3.11"
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.54.0",
24
+ "apis-core-rdf>=0.58.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)