wizata-dsapi 2.2.0.dev13__py3-none-any.whl → 2.2.0.dev14__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.
wizata_dsapi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.2.0.dev13"
1
+ __version__ = "2.2.0.dev14"
@@ -56,6 +56,7 @@ import ast
56
56
  from .deployment import Deployment, DeploymentStatus
57
57
  from .product import ProductKind, Product, ProductComponent
58
58
  from .inventory import InventoryBalance, InventoryStorage, InventoryStock
59
+ from .connection import EdgeDeviceKey
59
60
  from .api_config import _registry
60
61
 
61
62
  from .streamlit_utils import get_streamlit_token, get_streamlit_domain
@@ -2989,6 +2990,43 @@ class WizataDSAPIClient(ApiInterface, ApiDtoInterface):
2989
2990
  self._planner_request("DELETE", f"planner/inventory/balances/{self._balance_id(balance)}/",
2990
2991
  expected=(204,))
2991
2992
 
2993
+ # ------------------------------------------------------------ edge device keys
2994
+
2995
+ @staticmethod
2996
+ def _edge_device_keys_route(edge_device_id) -> str:
2997
+ if not edge_device_id:
2998
+ raise ValueError("please provide the edge device id")
2999
+ return f"edgedevices/{urllib.parse.quote(str(edge_device_id), safe='')}/keys"
3000
+
3001
+ def register_edge_device_key(self, edge_device_id: str, public_key: str) -> EdgeDeviceKey:
3002
+ """
3003
+ Register the public half of the key pair an edge generated for itself (DEV-6013).
3004
+ Connection secrets are sealed for the edge's active key, and only that edge can
3005
+ open them: the private half never leaves the device.
3006
+
3007
+ Registering the same key again is a no-op, so an edge can register on every start.
3008
+ A different key retires the current one, and every secret sealed for that one must
3009
+ be entered again.
3010
+
3011
+ :param edge_device_id: the device id the edge runs as, not its UUID.
3012
+ :param public_key: PEM of the edge's X25519 public key.
3013
+ :return: the edge's active key.
3014
+ """
3015
+ response = self._process_request(method="POST",
3016
+ route=self._edge_device_keys_route(edge_device_id),
3017
+ data=json.dumps({"publicKey": public_key}))
3018
+ return EdgeDeviceKey.from_dict(response.json())
3019
+
3020
+ def get_edge_device_keys(self, edge_device_id: str) -> list:
3021
+ """
3022
+ :param edge_device_id: the device id the edge runs as, not its UUID.
3023
+ :return: every EdgeDeviceKey the edge registered, newest first. With no active
3024
+ one, the edge has not registered yet and no secret can be entered for it.
3025
+ """
3026
+ return self._process_request(method="GET",
3027
+ route=self._edge_device_keys_route(edge_device_id),
3028
+ dto_class=EdgeDeviceKey, result_type="list")
3029
+
2992
3030
 
2993
3031
  def api() -> WizataDSAPIClient:
2994
3032
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizata_dsapi
3
- Version: 2.2.0.dev13
3
+ Version: 2.2.0.dev14
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -46,10 +46,10 @@ wizata_dsapi/trigger.py,sha256=waOX2AhrLvFzNFRQ535j6iemgg_QJP2QsWGL2ipljFg,8848
46
46
  wizata_dsapi/twin.py,sha256=8AnrxSaL7dMrILXJ3-GGmmUz078j3qqwzDTe6i86xqA,12672
47
47
  wizata_dsapi/twinregistration.py,sha256=iXt55AVGAQNl0jmxa3ZVynPqlSsIunFf4sLfp-MWTw0,13244
48
48
  wizata_dsapi/user.py,sha256=-hchKAMZULu9P00RUHDqu_5AT4NI5BYOJd8XCBrt3eQ,1950
49
- wizata_dsapi/version.py,sha256=uhmzU8MoDAlfpvkR4vb9zjAKDSkdJwpXf9LeIyybKD4,28
49
+ wizata_dsapi/version.py,sha256=TECcnSqxYn2Ng1q_lCXXC_IJwtPKz0gJ15Tv5qo_ims,28
50
50
  wizata_dsapi/wizard_function.py,sha256=RbM7W7Gf-6Rhp_1dU9DBYkHaciknGAGvuAndhAS_vyo,942
51
51
  wizata_dsapi/wizard_request.py,sha256=v6BaqKLKvTWmUSo0_gda9FabAQz5x_-GOH1Av50GzFo,3762
52
- wizata_dsapi/wizata_dsapi_client.py,sha256=VIZO7uOFYQmD4p7u6NvNBR8E7HLGbk9gM5Ut5jc5new,125215
52
+ wizata_dsapi/wizata_dsapi_client.py,sha256=0boshZti3aSP3C99fTpLpASvMzhrYPZDSWsb4NxW5Ug,127198
53
53
  wizata_dsapi/words.py,sha256=tV8CqzCqODZCV7PgBxBF5exBxeF_ya9t5DiUy-cg6Sg,1535
54
54
  wizata_dsapi/models/__init__.py,sha256=O3Tusyhl8hFb-5QaEBY7DJISRB8Gf_Xbxxr-aFDR1_U,380
55
55
  wizata_dsapi/models/common.py,sha256=5BC3Dc6kMvqPGxHgoCuGVOynu_F1MWh7EJSzXIICSSg,27196
@@ -58,8 +58,8 @@ wizata_dsapi/plots/common.py,sha256=7F4WMBaddubnCpdSafgaI9U9Sz0Sngg0VREP_vnIMno,
58
58
  wizata_dsapi/plots/theme.py,sha256=D4sSgEwabXVxF3z1GV8DivXJbbY61KgxXAWfjUbNDAc,3594
59
59
  wizata_dsapi/scripts/__init__.py,sha256=9fRdTMuuXcqMkIsUPf5dwFsTWwBzKteQdAMVkyy2acQ,212
60
60
  wizata_dsapi/scripts/common.py,sha256=T2cP8aGPg8OgIvBWuQBNonVtph_dHlNFubByuYrLb0o,15675
61
- wizata_dsapi-2.2.0.dev13.dist-info/licenses/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
62
- wizata_dsapi-2.2.0.dev13.dist-info/METADATA,sha256=8yFDks5topJ3JvC8l1oxlgfUFrJRWOJ7t6pQUmDYHAQ,14038
63
- wizata_dsapi-2.2.0.dev13.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
64
- wizata_dsapi-2.2.0.dev13.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
65
- wizata_dsapi-2.2.0.dev13.dist-info/RECORD,,
61
+ wizata_dsapi-2.2.0.dev14.dist-info/licenses/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
62
+ wizata_dsapi-2.2.0.dev14.dist-info/METADATA,sha256=yWSqYvSTMSrtYgv9iEPyooiEoRIHSBIbf_XqoaE7DKI,14038
63
+ wizata_dsapi-2.2.0.dev14.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
64
+ wizata_dsapi-2.2.0.dev14.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
65
+ wizata_dsapi-2.2.0.dev14.dist-info/RECORD,,