pangea-sdk 4.1.0__py3-none-any.whl → 4.2.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/authn.py +20 -1
- pangea/services/authn/authn.py +24 -5
- pangea/services/authn/models.py +85 -13
- {pangea_sdk-4.1.0.dist-info → pangea_sdk-4.2.0.dist-info}/METADATA +2 -2
- {pangea_sdk-4.1.0.dist-info → pangea_sdk-4.2.0.dist-info}/RECORD +7 -7
- {pangea_sdk-4.1.0.dist-info → pangea_sdk-4.2.0.dist-info}/WHEEL +0 -0
pangea/__init__.py
CHANGED
pangea/asyncio/services/authn.py
CHANGED
@@ -7,7 +7,7 @@ from typing import Dict, List, Optional, Union
|
|
7
7
|
import pangea.services.authn.models as m
|
8
8
|
from pangea.asyncio.services.base import ServiceBaseAsync
|
9
9
|
from pangea.config import PangeaConfig
|
10
|
-
from pangea.response import PangeaResponse
|
10
|
+
from pangea.response import PangeaResponse, PangeaResponseResult
|
11
11
|
|
12
12
|
SERVICE_NAME = "authn"
|
13
13
|
|
@@ -399,6 +399,25 @@ class AuthNAsync(ServiceBaseAsync):
|
|
399
399
|
"v2/client/password/change", m.ClientPasswordChangeResult, data=input.model_dump(exclude_none=True)
|
400
400
|
)
|
401
401
|
|
402
|
+
async def expire(self, user_id: str) -> PangeaResponse[PangeaResponseResult]:
|
403
|
+
"""
|
404
|
+
Expire a user's password
|
405
|
+
|
406
|
+
Expire a user's password.
|
407
|
+
|
408
|
+
OperationId: authn_post_v2_user_password_expire
|
409
|
+
|
410
|
+
Args:
|
411
|
+
user_id: The identity of a user or a service.
|
412
|
+
|
413
|
+
Returns:
|
414
|
+
A PangeaResponse with an empty object in the response.result field.
|
415
|
+
|
416
|
+
Examples:
|
417
|
+
await authn.client.password.expire("pui_[...]")
|
418
|
+
"""
|
419
|
+
return await self.request.post("v2/user/password/expire", PangeaResponseResult, {"id": user_id})
|
420
|
+
|
402
421
|
class TokenAsync(ServiceBaseAsync):
|
403
422
|
service_name = SERVICE_NAME
|
404
423
|
|
pangea/services/authn/authn.py
CHANGED
@@ -6,7 +6,7 @@ from typing import Dict, List, Optional, Union
|
|
6
6
|
|
7
7
|
import pangea.services.authn.models as m
|
8
8
|
from pangea.config import PangeaConfig
|
9
|
-
from pangea.response import PangeaResponse
|
9
|
+
from pangea.response import PangeaResponse, PangeaResponseResult
|
10
10
|
from pangea.services.base import ServiceBase
|
11
11
|
|
12
12
|
SERVICE_NAME = "authn"
|
@@ -363,10 +363,10 @@ class AuthN(ServiceBase):
|
|
363
363
|
|
364
364
|
def __init__(
|
365
365
|
self,
|
366
|
-
token,
|
367
|
-
config=None,
|
368
|
-
logger_name="pangea",
|
369
|
-
):
|
366
|
+
token: str,
|
367
|
+
config: PangeaConfig | None = None,
|
368
|
+
logger_name: str = "pangea",
|
369
|
+
) -> None:
|
370
370
|
super().__init__(token, config, logger_name=logger_name)
|
371
371
|
|
372
372
|
def change(
|
@@ -399,6 +399,25 @@ class AuthN(ServiceBase):
|
|
399
399
|
"v2/client/password/change", m.ClientPasswordChangeResult, data=input.model_dump(exclude_none=True)
|
400
400
|
)
|
401
401
|
|
402
|
+
def expire(self, user_id: str) -> PangeaResponse[PangeaResponseResult]:
|
403
|
+
"""
|
404
|
+
Expire a user's password
|
405
|
+
|
406
|
+
Expire a user's password.
|
407
|
+
|
408
|
+
OperationId: authn_post_v2_user_password_expire
|
409
|
+
|
410
|
+
Args:
|
411
|
+
user_id: The identity of a user or a service.
|
412
|
+
|
413
|
+
Returns:
|
414
|
+
A PangeaResponse with an empty object in the response.result field.
|
415
|
+
|
416
|
+
Examples:
|
417
|
+
authn.client.password.expire("pui_[...]")
|
418
|
+
"""
|
419
|
+
return self.request.post("v2/user/password/expire", PangeaResponseResult, {"id": user_id})
|
420
|
+
|
402
421
|
class Token(ServiceBase):
|
403
422
|
service_name = SERVICE_NAME
|
404
423
|
|
pangea/services/authn/models.py
CHANGED
@@ -5,22 +5,62 @@ from __future__ import annotations
|
|
5
5
|
|
6
6
|
import enum
|
7
7
|
from typing import Dict, List, NewType, Optional, Union
|
8
|
+
from warnings import warn
|
8
9
|
|
9
|
-
from
|
10
|
+
from typing_extensions import deprecated
|
10
11
|
|
11
12
|
import pangea.services.intel as im
|
13
|
+
from pangea.deprecated import pangea_deprecated
|
12
14
|
from pangea.response import APIRequestModel, APIResponseModel, PangeaResponseResult
|
13
15
|
from pangea.services.vault.models.common import JWK, JWKec, JWKrsa
|
14
16
|
|
15
17
|
Scopes = NewType("Scopes", List[str])
|
16
18
|
|
17
19
|
|
18
|
-
class Profile(
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
class Profile(Dict[str, str]):
|
21
|
+
@property
|
22
|
+
def first_name(self) -> str:
|
23
|
+
warn(
|
24
|
+
'`Profile.first_name` is deprecated. Use `Profile["first_name"]` instead.', DeprecationWarning, stacklevel=2
|
25
|
+
)
|
26
|
+
return self["first_name"]
|
27
|
+
|
28
|
+
@first_name.setter
|
29
|
+
def first_name(self, value: str) -> None:
|
30
|
+
warn(
|
31
|
+
'`Profile.first_name` is deprecated. Use `Profile["first_name"]` instead.', DeprecationWarning, stacklevel=2
|
32
|
+
)
|
33
|
+
self["first_name"] = value
|
34
|
+
|
35
|
+
@property
|
36
|
+
def last_name(self) -> str:
|
37
|
+
warn('`Profile.last_name` is deprecated. Use `Profile["last_name"]` instead.', DeprecationWarning, stacklevel=2)
|
38
|
+
return self["last_name"]
|
39
|
+
|
40
|
+
@last_name.setter
|
41
|
+
def last_name(self, value: str) -> None:
|
42
|
+
warn('`Profile.last_name` is deprecated. Use `Profile["last_name"]` instead.', DeprecationWarning, stacklevel=2)
|
43
|
+
self["last_name"] = value
|
44
|
+
|
45
|
+
@property
|
46
|
+
def phone(self) -> str:
|
47
|
+
warn('`Profile.phone` is deprecated. Use `Profile["phone"]` instead.', DeprecationWarning, stacklevel=2)
|
48
|
+
return self["phone"]
|
49
|
+
|
50
|
+
@phone.setter
|
51
|
+
def phone(self, value: str) -> None:
|
52
|
+
warn('`Profile.phone` is deprecated. Use `Profile["phone"]` instead.', DeprecationWarning, stacklevel=2)
|
53
|
+
self["phone"] = value
|
54
|
+
|
55
|
+
@deprecated("`Profile.model_dump()` is deprecated. `Profile` is already a `dict[str, str]`.")
|
56
|
+
@pangea_deprecated(reason="`Profile` is already a `dict[str, str]`.")
|
57
|
+
def model_dump(self, *, exclude_none: bool = False) -> dict[str, str]:
|
58
|
+
warn(
|
59
|
+
"`Profile.model_dump()` is deprecated. `Profile` is already a `dict[str, str]`.",
|
60
|
+
DeprecationWarning,
|
61
|
+
stacklevel=2,
|
62
|
+
)
|
63
|
+
return self
|
24
64
|
|
25
65
|
|
26
66
|
class ClientPasswordChangeRequest(APIRequestModel):
|
@@ -65,7 +105,7 @@ class SessionToken(PangeaResponseResult):
|
|
65
105
|
identity: str
|
66
106
|
email: str
|
67
107
|
scopes: Optional[Scopes] = None
|
68
|
-
profile: Profile
|
108
|
+
profile: Union[Profile, Dict[str, str]]
|
69
109
|
created_at: str
|
70
110
|
intelligence: Optional[Intelligence] = None
|
71
111
|
|
@@ -156,12 +196,43 @@ class UserListOrderBy(enum.Enum):
|
|
156
196
|
|
157
197
|
|
158
198
|
class Authenticator(APIResponseModel):
|
199
|
+
"""Authenticator."""
|
200
|
+
|
159
201
|
id: str
|
202
|
+
"""An ID for an authenticator."""
|
203
|
+
|
160
204
|
type: str
|
205
|
+
"""An authentication mechanism."""
|
206
|
+
|
161
207
|
enabled: bool
|
208
|
+
"""Enabled."""
|
209
|
+
|
162
210
|
provider: Optional[str] = None
|
211
|
+
"""Provider."""
|
212
|
+
|
213
|
+
provider_name: Optional[str] = None
|
214
|
+
"""Provider name."""
|
215
|
+
|
163
216
|
rpid: Optional[str] = None
|
217
|
+
"""RPID."""
|
218
|
+
|
164
219
|
phase: Optional[str] = None
|
220
|
+
"""Phase."""
|
221
|
+
|
222
|
+
enrolling_browser: Optional[str] = None
|
223
|
+
"""Enrolling browser."""
|
224
|
+
|
225
|
+
enrolling_ip: Optional[str] = None
|
226
|
+
"""Enrolling IP."""
|
227
|
+
|
228
|
+
created_at: str
|
229
|
+
"""A time in ISO-8601 format."""
|
230
|
+
|
231
|
+
updated_at: str
|
232
|
+
"""A time in ISO-8601 format."""
|
233
|
+
|
234
|
+
state: Optional[str] = None
|
235
|
+
"""State."""
|
165
236
|
|
166
237
|
|
167
238
|
class User(PangeaResponseResult):
|
@@ -174,7 +245,7 @@ class User(PangeaResponseResult):
|
|
174
245
|
username: str
|
175
246
|
"""A username."""
|
176
247
|
|
177
|
-
profile: Profile
|
248
|
+
profile: Union[Profile, Dict[str, str]]
|
178
249
|
"""A user profile as a collection of string properties."""
|
179
250
|
|
180
251
|
verified: bool
|
@@ -207,7 +278,7 @@ class UserCreateRequest(APIRequestModel):
|
|
207
278
|
email: str
|
208
279
|
"""An email address."""
|
209
280
|
|
210
|
-
profile: Profile
|
281
|
+
profile: Union[Profile, Dict[str, str]]
|
211
282
|
"""A user profile as a collection of string properties."""
|
212
283
|
|
213
284
|
username: Optional[str] = None
|
@@ -397,7 +468,7 @@ class UserProfileGetResult(User):
|
|
397
468
|
|
398
469
|
|
399
470
|
class UserProfileUpdateRequest(APIRequestModel):
|
400
|
-
profile: Profile
|
471
|
+
profile: Union[Profile, Dict[str, str]]
|
401
472
|
"""Updates to a user profile."""
|
402
473
|
|
403
474
|
id: Optional[str] = None
|
@@ -485,6 +556,7 @@ class UserAuthenticatorsListRequest(APIRequestModel):
|
|
485
556
|
|
486
557
|
class UserAuthenticatorsListResult(PangeaResponseResult):
|
487
558
|
authenticators: List[Authenticator] = []
|
559
|
+
"""A list of authenticators."""
|
488
560
|
|
489
561
|
|
490
562
|
class FlowCompleteRequest(APIRequestModel):
|
@@ -583,7 +655,7 @@ class FlowUpdateDataPassword(APIRequestModel):
|
|
583
655
|
|
584
656
|
|
585
657
|
class FlowUpdateDataProfile(APIRequestModel):
|
586
|
-
profile: Profile
|
658
|
+
profile: Union[Profile, Dict[str, str]]
|
587
659
|
|
588
660
|
|
589
661
|
class FlowUpdateDataProvisionalEnrollment(APIRequestModel):
|
@@ -705,7 +777,7 @@ class SessionItem(APIResponseModel):
|
|
705
777
|
expire: str
|
706
778
|
email: str
|
707
779
|
scopes: Optional[Scopes] = None
|
708
|
-
profile: Profile
|
780
|
+
profile: Union[Profile, Dict[str, str]]
|
709
781
|
created_at: str
|
710
782
|
active_token: Optional[SessionToken] = None
|
711
783
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pangea-sdk
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.2.0
|
4
4
|
Summary: Pangea API SDK
|
5
5
|
Home-page: https://pangea.cloud/docs/sdk/python/
|
6
6
|
License: MIT
|
@@ -22,7 +22,7 @@ Requires-Dist: asyncio (>=3.4.3,<4.0.0)
|
|
22
22
|
Requires-Dist: cryptography (>=42.0.8,<43.0.0)
|
23
23
|
Requires-Dist: deprecated (>=1.2.14,<2.0.0)
|
24
24
|
Requires-Dist: google-crc32c (>=1.5.0,<2.0.0)
|
25
|
-
Requires-Dist: pydantic (>=2.
|
25
|
+
Requires-Dist: pydantic (>=2.8.2,<3.0.0)
|
26
26
|
Requires-Dist: python-dateutil (>=2.9.0,<3.0.0)
|
27
27
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
28
28
|
Requires-Dist: requests-toolbelt (>=1.0.0,<2.0.0)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
pangea/__init__.py,sha256=
|
1
|
+
pangea/__init__.py,sha256=LU-w4iaLZ2cv9Z05TnO50JrxjnAYBIF410gDqtx3Hgw,200
|
2
2
|
pangea/asyncio/request.py,sha256=ysCT-SB1nkAr64O6JkI64xZt-Za1TQGt8Jp9gfqeLxE,17077
|
3
3
|
pangea/asyncio/services/__init__.py,sha256=hmySN2LoXYpHzSKLVSdVjMbpGXi5Z5iNx-fJ2Fc8W6I,320
|
4
4
|
pangea/asyncio/services/audit.py,sha256=bZ7gdkVWkzqLqUVc1Wnf3oDAaCLg97-zTWhY8UdX0_Y,26549
|
5
|
-
pangea/asyncio/services/authn.py,sha256=
|
5
|
+
pangea/asyncio/services/authn.py,sha256=rPeLJweL8mYH_t4ebcQn4n_Wglr3kClKNnCXNCimZU4,46622
|
6
6
|
pangea/asyncio/services/authz.py,sha256=DcPn5FpdWMunim6Qtsk2vFLXyUbFb3lgl1XpX3w0hew,9176
|
7
7
|
pangea/asyncio/services/base.py,sha256=4FtKtlq74NmE9myrgIt9HMA6JDnP4mPZ6krafWr286o,2663
|
8
8
|
pangea/asyncio/services/embargo.py,sha256=ctzj3kip6xos-Eu3JuOskrCGYC8T3JlsgAopZHiPSXM,3068
|
@@ -26,8 +26,8 @@ pangea/services/audit/exceptions.py,sha256=bhVuYe4ammacOVxwg98CChxvwZf5FKgR2Dcgq
|
|
26
26
|
pangea/services/audit/models.py,sha256=1h1B9eSYQMYG3f8WNi1UcDX2-impRrET_ErjJYUnj7M,14678
|
27
27
|
pangea/services/audit/signing.py,sha256=pOjw60BIYDcg3_5YKDCMWZUaapsEZpCHaFhyFu7TEgc,5567
|
28
28
|
pangea/services/audit/util.py,sha256=Zq1qvfeplYfhCP_ud5YMvntSB0UvnCdsuYbOzZkHbjg,7620
|
29
|
-
pangea/services/authn/authn.py,sha256=
|
30
|
-
pangea/services/authn/models.py,sha256=
|
29
|
+
pangea/services/authn/authn.py,sha256=cZKl2Ixc6HwHnkRecpSaAGTQUgaZUtxfLa0T3S03HMs,45478
|
30
|
+
pangea/services/authn/models.py,sha256=HH5su6jx3O9AwVGzASXZ99-eIWjgXEP5LhIVdewM13s,22394
|
31
31
|
pangea/services/authz.py,sha256=kgJ4iWytqm2PqLB2n2AQy1lHR8TI8tdYBuOYAfY0fY0,11818
|
32
32
|
pangea/services/base.py,sha256=lwhHoe5Juy28Ir3Mfj2lHdM58gxZRaxa2SRFi4_DBRw,3453
|
33
33
|
pangea/services/embargo.py,sha256=9Wfku4td5ORaIENKmnGmS5jxJJIRfWp6Q51L36Jsy0I,3897
|
@@ -42,6 +42,6 @@ pangea/services/vault/vault.py,sha256=pv52dpZM0yicdtNra0Yd4AdkWUZC91Yk4rATthu1bs
|
|
42
42
|
pangea/tools.py,sha256=sa2pSz-L8tB6GcZg6lghsmm8w0qMQAIkzqcv7dilU6Q,6429
|
43
43
|
pangea/utils.py,sha256=pMSwL8B-owtrjeWYRjxuyaTQN4V-HsCT669KtOLU3Sw,3195
|
44
44
|
pangea/verify_audit.py,sha256=rvni5akz_P2kYLAGAeA1A5gY6XGpXpAQpbIa7V1PoRY,17458
|
45
|
-
pangea_sdk-4.
|
46
|
-
pangea_sdk-4.
|
47
|
-
pangea_sdk-4.
|
45
|
+
pangea_sdk-4.2.0.dist-info/METADATA,sha256=SwojBSSbANVBCo4FOmE0qWZqYjW46tI6yNIFNrz3HlM,7532
|
46
|
+
pangea_sdk-4.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
47
|
+
pangea_sdk-4.2.0.dist-info/RECORD,,
|
File without changes
|