mantelo 2.2.0__tar.gz → 2.2.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.
Files changed (60) hide show
  1. mantelo-2.2.1/.release-please-manifest.json +1 -0
  2. {mantelo-2.2.0 → mantelo-2.2.1}/CHANGELOG.md +12 -0
  3. {mantelo-2.2.0 → mantelo-2.2.1}/Makefile +2 -2
  4. {mantelo-2.2.0 → mantelo-2.2.1}/PKG-INFO +7 -6
  5. {mantelo-2.2.0 → mantelo-2.2.1}/README.md +4 -4
  6. {mantelo-2.2.0 → mantelo-2.2.1}/docs/index.rst +2 -2
  7. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/connection.py +9 -0
  8. mantelo-2.2.1/mantelo/version.py +24 -0
  9. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo.egg-info/PKG-INFO +7 -6
  10. {mantelo-2.2.0 → mantelo-2.2.1}/tests/test_client.py +1 -1
  11. mantelo-2.2.0/.release-please-manifest.json +0 -1
  12. mantelo-2.2.0/mantelo/version.py +0 -16
  13. {mantelo-2.2.0 → mantelo-2.2.1}/.gitignore +0 -0
  14. {mantelo-2.2.0 → mantelo-2.2.1}/.readthedocs.yaml +0 -0
  15. {mantelo-2.2.0 → mantelo-2.2.1}/CODEOWNERS +0 -0
  16. {mantelo-2.2.0 → mantelo-2.2.1}/CONTRIBUTING.md +0 -0
  17. {mantelo-2.2.0 → mantelo-2.2.1}/LICENSE +0 -0
  18. {mantelo-2.2.0 → mantelo-2.2.1}/MANIFEST.in +0 -0
  19. {mantelo-2.2.0 → mantelo-2.2.1}/docker-compose.yml +0 -0
  20. {mantelo-2.2.0 → mantelo-2.2.1}/docs/00-getting_started.rst +0 -0
  21. {mantelo-2.2.0 → mantelo-2.2.1}/docs/01-authentication.rst +0 -0
  22. {mantelo-2.2.0 → mantelo-2.2.1}/docs/02-making-calls.rst +0 -0
  23. {mantelo-2.2.0 → mantelo-2.2.1}/docs/03-examples.rst +0 -0
  24. {mantelo-2.2.0 → mantelo-2.2.1}/docs/04-faq.rst +0 -0
  25. {mantelo-2.2.0 → mantelo-2.2.1}/docs/90-api.rst +0 -0
  26. {mantelo-2.2.0 → mantelo-2.2.1}/docs/Makefile +0 -0
  27. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/css/custom.css +0 -0
  28. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo-128.png +0 -0
  29. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo-256.png +0 -0
  30. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo-512.png +0 -0
  31. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo-social-preview.png +0 -0
  32. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo-text-900.png +0 -0
  33. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo.ico +0 -0
  34. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_static/images/mantelo.svg +0 -0
  35. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_templates/.gitkeep +0 -0
  36. {mantelo-2.2.0 → mantelo-2.2.1}/docs/_templates/layout.html +0 -0
  37. {mantelo-2.2.0 → mantelo-2.2.1}/docs/conf.py +0 -0
  38. {mantelo-2.2.0 → mantelo-2.2.1}/docs/make.bat +0 -0
  39. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/__init__.py +0 -0
  40. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/client.py +0 -0
  41. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/exceptions.py +0 -0
  42. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/internal/__init__.py +0 -0
  43. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/internal/api.py +0 -0
  44. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/internal/serializers.py +0 -0
  45. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo/py.typed +0 -0
  46. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo.egg-info/SOURCES.txt +0 -0
  47. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo.egg-info/dependency_links.txt +0 -0
  48. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo.egg-info/requires.txt +0 -0
  49. {mantelo-2.2.0 → mantelo-2.2.1}/mantelo.egg-info/top_level.txt +0 -0
  50. {mantelo-2.2.0 → mantelo-2.2.1}/pyproject.toml +0 -0
  51. {mantelo-2.2.0 → mantelo-2.2.1}/setup.cfg +0 -0
  52. {mantelo-2.2.0 → mantelo-2.2.1}/tests/__init__.py +0 -0
  53. {mantelo-2.2.0 → mantelo-2.2.1}/tests/conftest.py +0 -0
  54. {mantelo-2.2.0 → mantelo-2.2.1}/tests/constants.py +0 -0
  55. {mantelo-2.2.0 → mantelo-2.2.1}/tests/internal/test_api.py +0 -0
  56. {mantelo-2.2.0 → mantelo-2.2.1}/tests/internal/test_serialiers.py +0 -0
  57. {mantelo-2.2.0 → mantelo-2.2.1}/tests/realms/master-realm.json +0 -0
  58. {mantelo-2.2.0 → mantelo-2.2.1}/tests/realms/orwell-realm.json +0 -0
  59. {mantelo-2.2.0 → mantelo-2.2.1}/tests/test_connection.py +0 -0
  60. {mantelo-2.2.0 → mantelo-2.2.1}/tox.ini +0 -0
@@ -0,0 +1 @@
1
+ {".":"2.2.1"}
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.1](https://github.com/derlin/mantelo/compare/v2.2.0...v2.2.1) (2026-04-13)
4
+
5
+
6
+ ### 🐛 Bug Fixes
7
+
8
+ * raise proper exception on invalid credentials on keycloak 26.6 ([1fce16a](https://github.com/derlin/mantelo/commit/1fce16ab47ce47f7f99bc9ca6460b5ae436caf21))
9
+
10
+
11
+ ### 💬 Documentation
12
+
13
+ * remove duplicated `Instead,` ([1f2e3c0](https://github.com/derlin/mantelo/commit/1f2e3c0eedb79087c7d7fb28e44b9481ef65479a))
14
+
3
15
  ## [2.2.0](https://github.com/derlin/mantelo/compare/v2.1.1...v2.2.0) (2024-12-29)
4
16
 
5
17
  **IMPORTANT**: This release removes the `slumber` dependency and integrates its functionality
@@ -34,9 +34,9 @@ lint: ## Run ruff to format and lint (inside docker).
34
34
  docker run --rm -e LINT_FOLDER_PYTHON=mantelo -v $(CURDIR):/app divio/lint /bin/lint ${ARGS} --run=python
35
35
 
36
36
  test: ## Run tests with tox (inside docker).
37
- coverage erase
37
+ coverage erase || true
38
38
  docker compose up -d --wait keycloak
39
- docker compose run --rm tox ${ARGS}
39
+ docker compose run tox bash -c "git config --system --add safe.directory /app && tox ${ARGS}"
40
40
  coverage combine
41
41
  coverage html
42
42
  coverage xml
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mantelo
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: ✨ Keycloak Admin REST Api Client for Python ✨
5
5
  Author-email: Lucy Linder <lucy.derlin@gmail.com>
6
6
  License: Apache License
@@ -245,6 +245,7 @@ Requires-Dist: sphinx-book-theme; extra == "docs"
245
245
  Requires-Dist: sphinx-autoapi; extra == "docs"
246
246
  Requires-Dist: sphinx-copybutton; extra == "docs"
247
247
  Requires-Dist: sphinxext-opengraph; extra == "docs"
248
+ Dynamic: license-file
248
249
 
249
250
  # mantelo: A Keycloak Admin REST Api Client for Python
250
251
 
@@ -260,10 +261,10 @@ Requires-Dist: sphinxext-opengraph; extra == "docs"
260
261
 
261
262
  > Mantelo [manˈtelo], from German "*Mantel*", from Late Latin "*mantum*" means "*cloak*" in Esperanto.
262
263
 
263
- It stays fresh and complete because it does not hard-code or wrap any endpoint. Instead, Instead, it
264
- offers a clean, object-oriented interface to the Keycloak RESTful API. Acting as a lightweight
265
- wrapper around the popular [requests](https://requests.readthedocs.io/en/latest/) library, mantelo
266
- takes care of all the boring details for you - like authentication (tokens and refresh tokens), URL
264
+ It stays fresh and complete because it does not hard-code or wrap any endpoint. Instead, it offers
265
+ a clean, object-oriented interface to the Keycloak RESTful API. Acting as a lightweight wrapper
266
+ around the popular [requests](https://requests.readthedocs.io/en/latest/) library, mantelo takes
267
+ care of all the boring details for you - like authentication (tokens and refresh tokens), URL
267
268
  management, serialization, and request processing
268
269
 
269
270
  Any endpoint your Keycloak supports, mantelo supports!
@@ -12,10 +12,10 @@
12
12
 
13
13
  > Mantelo [manˈtelo], from German "*Mantel*", from Late Latin "*mantum*" means "*cloak*" in Esperanto.
14
14
 
15
- It stays fresh and complete because it does not hard-code or wrap any endpoint. Instead, Instead, it
16
- offers a clean, object-oriented interface to the Keycloak RESTful API. Acting as a lightweight
17
- wrapper around the popular [requests](https://requests.readthedocs.io/en/latest/) library, mantelo
18
- takes care of all the boring details for you - like authentication (tokens and refresh tokens), URL
15
+ It stays fresh and complete because it does not hard-code or wrap any endpoint. Instead, it offers
16
+ a clean, object-oriented interface to the Keycloak RESTful API. Acting as a lightweight wrapper
17
+ around the popular [requests](https://requests.readthedocs.io/en/latest/) library, mantelo takes
18
+ care of all the boring details for you - like authentication (tokens and refresh tokens), URL
19
19
  management, serialization, and request processing
20
20
 
21
21
  Any endpoint your Keycloak supports, mantelo supports!
@@ -11,8 +11,8 @@ Mantelo: A Keycloak Admin REST Api Client for Python
11
11
  Mantelo [manˈtelo], from German "*Mantel*", from Late Latin "*mantum*" means "*cloak*" in Esperanto.
12
12
 
13
13
  It always stays **fresh** and **complete** because it does not hard-code or wrap any endpoint.
14
- Instead, Instead, it offers a clean, object-oriented interface to the Keycloak RESTful API. Acting
15
- as a lightweight wrapper around the popular `requests <https://requests.readthedocs.io/en/latest/>`_
14
+ Instead, it offers a clean, object-oriented interface to the Keycloak RESTful API. Acting as a
15
+ lightweight wrapper around the popular `requests <https://requests.readthedocs.io/en/latest/>`_
16
16
  library, mantelo takes care of all the boring details for you - like authentication (tokens and
17
17
  refresh tokens), URL management, serialization, and request processing [#mention]_.
18
18
 
@@ -214,6 +214,15 @@ class OpenidConnection(Connection, ABC):
214
214
  resp = self.session.post(self.auth_url, data=data, auth=_NO_AUTH)
215
215
  if resp.status_code == 401:
216
216
  raise AuthenticationException(**resp.json(), response=resp)
217
+ if resp.status_code == 400:
218
+ # In Keycloak 26.6.0, invalid credentials returns 400
219
+ error = resp.json()
220
+ if (
221
+ error.get("error_description", "")
222
+ == "Invalid user credentials"
223
+ ):
224
+ raise AuthenticationException(**error, response=resp)
225
+
217
226
  resp.raise_for_status()
218
227
  self._token = Token.from_dict(resp.json(), now=now)
219
228
  _logger.debug(
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '2.2.1'
22
+ __version_tuple__ = version_tuple = (2, 2, 1)
23
+
24
+ __commit_id__ = commit_id = 'g19e2c97f3'
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mantelo
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: ✨ Keycloak Admin REST Api Client for Python ✨
5
5
  Author-email: Lucy Linder <lucy.derlin@gmail.com>
6
6
  License: Apache License
@@ -245,6 +245,7 @@ Requires-Dist: sphinx-book-theme; extra == "docs"
245
245
  Requires-Dist: sphinx-autoapi; extra == "docs"
246
246
  Requires-Dist: sphinx-copybutton; extra == "docs"
247
247
  Requires-Dist: sphinxext-opengraph; extra == "docs"
248
+ Dynamic: license-file
248
249
 
249
250
  # mantelo: A Keycloak Admin REST Api Client for Python
250
251
 
@@ -260,10 +261,10 @@ Requires-Dist: sphinxext-opengraph; extra == "docs"
260
261
 
261
262
  > Mantelo [manˈtelo], from German "*Mantel*", from Late Latin "*mantum*" means "*cloak*" in Esperanto.
262
263
 
263
- It stays fresh and complete because it does not hard-code or wrap any endpoint. Instead, Instead, it
264
- offers a clean, object-oriented interface to the Keycloak RESTful API. Acting as a lightweight
265
- wrapper around the popular [requests](https://requests.readthedocs.io/en/latest/) library, mantelo
266
- takes care of all the boring details for you - like authentication (tokens and refresh tokens), URL
264
+ It stays fresh and complete because it does not hard-code or wrap any endpoint. Instead, it offers
265
+ a clean, object-oriented interface to the Keycloak RESTful API. Acting as a lightweight wrapper
266
+ around the popular [requests](https://requests.readthedocs.io/en/latest/) library, mantelo takes
267
+ care of all the boring details for you - like authentication (tokens and refresh tokens), URL
267
268
  management, serialization, and request processing
268
269
 
269
270
  Any endpoint your Keycloak supports, mantelo supports!
@@ -118,7 +118,7 @@ def test_switch_realm(openid_connection_admin):
118
118
  (403, lambda c: c.clients.get()),
119
119
  (400, lambda c: c.users.post({"foo": "bar"})),
120
120
  (400, lambda c: c.users.post({})),
121
- (405, lambda c: c.groups.head()),
121
+ (405, lambda c: c.groups.patch()),
122
122
  (405, lambda c: c.users.put({})),
123
123
  (404, lambda c: c.users("not-exist").get()),
124
124
  (
@@ -1 +0,0 @@
1
- {".":"2.2.0"}
@@ -1,16 +0,0 @@
1
- # file generated by setuptools_scm
2
- # don't change, don't track in version control
3
- TYPE_CHECKING = False
4
- if TYPE_CHECKING:
5
- from typing import Tuple, Union
6
- VERSION_TUPLE = Tuple[Union[int, str], ...]
7
- else:
8
- VERSION_TUPLE = object
9
-
10
- version: str
11
- __version__: str
12
- __version_tuple__: VERSION_TUPLE
13
- version_tuple: VERSION_TUPLE
14
-
15
- __version__ = version = '2.2.0'
16
- __version_tuple__ = version_tuple = (2, 2, 0)
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes