pangea-sdk 6.0.0__py3-none-any.whl → 6.1.1__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.
@@ -3,7 +3,7 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
- from typing import Any, Dict, List, Optional
6
+ from typing import Any
7
7
 
8
8
  from pangea.asyncio.services.base import ServiceBaseAsync
9
9
  from pangea.config import PangeaConfig
@@ -73,14 +73,14 @@ class AuthZAsync(ServiceBaseAsync):
73
73
 
74
74
  super().__init__(token, config, logger_name, config_id=config_id)
75
75
 
76
- async def tuple_create(self, tuples: List[Tuple]) -> PangeaResponse[TupleCreateResult]:
76
+ async def tuple_create(self, tuples: list[Tuple]) -> PangeaResponse[TupleCreateResult]:
77
77
  """Create tuples.
78
78
 
79
79
  Create tuples in the AuthZ Service. The request will fail if there is no schema
80
80
  or the tuples do not validate against the schema.
81
81
 
82
82
  Args:
83
- tuples (List[Tuple]): List of tuples to be created.
83
+ tuples: Tuples to be created.
84
84
 
85
85
  Raises:
86
86
  PangeaAPIException: If an API Error happens.
@@ -88,7 +88,7 @@ class AuthZAsync(ServiceBaseAsync):
88
88
  Returns:
89
89
  Pangea Response with empty result.
90
90
  Available response fields can be found in our
91
- [API Documentation](https://pangea.cloud/docs/api/authz#/v1/tuple/create).
91
+ [API Documentation](https://pangea.cloud/docs/api/authz#/v1/tuple/create-post).
92
92
 
93
93
  Examples:
94
94
  await authz.tuple_create(
@@ -110,10 +110,10 @@ class AuthZAsync(ServiceBaseAsync):
110
110
  async def tuple_list(
111
111
  self,
112
112
  filter: TupleListFilter,
113
- size: Optional[int] = None,
114
- last: Optional[str] = None,
115
- order: Optional[ItemOrder] = None,
116
- order_by: Optional[TupleOrderBy] = None,
113
+ size: int | None = None,
114
+ last: str | None = None,
115
+ order: ItemOrder | None = None,
116
+ order_by: TupleOrderBy | None = None,
117
117
  ) -> PangeaResponse[TupleListResult]:
118
118
  """List tuples.
119
119
 
@@ -122,11 +122,11 @@ class AuthZAsync(ServiceBaseAsync):
122
122
  is empty it will return all the tuples.
123
123
 
124
124
  Args:
125
- filter (TupleListFilter): The filter for listing tuples.
126
- size (Optional[int]): The size of the result set. Default is None.
127
- last (Optional[str]): The last token from a previous response. Default is None.
128
- order (Optional[ItemOrder]): Order results asc(ending) or desc(ending).
129
- order_by (Optional[TupleOrderBy]): Which field to order results by.
125
+ filter: The filter for listing tuples.
126
+ size: The size of the result set. Default is None.
127
+ last: The last token from a previous response. Default is None.
128
+ order: Order results asc(ending) or desc(ending).
129
+ order_by: Which field to order results by.
130
130
 
131
131
  Raises:
132
132
  PangeaAPIException: If an API Error happens.
@@ -134,7 +134,7 @@ class AuthZAsync(ServiceBaseAsync):
134
134
  Returns:
135
135
  Pangea Response with a list of tuples and the last token.
136
136
  Available response fields can be found in our
137
- [API Documentation](https://pangea.cloud/docs/api/authz#/v1/tuple/list).
137
+ [API Documentation](https://pangea.cloud/docs/api/authz#/v1/tuple/list-post).
138
138
 
139
139
  Examples:
140
140
  await authz.tuple_list(TupleListFilter(subject_type="user", subject_id="user_1"))
@@ -144,13 +144,13 @@ class AuthZAsync(ServiceBaseAsync):
144
144
  )
145
145
  return await self.request.post("v1/tuple/list", TupleListResult, data=input_data.model_dump(exclude_none=True))
146
146
 
147
- async def tuple_delete(self, tuples: List[Tuple]) -> PangeaResponse[TupleDeleteResult]:
147
+ async def tuple_delete(self, tuples: list[Tuple]) -> PangeaResponse[TupleDeleteResult]:
148
148
  """Delete tuples.
149
149
 
150
150
  Delete tuples in the AuthZ Service.
151
151
 
152
152
  Args:
153
- tuples (List[Tuple]): List of tuples to be deleted.
153
+ tuples: Tuples to be deleted.
154
154
 
155
155
  Raises:
156
156
  PangeaAPIException: If an API Error happens.
@@ -158,7 +158,7 @@ class AuthZAsync(ServiceBaseAsync):
158
158
  Returns:
159
159
  Pangea Response with empty result.
160
160
  Available response fields can be found in our
161
- [API Documentation](https://pangea.cloud/docs/api/authz#/v1/tuple/delete).
161
+ [API Documentation](https://pangea.cloud/docs/api/authz#/v1/tuple/delete-post).
162
162
 
163
163
  Examples:
164
164
  await authz.tuple_delete(
@@ -182,8 +182,8 @@ class AuthZAsync(ServiceBaseAsync):
182
182
  resource: Resource,
183
183
  action: str,
184
184
  subject: Subject,
185
- debug: Optional[bool] = None,
186
- attributes: Optional[Dict[str, Any]] = None,
185
+ debug: bool | None = None,
186
+ attributes: dict[str, Any] | None = None,
187
187
  ) -> PangeaResponse[CheckResult]:
188
188
  """Perform a check request.
189
189
 
@@ -192,9 +192,9 @@ class AuthZAsync(ServiceBaseAsync):
192
192
  Args:
193
193
  resource (Resource): The resource to check.
194
194
  action (str): The action to check.
195
- subject (Subject): The subject to check.
196
- debug (Optional[bool]): Setting this value to True will provide a detailed analysis of the check.
197
- attributes (Optional[Dict[str, Any]]): Additional attributes for the check.
195
+ subject: The subject to check.
196
+ debug: Setting this value to True will provide a detailed analysis of the check.
197
+ attributes: Additional attributes for the check.
198
198
 
199
199
  Raises:
200
200
  PangeaAPIException: If an API Error happens.
@@ -202,7 +202,7 @@ class AuthZAsync(ServiceBaseAsync):
202
202
  Returns:
203
203
  Pangea Response with the result of the check.
204
204
  Available response fields can be found in our
205
- [API Documentation](https://pangea.cloud/docs/api/authz#/v1/check).
205
+ [API Documentation](https://pangea.cloud/docs/api/authz#/v1/check-post).
206
206
 
207
207
  Examples:
208
208
  await authz.check(
@@ -217,7 +217,7 @@ class AuthZAsync(ServiceBaseAsync):
217
217
  return await self.request.post("v1/check", CheckResult, data=input_data.model_dump(exclude_none=True))
218
218
 
219
219
  async def list_resources(
220
- self, type: str, action: str, subject: Subject, attributes: Optional[Dict[str, Any]] = None
220
+ self, type: str, action: str, subject: Subject, attributes: dict[str, Any] | None = None
221
221
  ) -> PangeaResponse[ListResourcesResult]:
222
222
  """List resources.
223
223
 
@@ -225,10 +225,10 @@ class AuthZAsync(ServiceBaseAsync):
225
225
  type that the subject has access to the action with.
226
226
 
227
227
  Args:
228
- type (str): The type to filter resources.
229
- action (str): The action to filter resources.
230
- subject (Subject): The subject to filter resources.
231
- attributes (Optional[Dict[str, Any]]): A JSON object of attribute data.
228
+ type: The type to filter resources.
229
+ action: The action to filter resources.
230
+ subject: The subject to filter resources.
231
+ attributes: A JSON object of attribute data.
232
232
 
233
233
  Raises:
234
234
  PangeaAPIException: If an API Error happens.
@@ -236,7 +236,7 @@ class AuthZAsync(ServiceBaseAsync):
236
236
  Returns:
237
237
  Pangea Response with a list of resource IDs.
238
238
  Available response fields can be found in our
239
- [API Documentation](https://pangea.cloud/docs/api/authz#/v1/list-resources).
239
+ [API Documentation](https://pangea.cloud/docs/api/authz#/v1/list-resources-post).
240
240
 
241
241
  Examples:
242
242
  await authz.list_resources(
@@ -252,7 +252,7 @@ class AuthZAsync(ServiceBaseAsync):
252
252
  )
253
253
 
254
254
  async def list_subjects(
255
- self, resource: Resource, action: str, attributes: Optional[Dict[str, Any]] = None
255
+ self, resource: Resource, action: str, attributes: dict[str, Any] | None = None
256
256
  ) -> PangeaResponse[ListSubjectsResult]:
257
257
  """List subjects.
258
258
 
@@ -260,9 +260,9 @@ class AuthZAsync(ServiceBaseAsync):
260
260
  access to the action for the given resource.
261
261
 
262
262
  Args:
263
- resource (Resource): The resource to filter subjects.
264
- action (str): The action to filter subjects.
265
- attributes (Optional[Dict[str, Any]]): A JSON object of attribute data.
263
+ resource: The resource to filter subjects.
264
+ action: The action to filter subjects.
265
+ attributes: A JSON object of attribute data.
266
266
 
267
267
  Raises:
268
268
  PangeaAPIException: If an API Error happens.
@@ -270,7 +270,7 @@ class AuthZAsync(ServiceBaseAsync):
270
270
  Returns:
271
271
  Pangea Response with a list of subjects.
272
272
  Available response fields can be found in our
273
- [API Documentation](https://pangea.cloud/docs/api/authz#/v1/list-subjects).
273
+ [API Documentation](https://pangea.cloud/docs/api/authz#/v1/list-subjects-post).
274
274
 
275
275
  Examples:
276
276
  await authz.list_subjects(
@@ -16,7 +16,7 @@ class FileScanAsync(ServiceBaseAsync):
16
16
  """FileScan service client.
17
17
 
18
18
  Provides methods to interact with Pangea FileScan Service:
19
- https://pangea.cloud/docs/api/embargo
19
+ https://pangea.cloud/docs/api/file-scan
20
20
 
21
21
  The following information is needed:
22
22
  PANGEA_TOKEN - service token which can be found on the Pangea User
@@ -92,7 +92,7 @@ class RedactAsync(ServiceBaseAsync):
92
92
  Returns:
93
93
  Pangea Response with redacted text in the response.result property,
94
94
  available response fields can be found in our
95
- [API Documentation](https://pangea.cloud/docs/api/redact#redact).
95
+ [API Documentation](https://pangea.cloud/docs/api/redact#redact-post).
96
96
 
97
97
  Examples:
98
98
  response = redact.redact(text="Jenny Jenny... 555-867-5309")
@@ -151,7 +151,7 @@ class RedactAsync(ServiceBaseAsync):
151
151
  Returns:
152
152
  Pangea Response with redacted data in the response.result field,
153
153
  available response fields can be found in our
154
- [API Documentation](https://pangea.cloud/docs/api/redact#redact-structured)
154
+ [API Documentation](https://pangea.cloud/docs/api/redact#redact-structured-post)
155
155
 
156
156
  Examples:
157
157
  data = {
@@ -196,7 +196,7 @@ class RedactAsync(ServiceBaseAsync):
196
196
  Returns:
197
197
  Pangea Response with redacted data in the response.result field,
198
198
  available response fields can be found in our
199
- [API Documentation](https://pangea.cloud/docs/api/redact#unredact)
199
+ [API Documentation](https://pangea.cloud/docs/api/redact#unredact-post)
200
200
  """
201
201
  input = m.UnredactRequest(redacted_data=redacted_data, fpe_context=fpe_context)
202
202
  return await self.request.post("v1/unredact", m.UnredactResult, data=input.model_dump(exclude_none=True))
@@ -164,7 +164,7 @@ class VaultAsync(ServiceBaseAsync):
164
164
  Returns:
165
165
  A PangeaResponse where the id of the deleted secret or key
166
166
  is returned in the response.result field.
167
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault#delete).
167
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-general#/v1/delete-post).
168
168
 
169
169
  Raises:
170
170
  PangeaAPIException: If an API Error happens
@@ -197,7 +197,7 @@ class VaultAsync(ServiceBaseAsync):
197
197
  Returns:
198
198
  A PangeaResponse where the secret or key
199
199
  is returned in the response.result field.
200
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault#retrieve).
200
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-general#/v1/get-post).
201
201
 
202
202
  Raises:
203
203
  PangeaAPIException: If an API Error happens
@@ -283,7 +283,7 @@ class VaultAsync(ServiceBaseAsync):
283
283
  Returns:
284
284
  A PangeaResponse where a list of secrets or keys
285
285
  is returned in the response.result field.
286
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault#list).
286
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-general#/v1/list-post).
287
287
 
288
288
  Raises:
289
289
  PangeaAPIException: If an API Error happens
@@ -345,7 +345,7 @@ class VaultAsync(ServiceBaseAsync):
345
345
  Returns:
346
346
  A PangeaResponse where the item ID is returned in the
347
347
  response.result field. Available response fields can be found in our
348
- [API documentation](https://pangea.cloud/docs/api/vault#update).
348
+ [API documentation](https://pangea.cloud/docs/api/vault/v1-general#/v1/update-post).
349
349
 
350
350
  Raises:
351
351
  PangeaAPIException: If an API Error happens
@@ -1680,7 +1680,7 @@ class VaultAsync(ServiceBaseAsync):
1680
1680
  Returns:
1681
1681
  A PangeaResponse where the encrypted message in base64 is returned
1682
1682
  in the response.result field. Available response fields can be found
1683
- in our [API documentation](https://pangea.cloud/docs/api/vault#encrypt).
1683
+ in our [API documentation](https://pangea.cloud/docs/api/vault/v1-keys#/v1/key/encrypt-post).
1684
1684
 
1685
1685
  Raises:
1686
1686
  PangeaAPIException: If an API Error happens
@@ -1716,7 +1716,7 @@ class VaultAsync(ServiceBaseAsync):
1716
1716
 
1717
1717
  Returns:
1718
1718
  A PangeaResponse where the decrypted message in base64 is returned
1719
- in the response.result field. Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault#decrypt).
1719
+ in the response.result field. Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-keys#/v1/key/decrypt-post).
1720
1720
 
1721
1721
  Raises:
1722
1722
  PangeaAPIException: If an API Error happens
@@ -1750,7 +1750,7 @@ class VaultAsync(ServiceBaseAsync):
1750
1750
  Returns:
1751
1751
  A PangeaResponse where the signature of the message in base64 is
1752
1752
  returned in the response.result field. Available response fields can
1753
- be found in our [API documentation](https://pangea.cloud/docs/api/vault#sign).
1753
+ be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-keys#/v1/key/sign-post).
1754
1754
 
1755
1755
  Raises:
1756
1756
  PangeaAPIException: If an API Error happens
@@ -1788,7 +1788,7 @@ class VaultAsync(ServiceBaseAsync):
1788
1788
  Returns:
1789
1789
  A PangeaResponse where the signature is valid
1790
1790
  is returned in the response.result field.
1791
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault#verify).
1791
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-keys#/v1/key/verify-post).
1792
1792
 
1793
1793
  Examples:
1794
1794
  response = await vault.verify(
@@ -1826,7 +1826,7 @@ class VaultAsync(ServiceBaseAsync):
1826
1826
  Returns:
1827
1827
  A PangeaResponse where the signature is valid
1828
1828
  is returned in the response.result field.
1829
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault#verify-jwt).
1829
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-jwt#/v1/key/verify/jwt-post).
1830
1830
 
1831
1831
  Examples:
1832
1832
  response = await vault.jwt_verify(jws="ewogICJhbGciO...")
@@ -1851,7 +1851,7 @@ class VaultAsync(ServiceBaseAsync):
1851
1851
  Returns:
1852
1852
  A PangeaResponse where the signed JSON Web Token (JWS) is returned
1853
1853
  in the response.result field. Available response fields can be found
1854
- in our [API documentation](https://pangea.cloud/docs/api/vault#sign-a-jwt).
1854
+ in our [API documentation](https://pangea.cloud/docs/api/vault/v1-jwt#/v1/key/sign/jwt-post).
1855
1855
 
1856
1856
  Examples:
1857
1857
  response = await vault.jwt_sign(
@@ -1881,7 +1881,7 @@ class VaultAsync(ServiceBaseAsync):
1881
1881
  Returns:
1882
1882
  A PangeaResponse where the JSON Web Key Set (JWKS) object is
1883
1883
  returned in the response.result field. Available response fields can
1884
- be found in our [API documentation](https://pangea.cloud/docs/api/vault#retrieve-jwk).
1884
+ be found in our [API documentation](https://pangea.cloud/docs/api/vault/v1-jwt#/v1/get/jwk-post).
1885
1885
 
1886
1886
  Examples:
1887
1887
  response = await vault.jwk_get("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5")
@@ -1913,7 +1913,7 @@ class VaultAsync(ServiceBaseAsync):
1913
1913
  Returns:
1914
1914
  A PangeaResponse where the state change object is returned in the
1915
1915
  response.result field. Available response fields can be found in our
1916
- [API documentation](https://pangea.cloud/docs/api/vault#change-state).
1916
+ [API documentation](https://pangea.cloud/docs/api/vault/v1-general#/v1/state/change-post).
1917
1917
 
1918
1918
  Raises:
1919
1919
  PangeaAPIException: If an API Error happens
@@ -2014,7 +2014,7 @@ class VaultAsync(ServiceBaseAsync):
2014
2014
  Returns:
2015
2015
  A `PangeaResponse` where the encrypted object is returned in the
2016
2016
  `response.result` field. Available response fields can be found in
2017
- our [API documentation](https://pangea.cloud/docs/api/vault#encrypt-structured).
2017
+ our [API documentation](https://pangea.cloud/docs/api/vault/v1-keys#/v1/key/encrypt/structured-post).
2018
2018
 
2019
2019
  Raises:
2020
2020
  PangeaAPIException: If an API error happens.
@@ -2070,7 +2070,7 @@ class VaultAsync(ServiceBaseAsync):
2070
2070
  Returns:
2071
2071
  A `PangeaResponse` where the decrypted object is returned in the
2072
2072
  `response.result` field. Available response fields can be found in
2073
- our [API documentation](https://pangea.cloud/docs/api/vault#decrypt-structured).
2073
+ our [API documentation](https://pangea.cloud/docs/api/vault/v1-keys#/v1/key/decrypt/structured-post).
2074
2074
 
2075
2075
  Examples:
2076
2076
  data = {"field1": [1, 2, "kxcbC9E9IlgVaSCChPWUMgUC3ko=", "6FfI/LCzatLRLNAc8SuBK/TDnGxp"], "field2": "data2"}
@@ -2214,7 +2214,7 @@ class VaultAsync(ServiceBaseAsync):
2214
2214
  Returns:
2215
2215
  A `PangeaResponse` where the exported key is returned in the
2216
2216
  `response.result` field. Available response fields can be found in
2217
- our [API documentation](https://pangea.cloud/docs/api/vault#export).
2217
+ our [API documentation](https://pangea.cloud/docs/api/vault/v1-general#/v1/export-post).
2218
2218
 
2219
2219
  Raises:
2220
2220
  PangeaAPIException: If an API error happens.
pangea/request.py CHANGED
@@ -231,7 +231,7 @@ class PangeaRequest(PangeaRequestBase):
231
231
  data = {}
232
232
 
233
233
  # Normalize.
234
- data = cast(dict[str, Any], to_jsonable_python(data))
234
+ data = cast(dict[str, Any], to_jsonable_python(data, exclude_none=True))
235
235
 
236
236
  if url is None:
237
237
  url = self._url(endpoint)
@@ -457,7 +457,7 @@ class Audit(ServiceBase, AuditBase):
457
457
  A PangeaResponse where the hash of event data and optional verbose
458
458
  results are returned in the response.result field.
459
459
  Available response fields can be found in our
460
- [API documentation](https://pangea.cloud/docs/api/audit#/v1/log).
460
+ [API documentation](https://pangea.cloud/docs/api/audit#/v1/log-post).
461
461
 
462
462
  Examples:
463
463
  log_response = audit.log(
@@ -505,7 +505,7 @@ class Audit(ServiceBase, AuditBase):
505
505
  Returns:
506
506
  A PangeaResponse where the hash of event data and optional verbose
507
507
  results are returned in the response.result field.
508
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v1/log).
508
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v1/log-post).
509
509
 
510
510
  Examples:
511
511
  response = audit.log_event({"message": "hello world"}, verbose=True)
@@ -543,7 +543,7 @@ class Audit(ServiceBase, AuditBase):
543
543
  Returns:
544
544
  A PangeaResponse where the hash of event data and optional verbose
545
545
  results are returned in the response.result field.
546
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v2/log).
546
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v2/log-post).
547
547
 
548
548
  Examples:
549
549
  log_response = audit.log_bulk(
@@ -584,7 +584,7 @@ class Audit(ServiceBase, AuditBase):
584
584
  Returns:
585
585
  A PangeaResponse where the hash of event data and optional verbose
586
586
  results are returned in the response.result field.
587
- Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v2/log_async).
587
+ Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v2/log_async-post).
588
588
 
589
589
  Examples:
590
590
  log_response = audit.log_bulk_async(
@@ -659,8 +659,8 @@ class Audit(ServiceBase, AuditBase):
659
659
 
660
660
  Returns:
661
661
  A PangeaResponse[SearchOutput] where the first page of matched events is returned in the
662
- response.result field. Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v1/search).
663
- Pagination can be found in the [search results endpoint](https://pangea.cloud/docs/api/audit#/v1/results).
662
+ response.result field. Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/audit#/v1/search-post).
663
+ Pagination can be found in the [search results endpoint](https://pangea.cloud/docs/api/audit#/v1/results-post).
664
664
 
665
665
  Examples:
666
666
  response = audit.search(