zipher-sdk 0.4.2__tar.gz → 0.4.4__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 (25) hide show
  1. {zipher-sdk-0.4.2/zipher_sdk.egg-info → zipher-sdk-0.4.4}/PKG-INFO +1 -1
  2. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/setup.py +1 -1
  3. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/tests/test_acl/test_acl.py +1 -1
  4. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/acl/zipher_installer.py +13 -3
  5. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/cli.py +1 -1
  6. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/client.py +8 -2
  7. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/models.py +1 -0
  8. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4/zipher_sdk.egg-info}/PKG-INFO +1 -1
  9. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/LICENSE +0 -0
  10. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/README.md +0 -0
  11. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/setup.cfg +0 -0
  12. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/tests/__init__.py +0 -0
  13. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/tests/test_acl/__init__.py +0 -0
  14. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/tests/test_acl/sample_job.py +0 -0
  15. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/tests/test_client.py +0 -0
  16. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/__init__.py +0 -0
  17. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/acl/__init__.py +0 -0
  18. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/acl/models.py +0 -0
  19. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/exceptions.py +0 -0
  20. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher/utils.py +0 -0
  21. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher_sdk.egg-info/SOURCES.txt +0 -0
  22. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher_sdk.egg-info/dependency_links.txt +0 -0
  23. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher_sdk.egg-info/entry_points.txt +0 -0
  24. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher_sdk.egg-info/requires.txt +0 -0
  25. {zipher-sdk-0.4.2 → zipher-sdk-0.4.4}/zipher_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zipher-sdk
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: Python SDK for programmatic access to the Zipher API
5
5
  Home-page: UNKNOWN
6
6
  Author: Zipher Inc.
@@ -8,7 +8,7 @@ with open('README.md', encoding='utf-8') as f:
8
8
 
9
9
  setup(
10
10
  name='zipher-sdk',
11
- version='0.4.2',
11
+ version='0.4.4',
12
12
  description='Python SDK for programmatic access to the Zipher API',
13
13
  long_description=long_description,
14
14
  long_description_content_type='text/markdown',
@@ -387,7 +387,7 @@ class TestExistingServicePrincipal(TestCase):
387
387
 
388
388
  user_config = InstallerUserConfig(
389
389
  jobs_list=[],
390
- existing_service_principal_id=self.sp.id
390
+ existing_service_principal_id=self.sp.application_id
391
391
  )
392
392
  zipher_creds = installer.setup(user_config=user_config, skip_approval=True)
393
393
 
@@ -220,9 +220,19 @@ class ZipherInstaller:
220
220
  return service_principal
221
221
 
222
222
  def _use_existing_service_principal(self, sp_id: str, zipher_group: Group) -> ServicePrincipal:
223
- """Use an existing service principal and add it to the zipher group with token permissions."""
224
- sp = self.dbx_client.service_principals.get(id=sp_id)
225
- print(f"\nUsing existing service principal: {sp.display_name} (id={sp.id})")
223
+ """Use an existing service principal and add it to the zipher group with token permissions.
224
+
225
+ Args:
226
+ sp_id: Application ID (UUID) of the service principal
227
+ """
228
+ # Search by application_id (UUID)
229
+ all_sps = list(self.dbx_client.service_principals.list())
230
+ matching_sp = [sp for sp in all_sps if sp.application_id == sp_id]
231
+ if not matching_sp:
232
+ raise ValueError(f"Service principal with application_id '{sp_id}' not found")
233
+ sp = matching_sp[0]
234
+
235
+ print(f"\nUsing existing service principal: {sp.display_name} (id={sp.id}, application_id={sp.application_id})")
226
236
 
227
237
  # Add existing SP to the zipher group (same as in _create_service_principal)
228
238
  existing_groups = [g.value for g in sp.groups] if sp.groups else []
@@ -110,7 +110,7 @@ def main():
110
110
  "--existing-sp-id",
111
111
  type=str,
112
112
  default=None,
113
- help="Use existing service principal by ID instead of creating a new one."
113
+ help="Use existing service principal by Application ID (UUID) instead of creating a new one."
114
114
  )
115
115
 
116
116
  remove_parser = subparsers.add_parser("remove", help="Remove Zipher resources from the workspace.", parents=[parent_parser])
@@ -56,10 +56,16 @@ class Client:
56
56
  def get_optimized_config_as_dbx_cluster_spec(self, job_id: str) -> ClusterSpec:
57
57
  return ClusterSpec.from_dict(self.get_optimized_config(job_id))
58
58
 
59
- def update_existing_conf(self, job_id: str, existing_conf: Dict, task_key: Optional[str] = None) -> Dict:
59
+ def update_existing_conf(self, job_id: str, existing_conf: Dict, task_key: Optional[str] = None, run_params: Optional[Dict] = None) -> Dict:
60
60
  if 'new_cluster' in existing_conf:
61
61
  existing_conf = existing_conf['new_cluster']
62
- params = ConfFetcherRequest(customer_id=self.customer_id, job_id=job_id, merge_with=json.dumps(existing_conf), task_key=task_key)
62
+ params = ConfFetcherRequest(
63
+ customer_id=self.customer_id,
64
+ job_id=job_id,
65
+ merge_with=json.dumps(existing_conf),
66
+ task_key=task_key,
67
+ run_params=json.dumps(run_params) if run_params is not None else None,
68
+ )
63
69
  try:
64
70
  return self._call_conf_fetcher_api(params)
65
71
  except:
@@ -14,6 +14,7 @@ class ConfFetcherRequest(BaseModel):
14
14
  customer_id: str
15
15
  task_key: Optional[str] = None
16
16
  merge_with: Optional[str] = None
17
+ run_params: Optional[str] = None
17
18
 
18
19
 
19
20
  class Config(BaseModel, extra='forbid', use_enum_values=True):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zipher-sdk
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: Python SDK for programmatic access to the Zipher API
5
5
  Home-page: UNKNOWN
6
6
  Author: Zipher Inc.
File without changes
File without changes
File without changes
File without changes
File without changes