mms-client 1.5.0__py3-none-any.whl → 1.5.1__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.
- mms_client/utils/auditing.py +9 -6
- mms_client/utils/web.py +7 -1
- {mms_client-1.5.0.dist-info → mms_client-1.5.1.dist-info}/METADATA +1 -1
- {mms_client-1.5.0.dist-info → mms_client-1.5.1.dist-info}/RECORD +6 -6
- {mms_client-1.5.0.dist-info → mms_client-1.5.1.dist-info}/LICENSE +0 -0
- {mms_client-1.5.0.dist-info → mms_client-1.5.1.dist-info}/WHEEL +0 -0
mms_client/utils/auditing.py
CHANGED
|
@@ -7,6 +7,7 @@ from logging import getLogger
|
|
|
7
7
|
from lxml.etree import _Element as Element
|
|
8
8
|
from lxml.etree import tostring
|
|
9
9
|
from zeep import Plugin
|
|
10
|
+
from zeep.wsdl.definitions import Operation
|
|
10
11
|
|
|
11
12
|
# Set the default logger for the MMS client
|
|
12
13
|
logger = getLogger(__name__)
|
|
@@ -15,7 +16,7 @@ logger = getLogger(__name__)
|
|
|
15
16
|
class AuditPlugin(ABC, Plugin):
|
|
16
17
|
"""Base class for audit plugins."""
|
|
17
18
|
|
|
18
|
-
def egress(self, envelope: Element, http_headers: dict, operation, binding_options):
|
|
19
|
+
def egress(self, envelope: Element, http_headers: dict, operation: Operation, binding_options):
|
|
19
20
|
"""Handle the MMS request before it is sent.
|
|
20
21
|
|
|
21
22
|
Arguments are the same as in the egress method of the Plugin class.
|
|
@@ -25,10 +26,10 @@ class AuditPlugin(ABC, Plugin):
|
|
|
25
26
|
dict: The HTTP headers to send.
|
|
26
27
|
"""
|
|
27
28
|
data = tostring(envelope, encoding="UTF-8", xml_declaration=True)
|
|
28
|
-
self.audit_request(data)
|
|
29
|
+
self.audit_request(operation.name, data)
|
|
29
30
|
return envelope, http_headers
|
|
30
31
|
|
|
31
|
-
def ingress(self, envelope: Element, http_headers: dict, operation):
|
|
32
|
+
def ingress(self, envelope: Element, http_headers: dict, operation: Operation):
|
|
32
33
|
"""Handle the MMS response before it is processed.
|
|
33
34
|
|
|
34
35
|
Arguments are the same as in the ingress method of the Plugin class.
|
|
@@ -38,21 +39,23 @@ class AuditPlugin(ABC, Plugin):
|
|
|
38
39
|
dict: The HTTP headers to process.
|
|
39
40
|
"""
|
|
40
41
|
data = tostring(envelope, encoding="UTF-8", xml_declaration=True)
|
|
41
|
-
self.audit_response(data)
|
|
42
|
+
self.audit_response(operation.name, data)
|
|
42
43
|
return envelope, http_headers
|
|
43
44
|
|
|
44
45
|
@abstractmethod
|
|
45
|
-
def audit_request(self, mms_request: bytes) -> None:
|
|
46
|
+
def audit_request(self, operation: str, mms_request: bytes) -> None:
|
|
46
47
|
"""Audit an MMS request.
|
|
47
48
|
|
|
48
49
|
Arguments:
|
|
50
|
+
operation (str): The SOAP operation being called.
|
|
49
51
|
mms_request (bytes): The MMS request XML to audit.
|
|
50
52
|
"""
|
|
51
53
|
|
|
52
54
|
@abstractmethod
|
|
53
|
-
def audit_response(self, mms_response: bytes) -> None:
|
|
55
|
+
def audit_response(self, operation: str, mms_response: bytes) -> None:
|
|
54
56
|
"""Audit an MMS response.
|
|
55
57
|
|
|
56
58
|
Arguments:
|
|
59
|
+
operation (str): The SOAP operation being called.
|
|
57
60
|
mms_response (bytes): The MMS response XML to audit.
|
|
58
61
|
"""
|
mms_client/utils/web.py
CHANGED
|
@@ -200,7 +200,13 @@ class ZWrapper:
|
|
|
200
200
|
|
|
201
201
|
@on_exception(expo, TransportError, max_tries=3, giveup=fatal_code, logger=logger) # type: ignore[arg-type]
|
|
202
202
|
def submit(self, req: MmsRequest) -> MmsResponse:
|
|
203
|
-
"""Submit the given request to the MMS server and return the response.
|
|
203
|
+
"""Submit the given request to the MMS server and return the response.
|
|
204
|
+
|
|
205
|
+
Arguments:
|
|
206
|
+
req (MmsRequest): The MMS request to submit.
|
|
207
|
+
|
|
208
|
+
Returns: The MMS response.
|
|
209
|
+
"""
|
|
204
210
|
try:
|
|
205
211
|
logger.debug(f"Submitting MMS request request to {self._interface.name} service")
|
|
206
212
|
|
|
@@ -28,11 +28,11 @@ mms_client/types/registration.py,sha256=Nir73S3ffpk0O_fnTD2alFaqV1k67_8dcyyduXvP
|
|
|
28
28
|
mms_client/types/resource.py,sha256=TQnY3JLHRgQhQrG6ISquw-BQgKSr8TGuqn9ItWxWz_w,65974
|
|
29
29
|
mms_client/types/transport.py,sha256=DPjWs34UW915GkUCJWKuDZmsjS6mRdRXgcGISduN_Bc,4399
|
|
30
30
|
mms_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
mms_client/utils/auditing.py,sha256=
|
|
31
|
+
mms_client/utils/auditing.py,sha256=JDcvNo4ul66xPtDeeocn568yIe8fhh-jM11MWP-Kfes,2057
|
|
32
32
|
mms_client/utils/errors.py,sha256=ovoJjrvoVkbMRhHcq3HR9p1uH_65QicvaGy_7wNv7JI,2579
|
|
33
33
|
mms_client/utils/serialization.py,sha256=k0_fBm-yoRZV2AMiickSyauoDyA8i7uIPU6JjfQWx4Q,29638
|
|
34
|
-
mms_client/utils/web.py,sha256
|
|
35
|
-
mms_client-1.5.
|
|
36
|
-
mms_client-1.5.
|
|
37
|
-
mms_client-1.5.
|
|
38
|
-
mms_client-1.5.
|
|
34
|
+
mms_client/utils/web.py,sha256=-abdVxSi7c6xQYsZObbj0yXwGI5VWthr5KtWDyLBCM4,10156
|
|
35
|
+
mms_client-1.5.1.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
|
36
|
+
mms_client-1.5.1.dist-info/METADATA,sha256=KbSz2DFw9HLmP1lneI96S21Rh1d4GPpNuPitW-FGe-k,15987
|
|
37
|
+
mms_client-1.5.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
38
|
+
mms_client-1.5.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|