appmesh 1.4.3__py3-none-any.whl → 1.4.4__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, otherwise return None.
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(
@@ -384,16 +384,19 @@ class AppMeshClient(metaclass=abc.ABCMeta):
384
384
  totp_code (str): TOTP code
385
385
 
386
386
  Returns:
387
- bool: success or failure.
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 != HTTPStatus.OK:
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
3
+ Version: 1.4.4
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=XW3BOa1g6FVWDhiX9A8HrdkVRzEv5WBK-Z5i6HoRwow,44200
6
+ appmesh/http_client.py,sha256=wd-H4vyHlLSCy1N8znHMf3-Zwgs7ow6-voWUludtMdA,44364
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.3.dist-info/METADATA,sha256=VN33Xn9UWnONmOt7ypWvJ0195RZnDmphydF37VQAQeQ,11379
11
- appmesh-1.4.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
12
- appmesh-1.4.3.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
13
- appmesh-1.4.3.dist-info/RECORD,,
10
+ appmesh-1.4.4.dist-info/METADATA,sha256=lV4XJMIWhe2jKNV5NOv_q6SFdVrzN1BZLoVrvEd90Is,11501
11
+ appmesh-1.4.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
12
+ appmesh-1.4.4.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
13
+ appmesh-1.4.4.dist-info/RECORD,,