appmesh 1.4.3__py3-none-any.whl → 1.4.5__py3-none-any.whl
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.
appmesh/http_client.py
CHANGED
@@ -349,7 +349,7 @@ class AppMeshClient(metaclass=abc.ABCMeta):
|
|
349
349
|
timeout_seconds (int | str, optional): token expire timeout of seconds. support ISO 8601 durations (e.g., 'P1Y2M3DT4H5M6S' 'P1W').
|
350
350
|
|
351
351
|
Returns:
|
352
|
-
str: The new JWT token if renew success,
|
352
|
+
str: The new JWT token if renew success, the old token will be blocked.
|
353
353
|
"""
|
354
354
|
assert self.jwt_token
|
355
355
|
resp = self._request_http(
|
@@ -377,23 +377,26 @@ class AppMeshClient(metaclass=abc.ABCMeta):
|
|
377
377
|
return self._parse_totp_uri(totp_uri).get("secret")
|
378
378
|
raise Exception(resp.text)
|
379
379
|
|
380
|
-
def setup_totp(self, totp_code: str) ->
|
380
|
+
def setup_totp(self, totp_code: str) -> str:
|
381
381
|
"""Set up 2FA for the current user.
|
382
382
|
|
383
383
|
Args:
|
384
384
|
totp_code (str): TOTP code
|
385
385
|
|
386
386
|
Returns:
|
387
|
-
|
387
|
+
str: The new JWT token if setup success, the old token will be blocked.
|
388
388
|
"""
|
389
389
|
resp = self._request_http(
|
390
390
|
method=AppMeshClient.Method.POST,
|
391
391
|
path="/appmesh/totp/setup",
|
392
392
|
header={"Totp": totp_code},
|
393
393
|
)
|
394
|
-
if resp.status_code
|
394
|
+
if resp.status_code == HTTPStatus.OK:
|
395
|
+
if "Access-Token" in resp.json():
|
396
|
+
self.jwt_token = resp.json()["Access-Token"]
|
397
|
+
return self.jwt_token
|
398
|
+
else:
|
395
399
|
raise Exception(resp.text)
|
396
|
-
return resp.status_code == HTTPStatus.OK
|
397
400
|
|
398
401
|
def disable_totp(self, user: str = "self") -> bool:
|
399
402
|
"""Disable 2FA for the specified user.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: appmesh
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.5
|
4
4
|
Summary: Client SDK for App Mesh
|
5
5
|
Home-page: https://github.com/laoshanxi/app-mesh
|
6
6
|
Author: laoshanxi
|
@@ -122,6 +122,7 @@ Refer to the [Installation doc](https://app-mesh.readthedocs.io/en/latest/Instal
|
|
122
122
|
- [Remote execute](https://app-mesh.readthedocs.io/en/latest/success/remote_run_cli_and_python.html)
|
123
123
|
- [Python parallel run](https://app-mesh.readthedocs.io/en/latest/success/python_parallel_run.html)
|
124
124
|
- [Secure consul cluster](https://app-mesh.readthedocs.io/en/latest/success/secure_consul_cluster.html)
|
125
|
+
- [JWT service with REST and UI](https://github.com/laoshanxi/app-mesh/blob/main/script/docker-compose-auth-service.yaml)
|
125
126
|
|
126
127
|
---
|
127
128
|
|
@@ -3,11 +3,11 @@ appmesh/app.py,sha256=9Q-SOOej-MH13BU5Dv2iTa-p-sECCJQp6ZX9DjWWmwE,10526
|
|
3
3
|
appmesh/app_output.py,sha256=JK_TMKgjvaw4n_ys_vmN5S4MyWVZpmD7NlKz_UyMIM8,1015
|
4
4
|
appmesh/app_run.py,sha256=9ISKGZ3k3kkbQvSsPfRfkOLqD9xhbqNOM7ork9F4w9c,1712
|
5
5
|
appmesh/appmesh_client.py,sha256=0ltkqHZUq094gKneYmC0bEZCP0X9kHTp9fccKdWFWP0,339
|
6
|
-
appmesh/http_client.py,sha256=
|
6
|
+
appmesh/http_client.py,sha256=dsQfcjC3U429yDJHhP5SFsoySTDbyRM3rToxi7ooGJA,44363
|
7
7
|
appmesh/tcp_client.py,sha256=RkHl5s8jE333BJOgxJqJ_fvjbdRQza7ciV49vLT6YO4,10923
|
8
8
|
appmesh/tcp_messages.py,sha256=w1Kehz_aX4X2CYAUsy9mFVJRhxnLQwwc6L58W4YkQqs,969
|
9
9
|
appmesh/tcp_transport.py,sha256=UMGby2oKV4k7lyXZUMSOe2Je34fb1w7nTkxEpatKLKg,7256
|
10
|
-
appmesh-1.4.
|
11
|
-
appmesh-1.4.
|
12
|
-
appmesh-1.4.
|
13
|
-
appmesh-1.4.
|
10
|
+
appmesh-1.4.5.dist-info/METADATA,sha256=ozlyIACS7JpSX1Va_RS6tE1WY3h1AR0xqAen1R1Bu08,11501
|
11
|
+
appmesh-1.4.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
12
|
+
appmesh-1.4.5.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
|
13
|
+
appmesh-1.4.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|