shapeshifter-uftp 2.2.0__tar.gz → 2.2.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 (71) hide show
  1. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/PKG-INFO +3 -3
  2. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/pyproject.toml +3 -3
  3. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/agr_cro_client.py +8 -3
  4. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/agr_dso_client.py +3 -2
  5. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/base_client.py +6 -7
  6. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/cro_agr_client.py +3 -3
  7. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/cro_dso_client.py +3 -3
  8. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/dso_agr_client.py +3 -2
  9. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/dso_cro_client.py +3 -3
  10. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/service/base_service.py +1 -4
  11. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/transport.py +4 -4
  12. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp.egg-info/PKG-INFO +3 -3
  13. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp.egg-info/requires.txt +2 -2
  14. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/README.rst +0 -0
  15. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/setup.cfg +0 -0
  16. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/__init__.py +0 -0
  17. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/cli.py +0 -0
  18. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/client/__init__.py +0 -0
  19. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/exceptions.py +0 -0
  20. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/logging.py +0 -0
  21. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/oauth.py +0 -0
  22. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/service/__init__.py +0 -0
  23. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/service/agr_service.py +0 -0
  24. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/service/cro_service.py +0 -0
  25. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/service/dso_service.py +0 -0
  26. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/__init__.py +0 -0
  27. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/agr_cro.py +0 -0
  28. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/agr_dso.py +0 -0
  29. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/common.py +0 -0
  30. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/cro_dso.py +0 -0
  31. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/defaults.py +0 -0
  32. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/enums.py +0 -0
  33. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/__init__.py +0 -0
  34. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/agr_portfolio_query.py +0 -0
  35. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/agr_portfolio_update.py +0 -0
  36. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/d_prognosis.py +0 -0
  37. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/dso_portfolio_query.py +0 -0
  38. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/dso_portfolio_update.py +0 -0
  39. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_message.py +0 -0
  40. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_offer.py +0 -0
  41. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_offer_revocation.py +0 -0
  42. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_order.py +0 -0
  43. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_request.py +0 -0
  44. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_reservation_update.py +0 -0
  45. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/flex_settlement.py +0 -0
  46. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/metering.py +0 -0
  47. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/payload_message.py +0 -0
  48. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/signed_message.py +0 -0
  49. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/messages/test_message.py +0 -0
  50. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp/uftp/validations.py +0 -0
  51. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp.egg-info/SOURCES.txt +0 -0
  52. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp.egg-info/dependency_links.txt +0 -0
  53. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp.egg-info/entry_points.txt +0 -0
  54. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/shapeshifter_uftp.egg-info/top_level.txt +0 -0
  55. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_cli.py +0 -0
  56. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_client_errors.py +0 -0
  57. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_client_with_workers.py +0 -0
  58. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_clients_from_service.py +0 -0
  59. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_communications.py +0 -0
  60. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_default_responses.py +0 -0
  61. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_message_destination.py +0 -0
  62. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_oauth.py +0 -0
  63. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_presence_of_client_methods.py +0 -0
  64. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_presence_of_service_methods.py +0 -0
  65. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_roundtrip_serialization.py +0 -0
  66. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_seal_and_unseal.py +0 -0
  67. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_service_errors.py +0 -0
  68. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_snake_case.py +0 -0
  69. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_ttl_cache.py +0 -0
  70. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_validations.py +0 -0
  71. {shapeshifter_uftp-2.2.0 → shapeshifter_uftp-2.2.1}/test/test_xml_schema_compliance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shapeshifter_uftp
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Implementation of the Shapeshifter (UFTP) protocol
5
5
  Project-URL: Repository, https://github.com/shapeshifter/shapeshifter-library-python
6
6
  Project-URL: Documentation, https://github.com/shapeshifter/shapeshifter-library-python/README.md
@@ -9,8 +9,8 @@ Project-URL: Changelog, https://github.com/shapeshifter/shapeshifter-library-pyt
9
9
  Requires-Python: <3.15,>=3.11
10
10
  Description-Content-Type: text/x-rst
11
11
  Requires-Dist: xsdata[lxml]<27.0,>=25.0
12
- Requires-Dist: pynacl==1.5.0
13
- Requires-Dist: dnspython==2.7.0
12
+ Requires-Dist: pynacl==1.6.2
13
+ Requires-Dist: dnspython==2.8.0
14
14
  Requires-Dist: fastapi<0.128,>=0.110
15
15
  Requires-Dist: fastapi-xml<2.0.0,>=1.1.1
16
16
  Requires-Dist: requests
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "shapeshifter_uftp"
3
- version = "2.2.0"
3
+ version = "2.2.1"
4
4
  description = "Implementation of the Shapeshifter (UFTP) protocol"
5
5
  dependencies = [
6
6
  "xsdata[lxml]>=25.0,<27.0",
7
- "pynacl==1.5.0",
8
- "dnspython==2.7.0",
7
+ "pynacl==1.6.2",
8
+ "dnspython==2.8.0",
9
9
  "fastapi>=0.110,<0.128",
10
10
  "fastapi-xml>=1.1.1,<2.0.0",
11
11
  "requests",
@@ -1,4 +1,9 @@
1
- from ..uftp import AgrPortfolioQuery, AgrPortfolioUpdate, PayloadMessageResponse
1
+ from ..uftp import (
2
+ AgrPortfolioQuery,
3
+ AgrPortfolioUpdate,
4
+ PayloadMessageResponse,
5
+ UsefRole,
6
+ )
2
7
  from .base_client import ShapeshifterClient
3
8
 
4
9
 
@@ -7,8 +12,8 @@ class ShapeshifterAgrCroClient(ShapeshifterClient):
7
12
  Client that allows the Aggregator to connect to the CRO.
8
13
  """
9
14
 
10
- sender_role = "AGR"
11
- recipient_role = "CRO"
15
+ sender_role = UsefRole.AGR
16
+ recipient_role = UsefRole.CRO
12
17
 
13
18
  def send_agr_portfolio_update(self, message: AgrPortfolioUpdate) -> PayloadMessageResponse:
14
19
  """
@@ -8,6 +8,7 @@ from ..uftp import (
8
8
  FlexSettlementResponse,
9
9
  Metering,
10
10
  PayloadMessageResponse,
11
+ UsefRole,
11
12
  )
12
13
  from .base_client import ShapeshifterClient
13
14
 
@@ -17,8 +18,8 @@ class ShapeshifterAgrDsoClient(ShapeshifterClient):
17
18
  Client that allows the Aggregator to connect to the DSO.
18
19
  """
19
20
 
20
- sender_role = "AGR"
21
- recipient_role = "DSO"
21
+ sender_role = UsefRole.AGR
22
+ recipient_role = UsefRole.DSO
22
23
 
23
24
  def send_d_prognosis(self, message: DPrognosis) -> PayloadMessageResponse:
24
25
  """
@@ -11,7 +11,7 @@ from .. import transport
11
11
  from ..exceptions import ClientTransportException
12
12
  from ..logging import logger
13
13
  from ..oauth import OAuthClient, PassthroughOAuthClient
14
- from ..uftp import PayloadMessage, PayloadMessageResponse, SignedMessage
14
+ from ..uftp import PayloadMessage, PayloadMessageResponse, SignedMessage, UsefRole
15
15
 
16
16
 
17
17
  class ShapeshifterClient:
@@ -19,8 +19,8 @@ class ShapeshifterClient:
19
19
  Basis for all Shapeshifter client.
20
20
  """
21
21
 
22
- sender_role: str
23
- recipient_role: str
22
+ sender_role: UsefRole
23
+ recipient_role: UsefRole
24
24
  num_outgoing_workers = 10
25
25
  num_delivery_attempts = 10
26
26
  request_timeout = 30
@@ -32,9 +32,9 @@ class ShapeshifterClient:
32
32
  sender_domain: str,
33
33
  signing_key: str,
34
34
  recipient_domain: str,
35
- recipient_endpoint: str = None,
36
- recipient_signing_key: str = None,
37
- oauth_client: OAuthClient = None,
35
+ recipient_endpoint: str | None = None,
36
+ recipient_signing_key: str | None = None,
37
+ oauth_client: OAuthClient | None = None,
38
38
  version: str = "3.1.0"
39
39
  ):
40
40
  """
@@ -101,7 +101,6 @@ class ShapeshifterClient:
101
101
  # properties can be calculated in the framework anyway.
102
102
  message.version = self.version
103
103
  message.sender_domain = self.sender_domain
104
- message.sender_role = self.sender_role
105
104
  message.recipient_domain = self.recipient_domain
106
105
  message.time_stamp = (
107
106
  message.time_stamp or datetime.now(timezone.utc).isoformat()
@@ -1,4 +1,4 @@
1
- from ..uftp import AgrPortfolioQueryResponse, AgrPortfolioUpdateResponse
1
+ from ..uftp import AgrPortfolioQueryResponse, AgrPortfolioUpdateResponse, UsefRole
2
2
  from .base_client import ShapeshifterClient
3
3
 
4
4
 
@@ -7,8 +7,8 @@ class ShapeshifterCroAgrClient(ShapeshifterClient):
7
7
  Client that allows the CRO to connect to the Aggregator.
8
8
  """
9
9
 
10
- sender_role = "CRO"
11
- recipient_role = "AGR"
10
+ sender_role = UsefRole.CRO
11
+ recipient_role = UsefRole.AGR
12
12
 
13
13
  def send_agr_portfolio_update_response(self, message: AgrPortfolioUpdateResponse):
14
14
  """
@@ -1,4 +1,4 @@
1
- from ..uftp import DsoPortfolioQueryResponse, DsoPortfolioUpdateResponse
1
+ from ..uftp import DsoPortfolioQueryResponse, DsoPortfolioUpdateResponse, UsefRole
2
2
  from .base_client import ShapeshifterClient
3
3
 
4
4
 
@@ -15,8 +15,8 @@ class ShapeshifterCroDsoClient(ShapeshifterClient):
15
15
  DsoPortfolioQuery, respectively.
16
16
  """
17
17
 
18
- sender_role = "CRO"
19
- recipient_role = "DSO"
18
+ sender_role = UsefRole.CRO
19
+ recipient_role = UsefRole.DSO
20
20
 
21
21
  def send_dso_portfolio_update_response(self, message: DsoPortfolioUpdateResponse):
22
22
  """
@@ -8,6 +8,7 @@ from ..uftp import (
8
8
  FlexSettlement,
9
9
  MeteringResponse,
10
10
  PayloadMessageResponse,
11
+ UsefRole,
11
12
  )
12
13
  from .base_client import ShapeshifterClient
13
14
 
@@ -17,8 +18,8 @@ class ShapeshifterDsoAgrClient(ShapeshifterClient):
17
18
  Client that allows the DSO to connect to the Aggregator.
18
19
  """
19
20
 
20
- sender_role = "DSO"
21
- recipient_role = "AGR"
21
+ sender_role = UsefRole.DSO
22
+ recipient_role = UsefRole.AGR
22
23
 
23
24
  def send_d_prognosis_response(self, message: DPrognosisResponse) -> PayloadMessageResponse:
24
25
  """
@@ -1,4 +1,4 @@
1
- from ..uftp import DsoPortfolioQuery, DsoPortfolioUpdate
1
+ from ..uftp import DsoPortfolioQuery, DsoPortfolioUpdate, UsefRole
2
2
  from .base_client import ShapeshifterClient
3
3
 
4
4
 
@@ -7,8 +7,8 @@ class ShapeshifterDsoCroClient(ShapeshifterClient):
7
7
  Client that allows the DSO to connect to the CRO.
8
8
  """
9
9
 
10
- sender_role = "DSO"
11
- recipient_role = "CRO"
10
+ sender_role = UsefRole.DSO
11
+ recipient_role = UsefRole.CRO
12
12
 
13
13
  def send_dso_portfolio_update(self, message: DsoPortfolioUpdate):
14
14
  """
@@ -1,9 +1,7 @@
1
1
  import re
2
2
  from concurrent.futures import ThreadPoolExecutor
3
- from datetime import datetime, timezone
4
3
  from threading import Thread
5
4
  from time import sleep
6
- from uuid import uuid4
7
5
 
8
6
  import uvicorn
9
7
  from fastapi import FastAPI, Response
@@ -22,7 +20,6 @@ from ..logging import logger
22
20
  from ..uftp import (
23
21
  AcceptedRejected,
24
22
  PayloadMessage,
25
- PayloadMessageResponse,
26
23
  SignedMessage,
27
24
  request_response_map,
28
25
  )
@@ -154,7 +151,7 @@ class ShapeshifterService():
154
151
  # Shapeshifter UFTP implementation. #
155
152
  # ------------------------------------------------------------ #
156
153
 
157
- def _receive_message(self, message: SignedMessage) -> None:
154
+ def _receive_message(self, message: SignedMessage) -> Response:
158
155
  """
159
156
  The default entrypoint for the route. This will unpack the
160
157
  message and validate the signature. It will thes pass the
@@ -22,7 +22,7 @@ from .exceptions import (
22
22
  ServiceDiscoveryException,
23
23
  )
24
24
  from .logging import logger
25
- from .uftp import PayloadMessage
25
+ from .uftp import PayloadMessage, SignedMessage
26
26
 
27
27
  _context = XmlContext()
28
28
  serializer = XmlSerializer(context=_context, config=SerializerConfig(indent=" "))
@@ -76,7 +76,7 @@ def unseal_message(message: bytes, public_key: str) -> PayloadMessage:
76
76
  raise SchemaException(str(exc)) from exc
77
77
 
78
78
 
79
- def to_xml(message: PayloadMessage) -> str:
79
+ def to_xml(message: PayloadMessage | SignedMessage) -> str:
80
80
  """
81
81
  Serialize the given PayloadMessage into an XML string.
82
82
  """
@@ -174,7 +174,7 @@ def get_keys(domain, role):
174
174
  )
175
175
 
176
176
  # Verify that the string is of the expected length (4 + 44 bytes or 4 + 88 bytes)
177
- if not len(result) in (48, 92):
177
+ if len(result) not in (48, 92):
178
178
  raise AuthenticationTimeoutException(
179
179
  f"Could not retrieve public key(s) at {dns_name}: "
180
180
  f"string '{result}' was not of appropriate length (48 or 90 characters)"
@@ -190,7 +190,7 @@ def get_keys(domain, role):
190
190
  ) from exc
191
191
 
192
192
  # Now verify that the decoded length is 64
193
- if not len(combined_keys) in (32, 64):
193
+ if len(combined_keys) not in (32, 64):
194
194
  raise AuthenticationTimeoutException(
195
195
  f"Could not retrieve public keys at {dns_name}: "
196
196
  f"decoded base64 data should be 32 or 64 bytes long, "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shapeshifter_uftp
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Implementation of the Shapeshifter (UFTP) protocol
5
5
  Project-URL: Repository, https://github.com/shapeshifter/shapeshifter-library-python
6
6
  Project-URL: Documentation, https://github.com/shapeshifter/shapeshifter-library-python/README.md
@@ -9,8 +9,8 @@ Project-URL: Changelog, https://github.com/shapeshifter/shapeshifter-library-pyt
9
9
  Requires-Python: <3.15,>=3.11
10
10
  Description-Content-Type: text/x-rst
11
11
  Requires-Dist: xsdata[lxml]<27.0,>=25.0
12
- Requires-Dist: pynacl==1.5.0
13
- Requires-Dist: dnspython==2.7.0
12
+ Requires-Dist: pynacl==1.6.2
13
+ Requires-Dist: dnspython==2.8.0
14
14
  Requires-Dist: fastapi<0.128,>=0.110
15
15
  Requires-Dist: fastapi-xml<2.0.0,>=1.1.1
16
16
  Requires-Dist: requests
@@ -1,6 +1,6 @@
1
1
  xsdata[lxml]<27.0,>=25.0
2
- pynacl==1.5.0
3
- dnspython==2.7.0
2
+ pynacl==1.6.2
3
+ dnspython==2.8.0
4
4
  fastapi<0.128,>=0.110
5
5
  fastapi-xml<2.0.0,>=1.1.1
6
6
  requests