pangea-sdk 6.7.0__py3-none-any.whl → 6.9.0__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.
- pangea/__init__.py +1 -1
- pangea/asyncio/services/redact.py +6 -4
- pangea/services/ai_guard.py +8 -0
- pangea/services/redact.py +11 -26
- {pangea_sdk-6.7.0.dist-info → pangea_sdk-6.9.0.dist-info}/METADATA +5 -5
- {pangea_sdk-6.7.0.dist-info → pangea_sdk-6.9.0.dist-info}/RECORD +7 -7
- {pangea_sdk-6.7.0.dist-info → pangea_sdk-6.9.0.dist-info}/WHEEL +1 -1
pangea/__init__.py
CHANGED
|
@@ -9,6 +9,7 @@ from __future__ import annotations
|
|
|
9
9
|
from typing import Dict, List, Optional, Union
|
|
10
10
|
|
|
11
11
|
import pangea.services.redact as m
|
|
12
|
+
from pangea._typing import T
|
|
12
13
|
from pangea.asyncio.services.base import ServiceBaseAsync
|
|
13
14
|
from pangea.config import PangeaConfig
|
|
14
15
|
from pangea.response import PangeaResponse
|
|
@@ -182,11 +183,11 @@ class RedactAsync(ServiceBaseAsync):
|
|
|
182
183
|
"v1/redact_structured", m.StructuredResult, data=input.model_dump(exclude_none=True)
|
|
183
184
|
)
|
|
184
185
|
|
|
185
|
-
async def unredact(self, redacted_data:
|
|
186
|
+
async def unredact(self, redacted_data: T, fpe_context: str) -> PangeaResponse[m.UnredactResult[T]]:
|
|
186
187
|
"""
|
|
187
188
|
Unredact
|
|
188
189
|
|
|
189
|
-
Decrypt or unredact
|
|
190
|
+
Decrypt or unredact FPE redactions
|
|
190
191
|
|
|
191
192
|
OperationId: redact_post_v1_unredact
|
|
192
193
|
|
|
@@ -202,5 +203,6 @@ class RedactAsync(ServiceBaseAsync):
|
|
|
202
203
|
available response fields can be found in our
|
|
203
204
|
[API Documentation](https://pangea.cloud/docs/api/redact#unredact-post)
|
|
204
205
|
"""
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
return await self.request.post(
|
|
207
|
+
"v1/unredact", m.UnredactResult, data={"redacted_data": redacted_data, "fpe_context": fpe_context}
|
|
208
|
+
)
|
pangea/services/ai_guard.py
CHANGED
|
@@ -150,6 +150,13 @@ class SecretsDetectionOverride(APIRequestModel):
|
|
|
150
150
|
pangea_token: Optional[PiiEntityAction] = None
|
|
151
151
|
|
|
152
152
|
|
|
153
|
+
class ImageDetectionItems(APIRequestModel):
|
|
154
|
+
disabled: Optional[bool] = None
|
|
155
|
+
action: Optional[Literal["", "report", "block"]] = ""
|
|
156
|
+
topics: Optional[list[str]] = None
|
|
157
|
+
threshold: Annotated[Optional[float], Field(ge=0.0, le=1.0, multiple_of=0.01)] = None
|
|
158
|
+
|
|
159
|
+
|
|
153
160
|
class Overrides(APIRequestModel):
|
|
154
161
|
"""Overrides flags."""
|
|
155
162
|
|
|
@@ -159,6 +166,7 @@ class Overrides(APIRequestModel):
|
|
|
159
166
|
code_detection: Optional[CodeDetectionOverride] = None
|
|
160
167
|
competitors: Optional[CompetitorsOverride] = None
|
|
161
168
|
gibberish: Optional[GibberishOverride] = None
|
|
169
|
+
image: Optional[ImageDetectionItems] = None
|
|
162
170
|
language_detection: Optional[LanguageDetectionOverride] = None
|
|
163
171
|
malicious_entity: Optional[MaliciousEntityOverride] = None
|
|
164
172
|
pii_entity: Optional[PiiEntityOverride] = None
|
pangea/services/redact.py
CHANGED
|
@@ -9,6 +9,9 @@ from __future__ import annotations
|
|
|
9
9
|
import enum
|
|
10
10
|
from typing import Dict, List, Optional, Union
|
|
11
11
|
|
|
12
|
+
from typing_extensions import Generic
|
|
13
|
+
|
|
14
|
+
from pangea._typing import T
|
|
12
15
|
from pangea.config import PangeaConfig
|
|
13
16
|
from pangea.response import APIRequestModel, APIResponseModel, PangeaResponse, PangeaResponseResult
|
|
14
17
|
from pangea.services.base import ServiceBase
|
|
@@ -174,28 +177,9 @@ class StructuredResult(PangeaResponseResult):
|
|
|
174
177
|
"""FPE context used to encrypt and redact data"""
|
|
175
178
|
|
|
176
179
|
|
|
177
|
-
class
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Arguments:
|
|
182
|
-
redacted_data: Data to unredact
|
|
183
|
-
fpe_context (base64): FPE context used to decrypt and unredact data
|
|
184
|
-
"""
|
|
185
|
-
|
|
186
|
-
redacted_data: RedactedData
|
|
187
|
-
fpe_context: str
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
RedactedData = Union[str, Dict]
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
class UnredactResult(PangeaResponseResult):
|
|
194
|
-
"""
|
|
195
|
-
Result class after an unredact request
|
|
196
|
-
"""
|
|
197
|
-
|
|
198
|
-
data: RedactedData
|
|
180
|
+
class UnredactResult(PangeaResponseResult, Generic[T]):
|
|
181
|
+
data: T
|
|
182
|
+
"""The unredacted data"""
|
|
199
183
|
|
|
200
184
|
|
|
201
185
|
class Redact(ServiceBase):
|
|
@@ -364,11 +348,11 @@ class Redact(ServiceBase):
|
|
|
364
348
|
)
|
|
365
349
|
return self.request.post("v1/redact_structured", StructuredResult, data=input.model_dump(exclude_none=True))
|
|
366
350
|
|
|
367
|
-
def unredact(self, redacted_data:
|
|
351
|
+
def unredact(self, redacted_data: T, fpe_context: str) -> PangeaResponse[UnredactResult[T]]:
|
|
368
352
|
"""
|
|
369
353
|
Unredact
|
|
370
354
|
|
|
371
|
-
Decrypt or unredact
|
|
355
|
+
Decrypt or unredact FPE redactions
|
|
372
356
|
|
|
373
357
|
OperationId: redact_post_v1_unredact
|
|
374
358
|
|
|
@@ -384,5 +368,6 @@ class Redact(ServiceBase):
|
|
|
384
368
|
available response fields can be found in our
|
|
385
369
|
[API Documentation](https://pangea.cloud/docs/api/redact#unredact-post)
|
|
386
370
|
"""
|
|
387
|
-
|
|
388
|
-
|
|
371
|
+
return self.request.post(
|
|
372
|
+
"v1/unredact", UnredactResult, data={"redacted_data": redacted_data, "fpe_context": fpe_context}
|
|
373
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pangea-sdk
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.9.0
|
|
4
4
|
Summary: Pangea API SDK
|
|
5
5
|
Keywords: Pangea,SDK,Audit
|
|
6
6
|
Author: Glenn Gallien
|
|
@@ -8,16 +8,16 @@ Author-email: Glenn Gallien <glenn.gallien@pangea.cloud>
|
|
|
8
8
|
License-Expression: MIT
|
|
9
9
|
Classifier: Topic :: Software Development
|
|
10
10
|
Classifier: Topic :: Software Development :: Libraries
|
|
11
|
-
Requires-Dist: aiohttp>=3.
|
|
12
|
-
Requires-Dist: cryptography>=
|
|
11
|
+
Requires-Dist: aiohttp>=3.13.1,<4.0.0
|
|
12
|
+
Requires-Dist: cryptography>=46.0.3,<47.0.0
|
|
13
13
|
Requires-Dist: deprecated>=1.2.18,<2.0.0
|
|
14
14
|
Requires-Dist: google-crc32c>=1.7.1,<2.0.0
|
|
15
|
-
Requires-Dist: pydantic>=2.
|
|
15
|
+
Requires-Dist: pydantic>=2.12.3,<3.0.0
|
|
16
16
|
Requires-Dist: python-dateutil>=2.9.0.post0,<3.0.0
|
|
17
17
|
Requires-Dist: requests>=2.32.5,<3.0.0
|
|
18
18
|
Requires-Dist: requests-toolbelt>=1.0.0,<2.0.0
|
|
19
19
|
Requires-Dist: typing-extensions>=4.15.0,<5.0.0
|
|
20
|
-
Requires-Dist: yarl>=1.
|
|
20
|
+
Requires-Dist: yarl>=1.22.0,<2.0.0
|
|
21
21
|
Requires-Python: >=3.9.2, <4.0.0
|
|
22
22
|
Project-URL: repository, https://github.com/pangeacyber/pangea-python
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pangea/__init__.py,sha256=
|
|
1
|
+
pangea/__init__.py,sha256=cMIrdQCIDgo-hpwnMerKPSslOyn-PnRfwjVRTR7WZ98,293
|
|
2
2
|
pangea/_constants.py,sha256=gGGoQ6rhSiFEw1MKSGI588CHvFokG1Cf9SkkdPdRjVY,113
|
|
3
3
|
pangea/_typing.py,sha256=pFBLkW2gPVZkgvMibQkovusQJZuGjhcqpkeRHnQrvds,798
|
|
4
4
|
pangea/asyncio/__init__.py,sha256=96zytAbw70iKlqGwF12FCTf358_ijkBVNuo-1vBOyHI,79
|
|
@@ -14,7 +14,7 @@ pangea/asyncio/services/embargo.py,sha256=ctzj3kip6xos-Eu3JuOskrCGYC8T3JlsgAopZH
|
|
|
14
14
|
pangea/asyncio/services/file_scan.py,sha256=5Ckb3cXKpcoO7KTUu6ejr1uC43-6EJb91WuGOHroRHE,7202
|
|
15
15
|
pangea/asyncio/services/intel.py,sha256=WpQe8zN7T_y7OUzyYg3bu8yiKEH4iH1G60CRF6q5c60,39541
|
|
16
16
|
pangea/asyncio/services/prompt_guard.py,sha256=VePQ0L1alkKyYiQppKqZIueVMF8ThxNPHQcom5iIMo8,2645
|
|
17
|
-
pangea/asyncio/services/redact.py,sha256=
|
|
17
|
+
pangea/asyncio/services/redact.py,sha256=NnDmNfP65PjqlOXUNXOL4dIVy4va4dYlfhHL_F2DTMQ,7992
|
|
18
18
|
pangea/asyncio/services/sanitize.py,sha256=OybTAUfh_7vYRwb6Cjp4aHZoeHhIlg8caJ_BVrdbA1A,8691
|
|
19
19
|
pangea/asyncio/services/share.py,sha256=AV9FbA-IMU5TFhcBtUHoXKDQYfOIWAJJZKW6vFohBbs,30816
|
|
20
20
|
pangea/asyncio/services/vault.py,sha256=bYIUYmWYH8LqycfyDyNoS83BRWMd56t-RMt0B-TU8cQ,78564
|
|
@@ -30,7 +30,7 @@ pangea/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
30
30
|
pangea/request.py,sha256=PAbcRx746hSht20K_EOWPeQMjFzxjws7KfdMzzg_V10,27938
|
|
31
31
|
pangea/response.py,sha256=1OG5bPWE0j3p77tWYivG_O_O2SD8h0Tuq9WlN6rOKS0,7821
|
|
32
32
|
pangea/services/__init__.py,sha256=KP2U0-TcusW5H3GUFxS7Nc_LxxJ-X0uBbxeLQmGO6-o,667
|
|
33
|
-
pangea/services/ai_guard.py,sha256=
|
|
33
|
+
pangea/services/ai_guard.py,sha256=saxhJnoQzzI06tfRtTLF_pCT5AbGxL_44ezaqXlXXSU,27261
|
|
34
34
|
pangea/services/audit/audit.py,sha256=40jrCAOuZym_QsEfhghIjPm3KKWwPx9B3ZKJ-T7R4W4,39231
|
|
35
35
|
pangea/services/audit/exceptions.py,sha256=bhVuYe4ammacOVxwg98CChxvwZf5FKgR2DcgqILOcwc,471
|
|
36
36
|
pangea/services/audit/models.py,sha256=pE4jtYAn_c5JdPrXBfpKHwpRAqO_DTSCOy-QHkPMajw,15471
|
|
@@ -44,7 +44,7 @@ pangea/services/embargo.py,sha256=3rE3ImjBg2VUXQljGZICedsr14psWdymC2pmmdJF2co,40
|
|
|
44
44
|
pangea/services/file_scan.py,sha256=gSla3VUmgl3iA7DcrCf1BKopvunPG5ecIvX4DwzYOvc,7952
|
|
45
45
|
pangea/services/intel.py,sha256=1aglQxS1skMM6RMdXdjIiRq3jv4hMTtp-DbFbuHj3Hs,55159
|
|
46
46
|
pangea/services/prompt_guard.py,sha256=Fc0ujgIX-x_pqcUmZQT5itQv3bPxLBW2G5YZrkxhheI,3561
|
|
47
|
-
pangea/services/redact.py,sha256=
|
|
47
|
+
pangea/services/redact.py,sha256=JSXGtugVt9USWr02OS3MT8BXclVT6Q84rsIZwDKSfpI,12906
|
|
48
48
|
pangea/services/sanitize.py,sha256=0ZlCrEg8imJtRyovy4qZJb1ZAZ8ppIOQTj_nocBJ2CM,13019
|
|
49
49
|
pangea/services/share/file_format.py,sha256=1svO1ee_aenA9zoO_AaU-Rk5Ulp7kcPOc_KwNoluyQE,2797
|
|
50
50
|
pangea/services/share/share.py,sha256=IhTilqWcQ2GlsJ7kHHuVbXfNu8jvFtPBnEeM26SNsY8,52403
|
|
@@ -57,6 +57,6 @@ pangea/services/vault/vault.py,sha256=PJs1YlTud1cPnhyUDMguIEyhN0i-haG1kuzA_4hygE
|
|
|
57
57
|
pangea/tools.py,sha256=JkwVplvx7MCPRSdPhFTLvOl6h7btaUbXEuHgUy0EHBU,6452
|
|
58
58
|
pangea/utils.py,sha256=QwTODI_D8by86uXeA0MpdhJICvz5baKUtfv1rguQshU,4943
|
|
59
59
|
pangea/verify_audit.py,sha256=-VepQKHtSqZRqhIKiUtLufa7ywwdMNLN2SuhingMooU,17288
|
|
60
|
-
pangea_sdk-6.
|
|
61
|
-
pangea_sdk-6.
|
|
62
|
-
pangea_sdk-6.
|
|
60
|
+
pangea_sdk-6.9.0.dist-info/WHEEL,sha256=M6du7VZflc4UPsGphmOXHANdgk8zessdJG0DBUuoA-U,78
|
|
61
|
+
pangea_sdk-6.9.0.dist-info/METADATA,sha256=1hejXo-areA_pQMUp27BY5bsniOIamx5C3gh8j-hinI,8028
|
|
62
|
+
pangea_sdk-6.9.0.dist-info/RECORD,,
|