pangea-sdk 4.4.0__tar.gz → 5.0.0__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 (59) hide show
  1. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/PKG-INFO +3 -4
  2. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/README.md +1 -1
  3. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/__init__.py +1 -1
  4. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/request.py +12 -6
  5. pangea_sdk-5.0.0/pangea/asyncio/services/vault.py +2240 -0
  6. pangea_sdk-5.0.0/pangea/crypto/rsa.py +135 -0
  7. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/request.py +41 -37
  8. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/audit/signing.py +5 -4
  9. pangea_sdk-5.0.0/pangea/services/vault/models/asymmetric.py +169 -0
  10. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/vault/models/common.py +293 -171
  11. pangea_sdk-5.0.0/pangea/services/vault/models/keys.py +94 -0
  12. pangea_sdk-5.0.0/pangea/services/vault/models/secret.py +48 -0
  13. pangea_sdk-5.0.0/pangea/services/vault/models/symmetric.py +109 -0
  14. pangea_sdk-5.0.0/pangea/services/vault/vault.py +2237 -0
  15. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/tools.py +6 -7
  16. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/utils.py +3 -1
  17. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/verify_audit.py +4 -4
  18. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pyproject.toml +3 -3
  19. pangea_sdk-4.4.0/pangea/asyncio/services/vault.py +0 -1456
  20. pangea_sdk-4.4.0/pangea/crypto/rsa.py +0 -47
  21. pangea_sdk-4.4.0/pangea/services/vault/models/asymmetric.py +0 -69
  22. pangea_sdk-4.4.0/pangea/services/vault/models/secret.py +0 -24
  23. pangea_sdk-4.4.0/pangea/services/vault/models/symmetric.py +0 -67
  24. pangea_sdk-4.4.0/pangea/services/vault/vault.py +0 -1468
  25. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/__init__.py +0 -0
  26. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/file_uploader.py +0 -0
  27. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/__init__.py +0 -0
  28. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/audit.py +0 -0
  29. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/authn.py +0 -0
  30. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/authz.py +0 -0
  31. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/base.py +0 -0
  32. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/embargo.py +0 -0
  33. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/file_scan.py +0 -0
  34. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/intel.py +0 -0
  35. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/redact.py +0 -0
  36. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/asyncio/services/sanitize.py +0 -0
  37. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/audit_logger.py +0 -0
  38. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/config.py +0 -0
  39. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/deep_verify.py +0 -0
  40. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/deprecated.py +0 -0
  41. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/dump_audit.py +0 -0
  42. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/exceptions.py +0 -0
  43. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/file_uploader.py +0 -0
  44. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/py.typed +0 -0
  45. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/response.py +0 -0
  46. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/__init__.py +0 -0
  47. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/audit/audit.py +0 -0
  48. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/audit/exceptions.py +0 -0
  49. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/audit/models.py +0 -0
  50. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/audit/util.py +0 -0
  51. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/authn/authn.py +0 -0
  52. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/authn/models.py +0 -0
  53. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/authz.py +0 -0
  54. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/base.py +0 -0
  55. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/embargo.py +0 -0
  56. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/file_scan.py +0 -0
  57. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/intel.py +0 -0
  58. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/redact.py +0 -0
  59. {pangea_sdk-4.4.0 → pangea_sdk-5.0.0}/pangea/services/sanitize.py +0 -0
@@ -1,16 +1,15 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pangea-sdk
3
- Version: 4.4.0
3
+ Version: 5.0.0
4
4
  Summary: Pangea API SDK
5
5
  Home-page: https://pangea.cloud/docs/sdk/python/
6
6
  License: MIT
7
7
  Keywords: Pangea,SDK,Audit
8
8
  Author: Glenn Gallien
9
9
  Author-email: glenn.gallien@pangea.cloud
10
- Requires-Python: >=3.8.0,<4.0.0
10
+ Requires-Python: >=3.9.0,<4.0.0
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.8
14
13
  Classifier: Programming Language :: Python :: 3.9
15
14
  Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
@@ -41,7 +40,7 @@ Description-Content-Type: text/markdown
41
40
 
42
41
  # Pangea Python SDK
43
42
 
44
- A Python SDK for integrating with Pangea services. Supports Python v3.8 and
43
+ A Python SDK for integrating with Pangea services. Supports Python v3.9 and
45
44
  above.
46
45
 
47
46
  ## Installation
@@ -9,7 +9,7 @@
9
9
 
10
10
  # Pangea Python SDK
11
11
 
12
- A Python SDK for integrating with Pangea services. Supports Python v3.8 and
12
+ A Python SDK for integrating with Pangea services. Supports Python v3.9 and
13
13
  above.
14
14
 
15
15
  ## Installation
@@ -1,4 +1,4 @@
1
- __version__ = "4.4.0"
1
+ __version__ = "5.0.0"
2
2
 
3
3
  from pangea.asyncio.request import PangeaRequestAsync
4
4
  from pangea.config import PangeaConfig
@@ -9,7 +9,8 @@ from typing import Any, Dict, List, Optional, Sequence, Tuple, Type, Union
9
9
 
10
10
  import aiohttp
11
11
  from aiohttp import FormData
12
- from typing_extensions import TypeVar
12
+ from pydantic import BaseModel
13
+ from typing_extensions import Any, TypeVar
13
14
 
14
15
  import pangea.exceptions as pe
15
16
  from pangea.request import MultipartResponse, PangeaRequestBase
@@ -32,7 +33,7 @@ class PangeaRequestAsync(PangeaRequestBase):
32
33
  self,
33
34
  endpoint: str,
34
35
  result_class: Type[TResult],
35
- data: Union[str, Dict] = {},
36
+ data: str | BaseModel | dict[str, Any] | None = None,
36
37
  files: Optional[List[Tuple]] = None,
37
38
  poll_result: bool = True,
38
39
  url: Optional[str] = None,
@@ -47,6 +48,13 @@ class PangeaRequestAsync(PangeaRequestBase):
47
48
  PangeaResponse which contains the response in its entirety and
48
49
  various properties to retrieve individual fields
49
50
  """
51
+
52
+ if isinstance(data, BaseModel):
53
+ data = data.model_dump(exclude_none=True)
54
+
55
+ if data is None:
56
+ data = {}
57
+
50
58
  if url is None:
51
59
  url = self._url(endpoint)
52
60
 
@@ -209,8 +217,7 @@ class PangeaRequestAsync(PangeaRequestBase):
209
217
  )
210
218
 
211
219
  return AttachedFile(filename=filename, file=await response.read(), content_type=content_type)
212
- else:
213
- raise pe.DownloadFileError(f"Failed to download file. Status: {response.status}", await response.text())
220
+ raise pe.DownloadFileError(f"Failed to download file. Status: {response.status}", await response.text())
214
221
 
215
222
  async def _get_pangea_json(self, reader: aiohttp.multipart.MultipartResponseWrapper) -> Optional[Dict[str, Any]]:
216
223
  # Iterate through parts
@@ -369,8 +376,7 @@ class PangeaRequestAsync(PangeaRequestBase):
369
376
 
370
377
  if loop_resp.accepted_result is not None and not loop_resp.accepted_result.has_upload_url:
371
378
  return loop_resp
372
- else:
373
- raise loop_exc
379
+ raise loop_exc
374
380
 
375
381
  async def _handle_queued_result(self, response: PangeaResponse) -> PangeaResponse:
376
382
  if self._queued_retry_enabled and response.http_status == 202: