appmesh 1.6.5__py3-none-any.whl → 1.6.7__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/client_http.py +2 -1
- appmesh/client_tcp.py +2 -1
- appmesh/server_http.py +7 -7
- {appmesh-1.6.5.dist-info → appmesh-1.6.7.dist-info}/METADATA +1 -1
- {appmesh-1.6.5.dist-info → appmesh-1.6.7.dist-info}/RECORD +7 -7
- {appmesh-1.6.5.dist-info → appmesh-1.6.7.dist-info}/WHEEL +0 -0
- {appmesh-1.6.5.dist-info → appmesh-1.6.7.dist-info}/top_level.txt +0 -0
appmesh/client_http.py
CHANGED
@@ -1398,7 +1398,8 @@ class AppMeshClient(metaclass=abc.ABCMeta):
|
|
1398
1398
|
|
1399
1399
|
# Prepare headers
|
1400
1400
|
header = {} if header is None else header
|
1401
|
-
|
1401
|
+
token = self._get_access_token()
|
1402
|
+
if token:
|
1402
1403
|
header[self.HTTP_HEADER_KEY_AUTH] = f"Bearer {token}"
|
1403
1404
|
if self.forward_to and len(self.forward_to) > 0:
|
1404
1405
|
if ":" in self.forward_to:
|
appmesh/client_tcp.py
CHANGED
@@ -116,7 +116,8 @@ class AppMeshClientTCP(AppMeshClient):
|
|
116
116
|
self.tcp_transport.connect()
|
117
117
|
|
118
118
|
appmesh_request = RequestMessage()
|
119
|
-
|
119
|
+
token = self._get_access_token()
|
120
|
+
if token:
|
120
121
|
appmesh_request.headers[self.HTTP_HEADER_KEY_AUTH] = token
|
121
122
|
if super().forward_to and len(super().forward_to) > 0:
|
122
123
|
raise Exception("Not support forward request in TCP mode")
|
appmesh/server_http.py
CHANGED
@@ -58,13 +58,13 @@ class AppMeshServer(metaclass=abc.ABCMeta):
|
|
58
58
|
@staticmethod
|
59
59
|
def _get_runtime_env() -> Tuple[str, str]:
|
60
60
|
"""Read and validate required runtime environment variables."""
|
61
|
-
|
61
|
+
process_key = os.getenv("APP_MESH_PROCESS_KEY")
|
62
62
|
app_name = os.getenv("APP_MESH_APPLICATION_NAME")
|
63
|
-
if not
|
63
|
+
if not process_key:
|
64
64
|
raise Exception("Missing environment variable: APP_MESH_PROCESS_KEY. This must be set by App Mesh service.")
|
65
65
|
if not app_name:
|
66
66
|
raise Exception("Missing environment variable: APP_MESH_APPLICATION_NAME. This must be set by App Mesh service.")
|
67
|
-
return
|
67
|
+
return process_key, app_name
|
68
68
|
|
69
69
|
def task_fetch(self) -> Union[str, bytes]:
|
70
70
|
"""Fetch task data in the currently running App Mesh application process.
|
@@ -76,14 +76,14 @@ class AppMeshServer(metaclass=abc.ABCMeta):
|
|
76
76
|
Returns:
|
77
77
|
Union[str, bytes]: The payload provided by the client as returned by the service.
|
78
78
|
"""
|
79
|
-
|
79
|
+
pkey, app_name = self._get_runtime_env()
|
80
80
|
path = f"/appmesh/app/{app_name}/task"
|
81
81
|
|
82
82
|
while True:
|
83
83
|
resp = self._client._request_http(
|
84
84
|
AppMeshClient.Method.GET,
|
85
85
|
path=path,
|
86
|
-
query={"
|
86
|
+
query={"process_key": pkey},
|
87
87
|
)
|
88
88
|
|
89
89
|
if resp.status_code != HTTPStatus.OK:
|
@@ -102,13 +102,13 @@ class AppMeshServer(metaclass=abc.ABCMeta):
|
|
102
102
|
Args:
|
103
103
|
result (Union[str, bytes]): Result payload to be delivered back to the client.
|
104
104
|
"""
|
105
|
-
|
105
|
+
pkey, app_name = self._get_runtime_env()
|
106
106
|
path = f"/appmesh/app/{app_name}/task"
|
107
107
|
|
108
108
|
resp = self._client._request_http(
|
109
109
|
AppMeshClient.Method.PUT,
|
110
110
|
path=path,
|
111
|
-
query={"
|
111
|
+
query={"process_key": pkey},
|
112
112
|
body=result,
|
113
113
|
)
|
114
114
|
|
@@ -3,14 +3,14 @@ appmesh/app.py,sha256=crD4DRFZJuHtZMfSsz7C-EwvjPmGZbFXYXvA_wCdvdI,10734
|
|
3
3
|
appmesh/app_output.py,sha256=vfn322AyixblI8DbXds08h6L_ybObiaRSifsA1-Xcoo,1035
|
4
4
|
appmesh/app_run.py,sha256=aYq852a29OThIi32Xtx5s0sTXZ97T0lHD5WXH8yfPoc,2018
|
5
5
|
appmesh/appmesh_client.py,sha256=ywB2222PtJUffdfdxZcBfdhZs1KYyc7JvzMxwuK2qyI,378
|
6
|
-
appmesh/client_http.py,sha256=
|
6
|
+
appmesh/client_http.py,sha256=dzNZvMztm0POLHNS8iNHo1iuJprjvQP0kii1UWOH-XA,57529
|
7
7
|
appmesh/client_http_oauth.py,sha256=1d51o0JX_xtB8d2bEuM7_XJHcwMnhcjkbIq7GE1Zxm8,6120
|
8
|
-
appmesh/client_tcp.py,sha256=
|
9
|
-
appmesh/server_http.py,sha256=
|
8
|
+
appmesh/client_tcp.py,sha256=aq6UUzytZA4ibE9WQMMWdo1uW8sHETEhJjsbM6IYSno,11457
|
9
|
+
appmesh/server_http.py,sha256=rBIYO9rbR-r3x1Jcry440Sp--IM-OWKRaOhNpGdkxh8,4299
|
10
10
|
appmesh/server_tcp.py,sha256=-CU5tw97WJmDcUNsNPWqpdZ0wxRzRD6kUP3XyNZUTHc,1444
|
11
11
|
appmesh/tcp_messages.py,sha256=H9S_iCy0IuufY2v50_SUgRvcyQmJsySG65tBe_xb3Ko,1878
|
12
12
|
appmesh/tcp_transport.py,sha256=0hRSp5fpL9wKB05JIyIRIuyBC8w1IdokryhMDHqtN4M,8946
|
13
|
-
appmesh-1.6.
|
14
|
-
appmesh-1.6.
|
15
|
-
appmesh-1.6.
|
16
|
-
appmesh-1.6.
|
13
|
+
appmesh-1.6.7.dist-info/METADATA,sha256=9c0FJtxDPsRIu2CL3K4A7IkAAKLalRm0cpdbBk_j-6A,11828
|
14
|
+
appmesh-1.6.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
+
appmesh-1.6.7.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
|
16
|
+
appmesh-1.6.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|