pyaxencoapi 2.0.0__tar.gz → 2.0.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 (23) hide show
  1. {pyaxencoapi-2.0.0/src/pyaxencoapi.egg-info → pyaxencoapi-2.0.1}/PKG-INFO +1 -1
  2. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/pyproject.toml +1 -1
  3. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/api.py +4 -3
  4. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1/src/pyaxencoapi.egg-info}/PKG-INFO +1 -1
  5. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/test_api.py +9 -0
  6. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/LICENSE +0 -0
  7. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/MANIFEST.in +0 -0
  8. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/README.md +0 -0
  9. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/scripts/check_distribution.py +0 -0
  10. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/setup.cfg +0 -0
  11. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/__init__.py +0 -0
  12. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/const.py +0 -0
  13. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/exceptions.py +0 -0
  14. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/models.py +0 -0
  15. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/py.typed +0 -0
  16. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/utils.py +0 -0
  17. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/SOURCES.txt +0 -0
  18. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/dependency_links.txt +0 -0
  19. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/requires.txt +0 -0
  20. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/top_level.txt +0 -0
  21. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/test_models.py +0 -0
  22. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/typing/public_client.py +0 -0
  23. {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/typing/public_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaxencoapi
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Librairie d'utilisation de l'API REST/Websocket d'Axenco
5
5
  Author-email: Axenco <contact-dev@axenco.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyaxencoapi"
3
- version = "2.0.0"
3
+ version = "2.0.1"
4
4
  description = "Librairie d'utilisation de l'API REST/Websocket d'Axenco"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Axenco", email = "contact-dev@axenco.com" }]
@@ -460,11 +460,12 @@ class PyAxencoAPI:
460
460
  raise self._refresh_failure
461
461
  if not self.refresh_token:
462
462
  raise AxencoAuthError("Missing refresh token")
463
+ # The endpoint expects the expired access token plus the refresh token.
463
464
  headers = self.get_auth_headers()
464
- headers["Authorization"] = f"Bearer {self.refresh_token}"
465
+ headers["refresh-token"] = self.refresh_token
465
466
  try:
466
467
  response = await self._request(
467
- "POST",
468
+ "GET",
468
469
  "/v1/auth/token",
469
470
  headers=headers,
470
471
  authenticated=False,
@@ -493,7 +494,7 @@ class PyAxencoAPI:
493
494
  try:
494
495
  await self.disconnect_websocket()
495
496
  if self.token:
496
- await self._request("DELETE", "/v1/auth/logout", read_json=False)
497
+ await self._request("POST", "/v1/auth/logout", read_json=False)
497
498
  finally:
498
499
  self.token = self.refresh_token = self.user_id = None
499
500
  self._subscribers.clear()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaxencoapi
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Librairie d'utilisation de l'API REST/Websocket d'Axenco
5
5
  Author-email: Axenco <contact-dev@axenco.com>
6
6
  License: MIT
@@ -82,7 +82,16 @@ class Server:
82
82
  )
83
83
  if request.path == "/v1/auth/login":
84
84
  return web.json_response(self.login_payload)
85
+ # Mirror the User endpoint routes: GET /auth/token, POST /auth/logout.
86
+ if request.path == "/v1/auth/logout" and request.method != "POST":
87
+ return web.Response(status=404)
85
88
  if request.path == "/v1/auth/token":
89
+ if request.method != "GET":
90
+ return web.Response(status=404)
91
+ if not request.headers.get("refresh-token") or not request.headers.get(
92
+ "Authorization"
93
+ ):
94
+ return web.Response(status=400)
86
95
  self.refresh_count += 1
87
96
  await asyncio.sleep(0.02)
88
97
  return web.json_response(self.refresh_payload, status=self.refresh_status)
File without changes
File without changes
File without changes
File without changes