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.
- {pyaxencoapi-2.0.0/src/pyaxencoapi.egg-info → pyaxencoapi-2.0.1}/PKG-INFO +1 -1
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/pyproject.toml +1 -1
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/api.py +4 -3
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1/src/pyaxencoapi.egg-info}/PKG-INFO +1 -1
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/test_api.py +9 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/LICENSE +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/MANIFEST.in +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/README.md +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/scripts/check_distribution.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/setup.cfg +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/__init__.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/const.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/exceptions.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/models.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/py.typed +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi/utils.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/SOURCES.txt +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/dependency_links.txt +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/requires.txt +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/src/pyaxencoapi.egg-info/top_level.txt +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/test_models.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/typing/public_client.py +0 -0
- {pyaxencoapi-2.0.0 → pyaxencoapi-2.0.1}/tests/typing/public_models.py +0 -0
|
@@ -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["
|
|
465
|
+
headers["refresh-token"] = self.refresh_token
|
|
465
466
|
try:
|
|
466
467
|
response = await self._request(
|
|
467
|
-
"
|
|
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("
|
|
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()
|
|
@@ -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
|
|
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
|