mms-client 1.5.0__tar.gz → 1.5.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.
Files changed (38) hide show
  1. {mms_client-1.5.0 → mms_client-1.5.1}/PKG-INFO +1 -1
  2. {mms_client-1.5.0 → mms_client-1.5.1}/pyproject.toml +1 -1
  3. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/utils/auditing.py +9 -6
  4. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/utils/web.py +7 -1
  5. {mms_client-1.5.0 → mms_client-1.5.1}/LICENSE +0 -0
  6. {mms_client-1.5.0 → mms_client-1.5.1}/README.md +0 -0
  7. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/__init__.py +0 -0
  8. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/client.py +0 -0
  9. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/py.typed +0 -0
  10. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/wsdl/mi-web-service-jbms.wsdl +0 -0
  11. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/wsdl/omi-web-service.wsdl +0 -0
  12. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/xsd/mi-market.xsd +0 -0
  13. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/xsd/mi-outbnd-reports.xsd +0 -0
  14. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/xsd/mi-report.xsd +0 -0
  15. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/xsd/mpr.xsd +0 -0
  16. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/schemas/xsd/omi.xsd +0 -0
  17. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/security/__init__.py +0 -0
  18. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/security/certs.py +0 -0
  19. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/security/crypto.py +0 -0
  20. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/services/__init__.py +0 -0
  21. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/services/base.py +0 -0
  22. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/services/market.py +0 -0
  23. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/services/omi.py +0 -0
  24. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/services/registration.py +0 -0
  25. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/services/report.py +0 -0
  26. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/__init__.py +0 -0
  27. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/award.py +0 -0
  28. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/base.py +0 -0
  29. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/enums.py +0 -0
  30. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/fields.py +0 -0
  31. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/market.py +0 -0
  32. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/offer.py +0 -0
  33. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/registration.py +0 -0
  34. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/resource.py +0 -0
  35. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/types/transport.py +0 -0
  36. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/utils/__init__.py +0 -0
  37. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/utils/errors.py +0 -0
  38. {mms_client-1.5.0 → mms_client-1.5.1}/src/mms_client/utils/serialization.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mms-client
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: API client for accessing the MMS
5
5
  Home-page: https://github.com/ElectroRoute-Japan/mms-client
6
6
  Author: Ryan Wood
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "mms_client"
3
- version = "v1.5.0"
3
+ version = "v1.5.1"
4
4
  description = "API client for accessing the MMS"
5
5
  authors = ["Ryan Wood <ryan.wood@electroroute.co.jp>"]
6
6
  readme = "README.md"
@@ -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
  """
@@ -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
 
File without changes
File without changes