pangea-sdk 6.0.0__py3-none-any.whl → 6.2.0b1__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/request.py +153 -19
- pangea/asyncio/services/__init__.py +1 -0
- pangea/asyncio/services/audit.py +300 -1
- pangea/asyncio/services/authn.py +171 -14
- pangea/asyncio/services/authz.py +28 -28
- pangea/asyncio/services/management.py +576 -0
- pangea/asyncio/services/redact.py +265 -4
- pangea/request.py +155 -19
- pangea/services/__init__.py +1 -0
- pangea/services/audit/audit.py +301 -1
- pangea/services/audit/models.py +275 -0
- pangea/services/authn/authn.py +177 -18
- pangea/services/authn/models.py +94 -0
- pangea/services/authz.py +65 -30
- pangea/services/management.py +720 -0
- pangea/services/redact.py +473 -7
- {pangea_sdk-6.0.0.dist-info → pangea_sdk-6.2.0b1.dist-info}/METADATA +3 -3
- {pangea_sdk-6.0.0.dist-info → pangea_sdk-6.2.0b1.dist-info}/RECORD +20 -18
- {pangea_sdk-6.0.0.dist-info → pangea_sdk-6.2.0b1.dist-info}/WHEEL +0 -0
pangea/services/redact.py
CHANGED
@@ -3,12 +3,74 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
5
|
import enum
|
6
|
-
from
|
6
|
+
from collections.abc import Mapping, Sequence
|
7
|
+
from typing import Dict, List, Optional, Union, cast, overload
|
8
|
+
|
9
|
+
from pydantic import Field, TypeAdapter
|
10
|
+
from typing_extensions import Annotated, Literal
|
7
11
|
|
8
12
|
from pangea.config import PangeaConfig
|
9
13
|
from pangea.response import APIRequestModel, APIResponseModel, PangeaResponse, PangeaResponseResult
|
10
14
|
from pangea.services.base import ServiceBase
|
11
15
|
|
16
|
+
MatcherType = Literal[
|
17
|
+
"CREDIT_CARD",
|
18
|
+
"CRYPTO",
|
19
|
+
"DATE_TIME",
|
20
|
+
"EMAIL_ADDRESS",
|
21
|
+
"IBAN_CODE",
|
22
|
+
"IP_ADDRESS",
|
23
|
+
"NRP",
|
24
|
+
"LOCATION",
|
25
|
+
"PERSON",
|
26
|
+
"PHONE_NUMBER",
|
27
|
+
"MEDICAL_LICENSE",
|
28
|
+
"URL",
|
29
|
+
"US_BANK_NUMBER",
|
30
|
+
"US_DRIVER_LICENSE",
|
31
|
+
"US_ITIN",
|
32
|
+
"US_PASSPORT",
|
33
|
+
"US_SSN",
|
34
|
+
"UK_NHS",
|
35
|
+
"NIF",
|
36
|
+
"FIN/NRIC",
|
37
|
+
"AU_ABN",
|
38
|
+
"AU_ACN",
|
39
|
+
"AU_TFN",
|
40
|
+
"AU_MEDICARE",
|
41
|
+
"FIREBASE_URL",
|
42
|
+
"RSA_PRIVATE_KEY",
|
43
|
+
"SSH_DSA_PRIVATE_KEY",
|
44
|
+
"SSH_EC_PRIVATE_KEY",
|
45
|
+
"PGP_PRIVATE_KEY_BLOCK",
|
46
|
+
"AMAZON_AWS_ACCESS_KEY_ID",
|
47
|
+
"AMAZON_AWS_SECRET_ACCESS_KEY",
|
48
|
+
"AMAZON_MWS_AUTH_TOKEN",
|
49
|
+
"FACEBOOK_ACCESS_TOKEN",
|
50
|
+
"GITHUB_ACCESS_TOKEN",
|
51
|
+
"JWT_TOKEN",
|
52
|
+
"GOOGLE_API_KEY",
|
53
|
+
"GOOGLE_CLOUD_PLATFORM_API_KEY",
|
54
|
+
"GOOGLE_DRIVE_API_KEY",
|
55
|
+
"GOOGLE_CLOUD_PLATFORM_SERVICE_ACCOUNT",
|
56
|
+
"GOOGLE_GMAIL_API_KEY",
|
57
|
+
"YOUTUBE_API_KEY",
|
58
|
+
"MAILCHIMP_API_KEY",
|
59
|
+
"MAILGUN_API_KEY",
|
60
|
+
"MONEY",
|
61
|
+
"BASIC_AUTH",
|
62
|
+
"PICATIC_API_KEY",
|
63
|
+
"SLACK_TOKEN",
|
64
|
+
"SLACK_WEBHOOK",
|
65
|
+
"STRIPE_API_KEY",
|
66
|
+
"STRIPE_RESTRICTED_API_KEY",
|
67
|
+
"SQUARE_ACCESS_TOKEN",
|
68
|
+
"SQUARE_OAUTH_SECRET",
|
69
|
+
"TWILIO_API_KEY",
|
70
|
+
"PANGEA_TOKEN",
|
71
|
+
"PROFANITY",
|
72
|
+
]
|
73
|
+
|
12
74
|
|
13
75
|
class RedactFormat(str, enum.Enum):
|
14
76
|
"""Structured data format."""
|
@@ -44,10 +106,10 @@ class PartialMasking(APIRequestModel):
|
|
44
106
|
masked_from_left: Optional[int] = None
|
45
107
|
masked_from_right: Optional[int] = None
|
46
108
|
chars_to_ignore: Optional[List[str]] = None
|
47
|
-
masking_char: Optional[
|
109
|
+
masking_char: Optional[str] = Field(min_length=1, max_length=1)
|
48
110
|
|
49
111
|
|
50
|
-
class
|
112
|
+
class Redaction(APIRequestModel):
|
51
113
|
redaction_type: RedactType
|
52
114
|
hash: Optional[Dict] = None
|
53
115
|
fpe_alphabet: Optional[FPEAlphabet] = None
|
@@ -55,6 +117,10 @@ class RedactionMethodOverrides(APIRequestModel):
|
|
55
117
|
redaction_value: Optional[str] = None
|
56
118
|
|
57
119
|
|
120
|
+
class RedactionMethodOverrides(Redaction):
|
121
|
+
"""This field allows users to specify the redaction method per rule and its various parameters."""
|
122
|
+
|
123
|
+
|
58
124
|
class RedactRequest(APIRequestModel):
|
59
125
|
"""
|
60
126
|
Input class to make a redact request
|
@@ -65,7 +131,7 @@ class RedactRequest(APIRequestModel):
|
|
65
131
|
rules: Optional[List[str]] = None
|
66
132
|
rulesets: Optional[List[str]] = None
|
67
133
|
return_result: Optional[bool] = None
|
68
|
-
redaction_method_overrides: Optional[RedactionMethodOverrides] = None
|
134
|
+
redaction_method_overrides: Optional[Mapping[str, RedactionMethodOverrides]] = None
|
69
135
|
vault_parameters: Optional[VaultParameters] = None
|
70
136
|
llm_request: Optional[bool] = None
|
71
137
|
"""Is this redact call going to be used in an LLM request?"""
|
@@ -146,7 +212,7 @@ class StructuredRequest(APIRequestModel):
|
|
146
212
|
rules: Optional[List[str]] = None
|
147
213
|
rulesets: Optional[List[str]] = None
|
148
214
|
return_result: Optional[bool] = None
|
149
|
-
redaction_method_overrides: Optional[RedactionMethodOverrides] = None
|
215
|
+
redaction_method_overrides: Optional[Mapping[str, RedactionMethodOverrides]] = None
|
150
216
|
vault_parameters: Optional[VaultParameters] = None
|
151
217
|
llm_request: Optional[bool] = None
|
152
218
|
"""Is this redact call going to be used in an LLM request?"""
|
@@ -194,6 +260,145 @@ class UnredactResult(PangeaResponseResult):
|
|
194
260
|
data: RedactedData
|
195
261
|
|
196
262
|
|
263
|
+
class Matcher(APIResponseModel):
|
264
|
+
match_type: str
|
265
|
+
match_value: str
|
266
|
+
match_score: float
|
267
|
+
|
268
|
+
|
269
|
+
class RuleV1(APIResponseModel):
|
270
|
+
entity_name: str
|
271
|
+
matchers: Union[List[Matcher], MatcherType]
|
272
|
+
ruleset: str
|
273
|
+
|
274
|
+
match_threshold: Optional[float] = None
|
275
|
+
context_values: Optional[List[str]] = None
|
276
|
+
name: Optional[str] = None
|
277
|
+
description: Optional[str] = None
|
278
|
+
|
279
|
+
|
280
|
+
class RuleV2(APIResponseModel):
|
281
|
+
entity_name: str
|
282
|
+
matchers: Union[List[Matcher], MatcherType]
|
283
|
+
|
284
|
+
match_threshold: Optional[float] = None
|
285
|
+
context_values: Optional[List[str]] = None
|
286
|
+
negative_context_values: Optional[List[str]] = None
|
287
|
+
name: Optional[str] = None
|
288
|
+
description: Optional[str] = None
|
289
|
+
|
290
|
+
|
291
|
+
class RulesetV1(APIResponseModel):
|
292
|
+
name: Optional[str] = None
|
293
|
+
description: Optional[str] = None
|
294
|
+
rules: List[str]
|
295
|
+
|
296
|
+
|
297
|
+
class RulesetV2(APIResponseModel):
|
298
|
+
name: Optional[str] = None
|
299
|
+
description: Optional[str] = None
|
300
|
+
|
301
|
+
|
302
|
+
class ServiceConfigV1(PangeaResponseResult):
|
303
|
+
version: Literal["1.0.0"] = "1.0.0"
|
304
|
+
id: str
|
305
|
+
name: str
|
306
|
+
updated_at: str
|
307
|
+
enabled_rules: List[str]
|
308
|
+
|
309
|
+
redactions: Optional[Dict[str, Redaction]] = None
|
310
|
+
|
311
|
+
vault_service_config_id: Optional[str] = None
|
312
|
+
"""Service config used to create the secret"""
|
313
|
+
|
314
|
+
salt_vault_secret_id: Optional[str] = None
|
315
|
+
"""Pangea only allows hashing to be done using a salt value to prevent brute-force attacks."""
|
316
|
+
|
317
|
+
rules: Optional[Dict[str, RuleV1]] = None
|
318
|
+
rulesets: Optional[Dict[str, RulesetV1]] = None
|
319
|
+
supported_languages: Optional[List[Literal["en"]]] = None
|
320
|
+
|
321
|
+
|
322
|
+
class ServiceConfigV2(PangeaResponseResult):
|
323
|
+
version: Literal["2.0.0"] = "2.0.0"
|
324
|
+
id: str
|
325
|
+
name: str
|
326
|
+
updated_at: str
|
327
|
+
enabled_rules: List[str]
|
328
|
+
|
329
|
+
enforce_enabled_rules: Optional[bool] = None
|
330
|
+
"""Always run service config enabled rules across all redact calls regardless of flags?"""
|
331
|
+
|
332
|
+
redactions: Optional[Dict[str, Redaction]] = None
|
333
|
+
|
334
|
+
vault_service_config_id: Optional[str] = None
|
335
|
+
"""Service config used to create the secret"""
|
336
|
+
|
337
|
+
salt_vault_secret_id: Optional[str] = None
|
338
|
+
"""Pangea only allows hashing to be done using a salt value to prevent brute-force attacks."""
|
339
|
+
|
340
|
+
fpe_vault_secret_id: Optional[str] = None
|
341
|
+
"""The ID of the key used by FF3 Encryption algorithms for FPE."""
|
342
|
+
|
343
|
+
rules: Optional[Dict[str, RuleV2]] = None
|
344
|
+
rulesets: Optional[Dict[str, RulesetV2]] = None
|
345
|
+
supported_languages: Optional[List[Literal["en"]]] = None
|
346
|
+
|
347
|
+
|
348
|
+
ServiceConfigResult = Annotated[Union[ServiceConfigV1, ServiceConfigV2], Field(discriminator="version")]
|
349
|
+
|
350
|
+
|
351
|
+
class ServiceConfigFilter(APIRequestModel):
|
352
|
+
id: Optional[str] = None
|
353
|
+
"""Only records where id equals this value."""
|
354
|
+
|
355
|
+
id__contains: Optional[Sequence[str]] = None
|
356
|
+
"""Only records where id includes each substring."""
|
357
|
+
|
358
|
+
id__in: Optional[Sequence[str]] = None
|
359
|
+
"""Only records where id equals one of the provided substrings."""
|
360
|
+
|
361
|
+
created_at: Optional[str] = None
|
362
|
+
"""Only records where created_at equals this value."""
|
363
|
+
|
364
|
+
created_at__gt: Optional[str] = None
|
365
|
+
"""Only records where created_at is greater than this value."""
|
366
|
+
|
367
|
+
created_at__gte: Optional[str] = None
|
368
|
+
"""Only records where created_at is greater than or equal to this value."""
|
369
|
+
|
370
|
+
created_at__lt: Optional[str] = None
|
371
|
+
"""Only records where created_at is less than this value."""
|
372
|
+
|
373
|
+
created_at__lte: Optional[str] = None
|
374
|
+
"""Only records where created_at is less than or equal to this value."""
|
375
|
+
|
376
|
+
updated_at: Optional[str] = None
|
377
|
+
"""Only records where updated_at equals this value."""
|
378
|
+
|
379
|
+
updated_at__gt: Optional[str] = None
|
380
|
+
"""Only records where updated_at is greater than this value."""
|
381
|
+
|
382
|
+
updated_at__gte: Optional[str] = None
|
383
|
+
"""Only records where updated_at is greater than or equal to this value."""
|
384
|
+
|
385
|
+
updated_at__lt: Optional[str] = None
|
386
|
+
"""Only records where updated_at is less than this value."""
|
387
|
+
|
388
|
+
updated_at__lte: Optional[str] = None
|
389
|
+
"""Only records where updated_at is less than or equal to this value."""
|
390
|
+
|
391
|
+
|
392
|
+
class ServiceConfigListResult(PangeaResponseResult):
|
393
|
+
count: int
|
394
|
+
"""The total number of service configs matched by the list request."""
|
395
|
+
|
396
|
+
last: str
|
397
|
+
"""Used to fetch the next page of the current listing when provided in a repeated request's last parameter."""
|
398
|
+
|
399
|
+
items: Sequence[ServiceConfigResult]
|
400
|
+
|
401
|
+
|
197
402
|
class Redact(ServiceBase):
|
198
403
|
"""Redact service client.
|
199
404
|
|
@@ -248,7 +453,7 @@ class Redact(ServiceBase):
|
|
248
453
|
rules: Optional[List[str]] = None,
|
249
454
|
rulesets: Optional[List[str]] = None,
|
250
455
|
return_result: Optional[bool] = None,
|
251
|
-
redaction_method_overrides: Optional[RedactionMethodOverrides] = None,
|
456
|
+
redaction_method_overrides: Optional[Mapping[str, RedactionMethodOverrides]] = None,
|
252
457
|
llm_request: Optional[bool] = None,
|
253
458
|
vault_parameters: Optional[VaultParameters] = None,
|
254
459
|
) -> PangeaResponse[RedactResult]:
|
@@ -303,7 +508,7 @@ class Redact(ServiceBase):
|
|
303
508
|
rules: Optional[List[str]] = None,
|
304
509
|
rulesets: Optional[List[str]] = None,
|
305
510
|
return_result: Optional[bool] = None,
|
306
|
-
redaction_method_overrides:
|
511
|
+
redaction_method_overrides: Mapping[str, RedactionMethodOverrides] | None = None,
|
307
512
|
llm_request: Optional[bool] = None,
|
308
513
|
vault_parameters: Optional[VaultParameters] = None,
|
309
514
|
) -> PangeaResponse[StructuredResult]:
|
@@ -382,3 +587,264 @@ class Redact(ServiceBase):
|
|
382
587
|
"""
|
383
588
|
input = UnredactRequest(redacted_data=redacted_data, fpe_context=fpe_context)
|
384
589
|
return self.request.post("v1/unredact", UnredactResult, data=input.model_dump(exclude_none=True))
|
590
|
+
|
591
|
+
def get_service_config(self, config_id: str) -> PangeaResponse[ServiceConfigResult]:
|
592
|
+
"""
|
593
|
+
Get a service config.
|
594
|
+
|
595
|
+
|
596
|
+
OperationId: redact_post_v1beta_config
|
597
|
+
"""
|
598
|
+
response = self.request.post("v1beta/config", PangeaResponseResult, data={"id": config_id})
|
599
|
+
response.result = TypeAdapter(ServiceConfigResult).validate_python(response.json["result"])
|
600
|
+
return cast(PangeaResponse[ServiceConfigResult], response)
|
601
|
+
|
602
|
+
@overload
|
603
|
+
def create_service_config(
|
604
|
+
self,
|
605
|
+
name: str,
|
606
|
+
*,
|
607
|
+
version: Literal["1.0.0"],
|
608
|
+
enabled_rules: Sequence[str] | None = None,
|
609
|
+
redactions: Mapping[str, Redaction] | None = None,
|
610
|
+
vault_service_config_id: str | None = None,
|
611
|
+
salt_vault_secret_id: str | None = None,
|
612
|
+
rules: Mapping[str, RuleV1] | None = None,
|
613
|
+
rulesets: Mapping[str, RulesetV1] | None = None,
|
614
|
+
supported_languages: Sequence[Literal["en"]] | None = None,
|
615
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
616
|
+
"""
|
617
|
+
Create a v1.0.0 service config.
|
618
|
+
|
619
|
+
OperationId: redact_post_v1beta_config_create
|
620
|
+
|
621
|
+
Args:
|
622
|
+
vault_service_config_id: Service config used to create the secret
|
623
|
+
salt_vault_secret_id: Pangea only allows hashing to be done using a salt value to prevent brute-force attacks.
|
624
|
+
"""
|
625
|
+
|
626
|
+
@overload
|
627
|
+
def create_service_config(
|
628
|
+
self,
|
629
|
+
name: str,
|
630
|
+
*,
|
631
|
+
version: Literal["2.0.0"] | None = None,
|
632
|
+
enabled_rules: Sequence[str] | None = None,
|
633
|
+
enforce_enabled_rules: bool | None = None,
|
634
|
+
redactions: Mapping[str, Redaction] | None = None,
|
635
|
+
vault_service_config_id: str | None = None,
|
636
|
+
salt_vault_secret_id: str | None = None,
|
637
|
+
fpe_vault_secret_id: str | None = None,
|
638
|
+
rules: Mapping[str, RuleV2] | None = None,
|
639
|
+
rulesets: Mapping[str, RulesetV2] | None = None,
|
640
|
+
supported_languages: Sequence[Literal["en"]] | None = None,
|
641
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
642
|
+
"""
|
643
|
+
Create a v2.0.0 service config.
|
644
|
+
|
645
|
+
OperationId: redact_post_v1beta_config_create
|
646
|
+
|
647
|
+
Args:
|
648
|
+
enforce_enabled_rules: Always run service config enabled rules across all redact calls regardless of flags?
|
649
|
+
vault_service_config_id: Service config used to create the secret
|
650
|
+
salt_vault_secret_id: Pangea only allows hashing to be done using a salt value to prevent brute-force attacks.
|
651
|
+
fpe_vault_secret_id: The ID of the key used by FF3 Encryption algorithms for FPE.
|
652
|
+
"""
|
653
|
+
|
654
|
+
def create_service_config(
|
655
|
+
self,
|
656
|
+
name: str,
|
657
|
+
*,
|
658
|
+
version: Literal["1.0.0", "2.0.0"] | None = None,
|
659
|
+
enabled_rules: Sequence[str] | None = None,
|
660
|
+
enforce_enabled_rules: bool | None = None,
|
661
|
+
fpe_vault_secret_id: str | None = None,
|
662
|
+
redactions: Mapping[str, Redaction] | None = None,
|
663
|
+
rules: Mapping[str, RuleV1 | RuleV2] | None = None,
|
664
|
+
rulesets: Mapping[str, RulesetV1 | RulesetV2] | None = None,
|
665
|
+
salt_vault_secret_id: str | None = None,
|
666
|
+
supported_languages: Sequence[Literal["en"]] | None = None,
|
667
|
+
vault_service_config_id: str | None = None,
|
668
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
669
|
+
"""
|
670
|
+
Create a service config.
|
671
|
+
|
672
|
+
OperationId: redact_post_v1beta_config_create
|
673
|
+
|
674
|
+
Args:
|
675
|
+
enforce_enabled_rules: Always run service config enabled rules across all redact calls regardless of flags?
|
676
|
+
fpe_vault_secret_id: The ID of the key used by FF3 Encryption algorithms for FPE.
|
677
|
+
salt_vault_secret_id: Pangea only allows hashing to be done using a salt value to prevent brute-force attacks.
|
678
|
+
vault_service_config_id: Service config used to create the secret
|
679
|
+
"""
|
680
|
+
|
681
|
+
response = self.request.post(
|
682
|
+
"v1beta/config/create",
|
683
|
+
PangeaResponseResult,
|
684
|
+
data={
|
685
|
+
"name": name,
|
686
|
+
"version": version,
|
687
|
+
"enabled_rules": enabled_rules,
|
688
|
+
"enforce_enabled_rules": enforce_enabled_rules,
|
689
|
+
"fpe_vault_secret_id": fpe_vault_secret_id,
|
690
|
+
"redactions": redactions,
|
691
|
+
"rules": rules,
|
692
|
+
"rulesets": rulesets,
|
693
|
+
"salt_vault_secret_id": salt_vault_secret_id,
|
694
|
+
"supported_languages": supported_languages,
|
695
|
+
"vault_service_config_id": vault_service_config_id,
|
696
|
+
},
|
697
|
+
)
|
698
|
+
response.result = TypeAdapter(ServiceConfigResult).validate_python(response.json["result"])
|
699
|
+
return cast(PangeaResponse[ServiceConfigResult], response)
|
700
|
+
|
701
|
+
@overload
|
702
|
+
def update_service_config(
|
703
|
+
self,
|
704
|
+
config_id: str,
|
705
|
+
*,
|
706
|
+
version: Literal["1.0.0"],
|
707
|
+
name: str,
|
708
|
+
updated_at: str,
|
709
|
+
enabled_rules: Sequence[str] | None = None,
|
710
|
+
redactions: Mapping[str, Redaction] | None = None,
|
711
|
+
vault_service_config_id: str | None = None,
|
712
|
+
salt_vault_secret_id: str | None = None,
|
713
|
+
rules: Mapping[str, RuleV1] | None = None,
|
714
|
+
rulesets: Mapping[str, RulesetV1] | None = None,
|
715
|
+
supported_languages: Sequence[Literal["en"]] | None = None,
|
716
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
717
|
+
"""
|
718
|
+
Update a v1.0.0 service config.
|
719
|
+
|
720
|
+
OperationId: redact_post_v1beta_config_update
|
721
|
+
|
722
|
+
Args:
|
723
|
+
vault_service_config_id: Service config used to create the secret
|
724
|
+
salt_vault_secret_id: Pangea only allows hashing to be done using a salt value to prevent brute-force attacks.
|
725
|
+
"""
|
726
|
+
|
727
|
+
@overload
|
728
|
+
def update_service_config(
|
729
|
+
self,
|
730
|
+
config_id: str,
|
731
|
+
*,
|
732
|
+
version: Literal["2.0.0"] | None = None,
|
733
|
+
name: str,
|
734
|
+
updated_at: str,
|
735
|
+
enabled_rules: Sequence[str] | None = None,
|
736
|
+
enforce_enabled_rules: bool | None = None,
|
737
|
+
redactions: Mapping[str, Redaction] | None = None,
|
738
|
+
vault_service_config_id: str | None = None,
|
739
|
+
salt_vault_secret_id: str | None = None,
|
740
|
+
fpe_vault_secret_id: str | None = None,
|
741
|
+
rules: Mapping[str, RuleV2] | None = None,
|
742
|
+
rulesets: Mapping[str, RulesetV2] | None = None,
|
743
|
+
supported_languages: Sequence[Literal["en"]] | None = None,
|
744
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
745
|
+
"""
|
746
|
+
Update a v2.0.0 service config.
|
747
|
+
|
748
|
+
OperationId: redact_post_v1beta_config_update
|
749
|
+
|
750
|
+
Args:
|
751
|
+
enforce_enabled_rules: Always run service config enabled rules across all redact calls regardless of flags?
|
752
|
+
vault_service_config_id: Service config used to create the secret
|
753
|
+
salt_vault_secret_id: Pangea only allows hashing to be done using a salt value to prevent brute-force attacks.
|
754
|
+
fpe_vault_secret_id: The ID of the key used by FF3 Encryption algorithms for FPE.
|
755
|
+
"""
|
756
|
+
|
757
|
+
def update_service_config(
|
758
|
+
self,
|
759
|
+
config_id: str,
|
760
|
+
*,
|
761
|
+
version: Literal["1.0.0", "2.0.0"] | None = None,
|
762
|
+
name: str,
|
763
|
+
updated_at: str,
|
764
|
+
enabled_rules: Sequence[str] | None = None,
|
765
|
+
enforce_enabled_rules: bool | None = None,
|
766
|
+
fpe_vault_secret_id: str | None = None,
|
767
|
+
redactions: Mapping[str, Redaction] | None = None,
|
768
|
+
rules: Mapping[str, RuleV1 | RuleV2] | None = None,
|
769
|
+
rulesets: Mapping[str, RulesetV1 | RulesetV2] | None = None,
|
770
|
+
salt_vault_secret_id: str | None = None,
|
771
|
+
supported_languages: Sequence[Literal["en"]] | None = None,
|
772
|
+
vault_service_config_id: str | None = None,
|
773
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
774
|
+
"""
|
775
|
+
Update a service config.
|
776
|
+
|
777
|
+
OperationId: redact_post_v1beta_config_update
|
778
|
+
|
779
|
+
Args:
|
780
|
+
enforce_enabled_rules: Always run service config enabled rules across all redact calls regardless of flags?
|
781
|
+
fpe_vault_secret_id: The ID of the key used by FF3 Encryption algorithms for FPE.
|
782
|
+
salt_vault_secret_id: Pangea only allows hashing to be done using a salt value to prevent brute-force attacks.
|
783
|
+
vault_service_config_id: Service config used to create the secret
|
784
|
+
"""
|
785
|
+
|
786
|
+
response = self.request.post(
|
787
|
+
"v1beta/config/update",
|
788
|
+
PangeaResponseResult,
|
789
|
+
data={
|
790
|
+
"id": config_id,
|
791
|
+
"updated_at": updated_at,
|
792
|
+
"name": name,
|
793
|
+
"version": version,
|
794
|
+
"enabled_rules": enabled_rules,
|
795
|
+
"enforce_enabled_rules": enforce_enabled_rules,
|
796
|
+
"fpe_vault_secret_id": fpe_vault_secret_id,
|
797
|
+
"redactions": redactions,
|
798
|
+
"rules": rules,
|
799
|
+
"rulesets": rulesets,
|
800
|
+
"salt_vault_secret_id": salt_vault_secret_id,
|
801
|
+
"supported_languages": supported_languages,
|
802
|
+
"vault_service_config_id": vault_service_config_id,
|
803
|
+
},
|
804
|
+
)
|
805
|
+
response.result = TypeAdapter(ServiceConfigResult).validate_python(response.json["result"])
|
806
|
+
return cast(PangeaResponse[ServiceConfigResult], response)
|
807
|
+
|
808
|
+
def delete_service_config(
|
809
|
+
self,
|
810
|
+
config_id: str,
|
811
|
+
) -> PangeaResponse[ServiceConfigResult]:
|
812
|
+
"""
|
813
|
+
Delete a service config.
|
814
|
+
|
815
|
+
OperationId: redact_post_v1beta_config_delete
|
816
|
+
|
817
|
+
Args:
|
818
|
+
config_id: An ID for a service config
|
819
|
+
"""
|
820
|
+
|
821
|
+
response = self.request.post("v1beta/config/delete", PangeaResponseResult, data={"id": config_id})
|
822
|
+
response.result = TypeAdapter(ServiceConfigResult).validate_python(response.json["result"])
|
823
|
+
return cast(PangeaResponse[ServiceConfigResult], response)
|
824
|
+
|
825
|
+
def list_service_configs(
|
826
|
+
self,
|
827
|
+
*,
|
828
|
+
filter: ServiceConfigFilter | None = None,
|
829
|
+
last: str | None = None,
|
830
|
+
order: Literal["asc", "desc"] | None = None,
|
831
|
+
order_by: Literal["id", "created_at", "updated_at"] | None = None,
|
832
|
+
size: int | None = None,
|
833
|
+
) -> PangeaResponse[ServiceConfigListResult]:
|
834
|
+
"""
|
835
|
+
List service configs.
|
836
|
+
|
837
|
+
OperationId: redact_post_v1beta_config_list
|
838
|
+
|
839
|
+
Args:
|
840
|
+
last: Reflected value from a previous response to obtain the next page of results.
|
841
|
+
order: Order results asc(ending) or desc(ending).
|
842
|
+
order_by: Which field to order results by.
|
843
|
+
size: Maximum results to include in the response.
|
844
|
+
"""
|
845
|
+
|
846
|
+
return self.request.post(
|
847
|
+
"v1beta/config/list",
|
848
|
+
ServiceConfigListResult,
|
849
|
+
data={"filter": filter, "last": last, "order": order, "order_by": order_by, "size": size},
|
850
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: pangea-sdk
|
3
|
-
Version: 6.
|
3
|
+
Version: 6.2.0b1
|
4
4
|
Summary: Pangea API SDK
|
5
5
|
License: MIT
|
6
6
|
Keywords: Pangea,SDK,Audit
|
@@ -63,13 +63,13 @@ the same compatibility guarantees as stable releases.
|
|
63
63
|
Via pip:
|
64
64
|
|
65
65
|
```bash
|
66
|
-
$ pip3 install pangea-sdk==
|
66
|
+
$ pip3 install pangea-sdk==6.2.0b1
|
67
67
|
```
|
68
68
|
|
69
69
|
Via poetry:
|
70
70
|
|
71
71
|
```bash
|
72
|
-
$ poetry add pangea-sdk==
|
72
|
+
$ poetry add pangea-sdk==6.2.0b1
|
73
73
|
```
|
74
74
|
|
75
75
|
## Usage
|
@@ -1,18 +1,19 @@
|
|
1
|
-
pangea/__init__.py,sha256=
|
1
|
+
pangea/__init__.py,sha256=vCfs9LnF22OLuxPtJHmvbHt5RJojJnj9kgt-6FsSuCM,251
|
2
2
|
pangea/asyncio/__init__.py,sha256=kjEMkqMQ521LlMSu5jn3_WgweyArwVZ2C-s3x7mR6Pk,45
|
3
3
|
pangea/asyncio/file_uploader.py,sha256=wI7epib7Rc5jtZw4eJ1L1SlmutDG6CPv59C8N2UPhtY,1436
|
4
|
-
pangea/asyncio/request.py,sha256=
|
5
|
-
pangea/asyncio/services/__init__.py,sha256=
|
4
|
+
pangea/asyncio/request.py,sha256=bzddGHmWWPvgK3-5ZYHCQaniZvNcjMtLyAQzJm_AJdk,22085
|
5
|
+
pangea/asyncio/services/__init__.py,sha256=hhe8fKek1qFMdTaj48_RRj-tnxncu7Bd-CojJsPcaGM,504
|
6
6
|
pangea/asyncio/services/ai_guard.py,sha256=rFksT8LQkyioW3QOq4fLCEZbW5SXiYWpWjLbVovRouE,6294
|
7
|
-
pangea/asyncio/services/audit.py,sha256=
|
8
|
-
pangea/asyncio/services/authn.py,sha256=
|
9
|
-
pangea/asyncio/services/authz.py,sha256=
|
7
|
+
pangea/asyncio/services/audit.py,sha256=Vk18Y74zRcdE-sq0dvM8_mnsZL3b0iewel7KQdBgkj8,39299
|
8
|
+
pangea/asyncio/services/authn.py,sha256=apa0kcxmSXH2ChJbTYVFvXTB4cn69cN9O7tW_jOXy_w,52100
|
9
|
+
pangea/asyncio/services/authz.py,sha256=ocImj2g-P9wAo6CqAvZs7YR4wOTUAx0ZWmenKh6HwLk,9691
|
10
10
|
pangea/asyncio/services/base.py,sha256=vRFVcO_uEAGJte3OUUBLD43RoiiFB1vC7SPyN6yEMoA,3158
|
11
11
|
pangea/asyncio/services/embargo.py,sha256=ctzj3kip6xos-Eu3JuOskrCGYC8T3JlsgAopZHiPSXM,3068
|
12
12
|
pangea/asyncio/services/file_scan.py,sha256=PLG1O-PL4Yk9uY9D6NbMrZ5LHg70Z311s7bFe46UMZA,7108
|
13
13
|
pangea/asyncio/services/intel.py,sha256=BcxGKSoZ1nJiEHyZM9yOwKSSPJUrB6ibJ19KR27VlgQ,40261
|
14
|
+
pangea/asyncio/services/management.py,sha256=YRAN5nkWhr1ahhVKtRuCYE0u0lEUD00EVSmTOmoAILc,20551
|
14
15
|
pangea/asyncio/services/prompt_guard.py,sha256=NbYt-0tRtO5VH7kLmC1lJ5JSV-ztlb9dNFaKKs_fZUM,2553
|
15
|
-
pangea/asyncio/services/redact.py,sha256=
|
16
|
+
pangea/asyncio/services/redact.py,sha256=bCKs5Mu0Cvyv1w0YzIzDDW7N3B1ZgxmytAhFQOXyUi8,18869
|
16
17
|
pangea/asyncio/services/sanitize.py,sha256=EbSdq_v9yZWce9xEYWvZharE9bJcxw8cg5Pv8LVxdxc,8627
|
17
18
|
pangea/asyncio/services/share.py,sha256=Qd2Oh4UsLwu7Zo4Xy1KABHuP4TJ9AtcN-XzldvilFVo,30773
|
18
19
|
pangea/asyncio/services/vault.py,sha256=VqrJGSEdq6MlZRI6cJpkthhIsqLClSQdgVxwYCbIwEk,77079
|
@@ -25,24 +26,25 @@ pangea/dump_audit.py,sha256=IevqaUUh7GDepdIW7slSxeZbkPrWIVbcX3sr4DgpJXI,7090
|
|
25
26
|
pangea/exceptions.py,sha256=OBtzUECpNa6vNp8ySkHC-tm4QjFRCOAHBkMHqzAlOu8,5656
|
26
27
|
pangea/file_uploader.py,sha256=4RQ44xt-faApC61nn2PlwHT7XYrJ4GeQA8Ug4tySEAg,1227
|
27
28
|
pangea/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
-
pangea/request.py,sha256=
|
29
|
+
pangea/request.py,sha256=GfrasFmx2vgYIkAXQ9nSbU6ZHSGJs1wwelUP9LTYwYI,28775
|
29
30
|
pangea/response.py,sha256=lPAcYsF9Xg166CiyhCofVmQA-W4jevh0MQXxUa8Re68,7737
|
30
|
-
pangea/services/__init__.py,sha256=
|
31
|
+
pangea/services/__init__.py,sha256=gx97luYBNJycS8CSsOge_kSeNyUDUOFeCM9ezpWDvxA,443
|
31
32
|
pangea/services/ai_guard.py,sha256=X1DR1JTYZnLqBFFAHgmRk4xqyGF3GQMO1B3_cqLLVfU,15774
|
32
|
-
pangea/services/audit/audit.py,sha256=
|
33
|
+
pangea/services/audit/audit.py,sha256=EOQPYL9C--c4S7EB4wDkhBnU15g7bAzREjX-rIHry6c,52288
|
33
34
|
pangea/services/audit/exceptions.py,sha256=bhVuYe4ammacOVxwg98CChxvwZf5FKgR2DcgqILOcwc,471
|
34
|
-
pangea/services/audit/models.py,sha256=
|
35
|
+
pangea/services/audit/models.py,sha256=FD-F_NR-2qXyQ2xmXmaipNTCK8fSsG1KHk5AEHgRje4,23923
|
35
36
|
pangea/services/audit/signing.py,sha256=5A4hvPtpfP2kMz8bsiiKUACriXbh5dv9gb_rbqiUtuI,5583
|
36
37
|
pangea/services/audit/util.py,sha256=Zq1qvfeplYfhCP_ud5YMvntSB0UvnCdsuYbOzZkHbjg,7620
|
37
|
-
pangea/services/authn/authn.py,sha256=
|
38
|
-
pangea/services/authn/models.py,sha256=
|
39
|
-
pangea/services/authz.py,sha256=
|
38
|
+
pangea/services/authn/authn.py,sha256=AkGyjGz5eHpMkxMn0F-xP94DCV7Ai88yaI4pSqAQ_qc,51021
|
39
|
+
pangea/services/authn/models.py,sha256=EOoseAWVhr7Gy2HHqxqtvyUNimoi6OVc-x9OMxEeRX8,25253
|
40
|
+
pangea/services/authz.py,sha256=fOPucOMdoYee5B4FXYgM8d6HHUeGg8QwiyTfKcD1JCk,14581
|
40
41
|
pangea/services/base.py,sha256=43pWQcR9CeT4sGzgctF3Sy4M_h7DaUzkuZD2Z7CcDUU,3845
|
41
42
|
pangea/services/embargo.py,sha256=9Wfku4td5ORaIENKmnGmS5jxJJIRfWp6Q51L36Jsy0I,3897
|
42
43
|
pangea/services/file_scan.py,sha256=QiO80uKqB_BnAOiYQKznXfxpa5j40qqETE3-zBRT_QE,7813
|
43
44
|
pangea/services/intel.py,sha256=y1EX2ctYIxQc52lmHp6-Q_UIDM--t3fOpXDssWiRPfo,56474
|
45
|
+
pangea/services/management.py,sha256=yquxNfV-24S1vPqJLoZX73GgjFhY-W7jOc5spG76BtA,24102
|
44
46
|
pangea/services/prompt_guard.py,sha256=Cq8ume2_YPfHre4iN6FYkyTV7NrdwLXlr_wnilfKotE,3446
|
45
|
-
pangea/services/redact.py,sha256=
|
47
|
+
pangea/services/redact.py,sha256=8YHKGA6gqfHCZZ9H1A2-toxMZAa4bh6_KDemAuGczso,29678
|
46
48
|
pangea/services/sanitize.py,sha256=eAN1HhObiKqygy6HHcfl0NmxYfPMvqSKepwEAVVIIEE,12936
|
47
49
|
pangea/services/share/file_format.py,sha256=1svO1ee_aenA9zoO_AaU-Rk5Ulp7kcPOc_KwNoluyQE,2797
|
48
50
|
pangea/services/share/share.py,sha256=hlhkIr6ScJ5oMFUs9no4HtHNoUEbYU4KoLkiGLxex30,52343
|
@@ -55,6 +57,6 @@ pangea/services/vault/vault.py,sha256=ow-Zm7PYzfWIfUcA4UNnpeL2DHfZM4C7inRDmNR3zQ
|
|
55
57
|
pangea/tools.py,sha256=icHduOfZLi02UYdGb5Xl1fQqu-PBRB4tiDPT_nL2Q8E,6380
|
56
58
|
pangea/utils.py,sha256=dZ6MwFVEWXUgXvvDg-k6JnvVfsgslvtaBd7ez7afrqk,4983
|
57
59
|
pangea/verify_audit.py,sha256=nSP17OzoSPdvezRExwfcf45H8ZPZnxZu-CbEp3qFJO0,17354
|
58
|
-
pangea_sdk-6.
|
59
|
-
pangea_sdk-6.
|
60
|
-
pangea_sdk-6.
|
60
|
+
pangea_sdk-6.2.0b1.dist-info/METADATA,sha256=DtZ8uh9YUCJRHe28O1LUtX0AKno7se5VGW-UvN5v2Hc,6888
|
61
|
+
pangea_sdk-6.2.0b1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
62
|
+
pangea_sdk-6.2.0b1.dist-info/RECORD,,
|
File without changes
|