pangea-sdk 3.8.0b1__py3-none-any.whl → 5.3.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pangea/__init__.py +1 -1
- pangea/asyncio/file_uploader.py +1 -1
- pangea/asyncio/request.py +49 -31
- pangea/asyncio/services/__init__.py +2 -0
- pangea/asyncio/services/audit.py +192 -31
- pangea/asyncio/services/authn.py +187 -109
- pangea/asyncio/services/authz.py +285 -0
- pangea/asyncio/services/base.py +21 -2
- pangea/asyncio/services/embargo.py +2 -2
- pangea/asyncio/services/file_scan.py +24 -9
- pangea/asyncio/services/intel.py +108 -34
- pangea/asyncio/services/redact.py +72 -4
- pangea/asyncio/services/sanitize.py +217 -0
- pangea/asyncio/services/share.py +246 -73
- pangea/asyncio/services/vault.py +1710 -750
- pangea/crypto/rsa.py +135 -0
- pangea/deep_verify.py +7 -1
- pangea/dump_audit.py +9 -8
- pangea/request.py +83 -59
- pangea/response.py +49 -31
- pangea/services/__init__.py +2 -0
- pangea/services/audit/audit.py +205 -42
- pangea/services/audit/models.py +56 -8
- pangea/services/audit/signing.py +6 -5
- pangea/services/audit/util.py +3 -3
- pangea/services/authn/authn.py +140 -70
- pangea/services/authn/models.py +167 -11
- pangea/services/authz.py +400 -0
- pangea/services/base.py +39 -8
- pangea/services/embargo.py +2 -2
- pangea/services/file_scan.py +32 -15
- pangea/services/intel.py +157 -32
- pangea/services/redact.py +152 -4
- pangea/services/sanitize.py +388 -0
- pangea/services/share/share.py +683 -107
- pangea/services/vault/models/asymmetric.py +120 -18
- pangea/services/vault/models/common.py +439 -141
- pangea/services/vault/models/keys.py +94 -0
- pangea/services/vault/models/secret.py +27 -3
- pangea/services/vault/models/symmetric.py +68 -22
- pangea/services/vault/vault.py +1690 -749
- pangea/tools.py +6 -7
- pangea/utils.py +16 -27
- pangea/verify_audit.py +270 -83
- {pangea_sdk-3.8.0b1.dist-info → pangea_sdk-5.3.0.dist-info}/METADATA +43 -35
- pangea_sdk-5.3.0.dist-info/RECORD +56 -0
- {pangea_sdk-3.8.0b1.dist-info → pangea_sdk-5.3.0.dist-info}/WHEEL +1 -1
- pangea_sdk-3.8.0b1.dist-info/RECORD +0 -50
pangea/services/authn/authn.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# Copyright 2022 Pangea Cyber Corporation
|
2
2
|
# Author: Pangea Cyber Corporation
|
3
|
+
from __future__ import annotations
|
3
4
|
|
4
5
|
from typing import Dict, List, Optional, Union
|
5
6
|
|
6
7
|
import pangea.services.authn.models as m
|
7
|
-
from pangea.
|
8
|
+
from pangea.config import PangeaConfig
|
9
|
+
from pangea.response import PangeaResponse, PangeaResponseResult
|
8
10
|
from pangea.services.base import ServiceBase
|
9
11
|
|
10
12
|
SERVICE_NAME = "authn"
|
@@ -37,10 +39,24 @@ class AuthN(ServiceBase):
|
|
37
39
|
|
38
40
|
def __init__(
|
39
41
|
self,
|
40
|
-
token,
|
41
|
-
config=None,
|
42
|
-
logger_name="pangea",
|
43
|
-
):
|
42
|
+
token: str,
|
43
|
+
config: PangeaConfig | None = None,
|
44
|
+
logger_name: str = "pangea",
|
45
|
+
) -> None:
|
46
|
+
"""
|
47
|
+
AuthN client
|
48
|
+
|
49
|
+
Initializes a new AuthN client.
|
50
|
+
|
51
|
+
Args:
|
52
|
+
token: Pangea API token.
|
53
|
+
config: Configuration.
|
54
|
+
logger_name: Logger name.
|
55
|
+
|
56
|
+
Examples:
|
57
|
+
config = PangeaConfig(domain="pangea_domain")
|
58
|
+
authn = AuthN(token="pangea_token", config=config)
|
59
|
+
"""
|
44
60
|
super().__init__(token, config, logger_name=logger_name)
|
45
61
|
self.user = AuthN.User(token, config, logger_name=logger_name)
|
46
62
|
self.flow = AuthN.Flow(token, config, logger_name=logger_name)
|
@@ -80,7 +96,7 @@ class AuthN(ServiceBase):
|
|
80
96
|
"""
|
81
97
|
input = m.SessionInvalidateRequest(session_id=session_id)
|
82
98
|
return self.request.post(
|
83
|
-
"v2/session/invalidate", m.SessionInvalidateResult, data=input.
|
99
|
+
"v2/session/invalidate", m.SessionInvalidateResult, data=input.model_dump(exclude_none=True)
|
84
100
|
)
|
85
101
|
|
86
102
|
def list(
|
@@ -118,7 +134,7 @@ class AuthN(ServiceBase):
|
|
118
134
|
filter = m.SessionListFilter(**filter)
|
119
135
|
|
120
136
|
input = m.SessionListRequest(filter=filter, last=last, order=order, order_by=order_by, size=size)
|
121
|
-
return self.request.post("v2/session/list", m.SessionListResults, data=input.
|
137
|
+
return self.request.post("v2/session/list", m.SessionListResults, data=input.model_dump(exclude_none=True))
|
122
138
|
|
123
139
|
def logout(self, user_id: str) -> PangeaResponse[m.SessionLogoutResult]:
|
124
140
|
"""
|
@@ -140,7 +156,9 @@ class AuthN(ServiceBase):
|
|
140
156
|
)
|
141
157
|
"""
|
142
158
|
input = m.SessionLogoutRequest(user_id=user_id)
|
143
|
-
return self.request.post(
|
159
|
+
return self.request.post(
|
160
|
+
"v2/session/logout", m.SessionLogoutResult, data=input.model_dump(exclude_none=True)
|
161
|
+
)
|
144
162
|
|
145
163
|
class Client(ServiceBase):
|
146
164
|
service_name = SERVICE_NAME
|
@@ -178,7 +196,9 @@ class AuthN(ServiceBase):
|
|
178
196
|
)
|
179
197
|
"""
|
180
198
|
input = m.ClientUserinfoRequest(code=code)
|
181
|
-
return self.request.post(
|
199
|
+
return self.request.post(
|
200
|
+
"v2/client/userinfo", m.ClientUserinfoResult, data=input.model_dump(exclude_none=True)
|
201
|
+
)
|
182
202
|
|
183
203
|
def jwks(
|
184
204
|
self,
|
@@ -234,7 +254,9 @@ class AuthN(ServiceBase):
|
|
234
254
|
"""
|
235
255
|
input = m.ClientSessionInvalidateRequest(token=token, session_id=session_id)
|
236
256
|
return self.request.post(
|
237
|
-
"v2/client/session/invalidate",
|
257
|
+
"v2/client/session/invalidate",
|
258
|
+
m.ClientSessionInvalidateResult,
|
259
|
+
data=input.model_dump(exclude_none=True),
|
238
260
|
)
|
239
261
|
|
240
262
|
def list(
|
@@ -279,7 +301,7 @@ class AuthN(ServiceBase):
|
|
279
301
|
token=token, filter=filter, last=last, order=order, order_by=order_by, size=size
|
280
302
|
)
|
281
303
|
return self.request.post(
|
282
|
-
"v2/client/session/list", m.ClientSessionListResults, data=input.
|
304
|
+
"v2/client/session/list", m.ClientSessionListResults, data=input.model_dump(exclude_none=True)
|
283
305
|
)
|
284
306
|
|
285
307
|
def logout(self, token: str) -> PangeaResponse[m.ClientSessionLogoutResult]:
|
@@ -303,7 +325,7 @@ class AuthN(ServiceBase):
|
|
303
325
|
"""
|
304
326
|
input = m.ClientSessionLogoutRequest(token=token)
|
305
327
|
return self.request.post(
|
306
|
-
"v2/client/session/logout", m.ClientSessionLogoutResult, data=input.
|
328
|
+
"v2/client/session/logout", m.ClientSessionLogoutResult, data=input.model_dump(exclude_none=True)
|
307
329
|
)
|
308
330
|
|
309
331
|
def refresh(
|
@@ -333,7 +355,7 @@ class AuthN(ServiceBase):
|
|
333
355
|
"""
|
334
356
|
input = m.ClientSessionRefreshRequest(refresh_token=refresh_token, user_token=user_token)
|
335
357
|
return self.request.post(
|
336
|
-
"v2/client/session/refresh", m.ClientSessionRefreshResult, data=input.
|
358
|
+
"v2/client/session/refresh", m.ClientSessionRefreshResult, data=input.model_dump(exclude_none=True)
|
337
359
|
)
|
338
360
|
|
339
361
|
class Password(ServiceBase):
|
@@ -341,10 +363,10 @@ class AuthN(ServiceBase):
|
|
341
363
|
|
342
364
|
def __init__(
|
343
365
|
self,
|
344
|
-
token,
|
345
|
-
config=None,
|
346
|
-
logger_name="pangea",
|
347
|
-
):
|
366
|
+
token: str,
|
367
|
+
config: PangeaConfig | None = None,
|
368
|
+
logger_name: str = "pangea",
|
369
|
+
) -> None:
|
348
370
|
super().__init__(token, config, logger_name=logger_name)
|
349
371
|
|
350
372
|
def change(
|
@@ -374,9 +396,28 @@ class AuthN(ServiceBase):
|
|
374
396
|
"""
|
375
397
|
input = m.ClientPasswordChangeRequest(token=token, old_password=old_password, new_password=new_password)
|
376
398
|
return self.request.post(
|
377
|
-
"v2/client/password/change", m.ClientPasswordChangeResult, data=input.
|
399
|
+
"v2/client/password/change", m.ClientPasswordChangeResult, data=input.model_dump(exclude_none=True)
|
378
400
|
)
|
379
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
|
+
|
380
421
|
class Token(ServiceBase):
|
381
422
|
service_name = SERVICE_NAME
|
382
423
|
|
@@ -411,7 +452,7 @@ class AuthN(ServiceBase):
|
|
411
452
|
"""
|
412
453
|
input = m.ClientTokenCheckRequest(token=token)
|
413
454
|
return self.request.post(
|
414
|
-
"v2/client/token/check", m.ClientTokenCheckResult, data=input.
|
455
|
+
"v2/client/token/check", m.ClientTokenCheckResult, data=input.model_dump(exclude_none=True)
|
415
456
|
)
|
416
457
|
|
417
458
|
class User(ServiceBase):
|
@@ -432,6 +473,8 @@ class AuthN(ServiceBase):
|
|
432
473
|
self,
|
433
474
|
email: str,
|
434
475
|
profile: m.Profile,
|
476
|
+
*,
|
477
|
+
username: str | None = None,
|
435
478
|
) -> PangeaResponse[m.UserCreateResult]:
|
436
479
|
"""
|
437
480
|
Create User
|
@@ -441,8 +484,9 @@ class AuthN(ServiceBase):
|
|
441
484
|
OperationId: authn_post_v2_user_create
|
442
485
|
|
443
486
|
Args:
|
444
|
-
email
|
445
|
-
profile
|
487
|
+
email: An email address.
|
488
|
+
profile: A user profile as a collection of string properties.
|
489
|
+
username: A username.
|
446
490
|
|
447
491
|
Returns:
|
448
492
|
A PangeaResponse with a user and its information in the response.result field.
|
@@ -461,10 +505,13 @@ class AuthN(ServiceBase):
|
|
461
505
|
input = m.UserCreateRequest(
|
462
506
|
email=email,
|
463
507
|
profile=profile,
|
508
|
+
username=username,
|
464
509
|
)
|
465
|
-
return self.request.post("v2/user/create", m.UserCreateResult, data=input.
|
510
|
+
return self.request.post("v2/user/create", m.UserCreateResult, data=input.model_dump(exclude_none=True))
|
466
511
|
|
467
|
-
def delete(
|
512
|
+
def delete(
|
513
|
+
self, email: str | None = None, id: str | None = None, *, username: str | None = None
|
514
|
+
) -> PangeaResponse[m.UserDeleteResult]:
|
468
515
|
"""
|
469
516
|
Delete User
|
470
517
|
|
@@ -473,8 +520,9 @@ class AuthN(ServiceBase):
|
|
473
520
|
OperationId: authn_post_v2_user_delete
|
474
521
|
|
475
522
|
Args:
|
476
|
-
email
|
477
|
-
id
|
523
|
+
email: An email address.
|
524
|
+
id: The id of a user or a service.
|
525
|
+
username: A username.
|
478
526
|
|
479
527
|
Returns:
|
480
528
|
A PangeaResponse with an empty object in the response.result field.
|
@@ -482,8 +530,8 @@ class AuthN(ServiceBase):
|
|
482
530
|
Examples:
|
483
531
|
authn.user.delete(email="example@example.com")
|
484
532
|
"""
|
485
|
-
input = m.UserDeleteRequest(email=email, id=id)
|
486
|
-
return self.request.post("v2/user/delete", m.UserDeleteResult, data=input.
|
533
|
+
input = m.UserDeleteRequest(email=email, id=id, username=username)
|
534
|
+
return self.request.post("v2/user/delete", m.UserDeleteResult, data=input.model_dump(exclude_none=True))
|
487
535
|
|
488
536
|
def invite(
|
489
537
|
self,
|
@@ -524,14 +572,16 @@ class AuthN(ServiceBase):
|
|
524
572
|
callback=callback,
|
525
573
|
state=state,
|
526
574
|
)
|
527
|
-
return self.request.post("v2/user/invite", m.UserInviteResult, data=input.
|
575
|
+
return self.request.post("v2/user/invite", m.UserInviteResult, data=input.model_dump(exclude_none=True))
|
528
576
|
|
529
577
|
def update(
|
530
578
|
self,
|
531
|
-
disabled:
|
532
|
-
id:
|
533
|
-
email:
|
534
|
-
unlock:
|
579
|
+
disabled: bool | None = None,
|
580
|
+
id: str | None = None,
|
581
|
+
email: str | None = None,
|
582
|
+
unlock: bool | None = None,
|
583
|
+
*,
|
584
|
+
username: str | None = None,
|
535
585
|
) -> PangeaResponse[m.UserUpdateResult]:
|
536
586
|
"""
|
537
587
|
Update user's settings
|
@@ -541,11 +591,12 @@ class AuthN(ServiceBase):
|
|
541
591
|
OperationId: authn_post_v2_user_update
|
542
592
|
|
543
593
|
Args:
|
544
|
-
disabled
|
594
|
+
disabled: New disabled value.
|
545
595
|
Disabling a user account will prevent them from logging in.
|
546
|
-
unlock
|
547
|
-
id
|
548
|
-
email
|
596
|
+
unlock: Unlock a user account if it has been locked out due to failed authentication attempts.
|
597
|
+
id: The identity of a user or a service.
|
598
|
+
email: An email address.
|
599
|
+
username: A username.
|
549
600
|
|
550
601
|
Returns:
|
551
602
|
A PangeaResponse with a user and its information in the response.result field.
|
@@ -563,9 +614,10 @@ class AuthN(ServiceBase):
|
|
563
614
|
email=email,
|
564
615
|
disabled=disabled,
|
565
616
|
unlock=unlock,
|
617
|
+
username=username,
|
566
618
|
)
|
567
619
|
|
568
|
-
return self.request.post("v2/user/update", m.UserUpdateResult, data=input.
|
620
|
+
return self.request.post("v2/user/update", m.UserUpdateResult, data=input.model_dump(exclude_none=True))
|
569
621
|
|
570
622
|
def list(
|
571
623
|
self,
|
@@ -608,7 +660,7 @@ class AuthN(ServiceBase):
|
|
608
660
|
order_by=order_by,
|
609
661
|
size=size,
|
610
662
|
)
|
611
|
-
return self.request.post("v2/user/list", m.UserListResult, data=input.
|
663
|
+
return self.request.post("v2/user/list", m.UserListResult, data=input.model_dump(exclude_none=True))
|
612
664
|
|
613
665
|
class Invites(ServiceBase):
|
614
666
|
service_name = SERVICE_NAME
|
@@ -655,7 +707,7 @@ class AuthN(ServiceBase):
|
|
655
707
|
|
656
708
|
input = m.UserInviteListRequest(filter=filter, last=last, order=order, order_by=order_by, size=size)
|
657
709
|
return self.request.post(
|
658
|
-
"v2/user/invite/list", m.UserInviteListResult, data=input.
|
710
|
+
"v2/user/invite/list", m.UserInviteListResult, data=input.model_dump(exclude_none=True)
|
659
711
|
)
|
660
712
|
|
661
713
|
def delete(self, id: str) -> PangeaResponse[m.UserInviteDeleteResult]:
|
@@ -679,7 +731,7 @@ class AuthN(ServiceBase):
|
|
679
731
|
"""
|
680
732
|
input = m.UserInviteDeleteRequest(id=id)
|
681
733
|
return self.request.post(
|
682
|
-
"v2/user/invite/delete", m.UserInviteDeleteResult, data=input.
|
734
|
+
"v2/user/invite/delete", m.UserInviteDeleteResult, data=input.model_dump(exclude_none=True)
|
683
735
|
)
|
684
736
|
|
685
737
|
class Authenticators(ServiceBase):
|
@@ -694,7 +746,12 @@ class AuthN(ServiceBase):
|
|
694
746
|
super().__init__(token, config, logger_name=logger_name)
|
695
747
|
|
696
748
|
def delete(
|
697
|
-
self,
|
749
|
+
self,
|
750
|
+
authenticator_id: str,
|
751
|
+
id: str | None = None,
|
752
|
+
email: str | None = None,
|
753
|
+
*,
|
754
|
+
username: str | None = None,
|
698
755
|
) -> PangeaResponse[m.UserAuthenticatorsDeleteResult]:
|
699
756
|
"""
|
700
757
|
Delete user authenticator
|
@@ -704,9 +761,10 @@ class AuthN(ServiceBase):
|
|
704
761
|
OperationId: authn_post_v2_user_authenticators_delete
|
705
762
|
|
706
763
|
Args:
|
707
|
-
authenticator_id
|
708
|
-
id
|
709
|
-
email
|
764
|
+
authenticator_id: An ID for an authenticator.
|
765
|
+
id: The identity of a user or a service.
|
766
|
+
email: An email address.
|
767
|
+
username: A username.
|
710
768
|
|
711
769
|
Returns:
|
712
770
|
A PangeaResponse with an empty object in the response.result field.
|
@@ -717,15 +775,17 @@ class AuthN(ServiceBase):
|
|
717
775
|
id="pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
|
718
776
|
)
|
719
777
|
"""
|
720
|
-
input = m.UserAuthenticatorsDeleteRequest(
|
778
|
+
input = m.UserAuthenticatorsDeleteRequest(
|
779
|
+
authenticator_id=authenticator_id, email=email, id=id, username=username
|
780
|
+
)
|
721
781
|
return self.request.post(
|
722
782
|
"v2/user/authenticators/delete",
|
723
783
|
m.UserAuthenticatorsDeleteResult,
|
724
|
-
data=input.
|
784
|
+
data=input.model_dump(exclude_none=True),
|
725
785
|
)
|
726
786
|
|
727
787
|
def list(
|
728
|
-
self, email:
|
788
|
+
self, email: str | None = None, id: str | None = None, *, username: str | None = None
|
729
789
|
) -> PangeaResponse[m.UserAuthenticatorsListResult]:
|
730
790
|
"""
|
731
791
|
Get user authenticators
|
@@ -735,8 +795,9 @@ class AuthN(ServiceBase):
|
|
735
795
|
OperationId: authn_post_v2_user_authenticators_list
|
736
796
|
|
737
797
|
Args:
|
738
|
-
email
|
739
|
-
id
|
798
|
+
email: An email address.
|
799
|
+
id: The identity of a user or a service.
|
800
|
+
username: A username.
|
740
801
|
|
741
802
|
Returns:
|
742
803
|
A PangeaResponse with a list of authenticators in the response.result field.
|
@@ -748,9 +809,11 @@ class AuthN(ServiceBase):
|
|
748
809
|
id="pui_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
|
749
810
|
)
|
750
811
|
"""
|
751
|
-
input = m.UserAuthenticatorsListRequest(email=email, id=id)
|
812
|
+
input = m.UserAuthenticatorsListRequest(email=email, id=id, username=username)
|
752
813
|
return self.request.post(
|
753
|
-
"v2/user/authenticators/list",
|
814
|
+
"v2/user/authenticators/list",
|
815
|
+
m.UserAuthenticatorsListResult,
|
816
|
+
data=input.model_dump(exclude_none=True),
|
754
817
|
)
|
755
818
|
|
756
819
|
class Profile(ServiceBase):
|
@@ -765,7 +828,7 @@ class AuthN(ServiceBase):
|
|
765
828
|
super().__init__(token, config, logger_name=logger_name)
|
766
829
|
|
767
830
|
def get(
|
768
|
-
self, id:
|
831
|
+
self, id: str | None = None, email: str | None = None, *, username: str | None = None
|
769
832
|
) -> PangeaResponse[m.UserProfileGetResult]:
|
770
833
|
"""
|
771
834
|
Get user
|
@@ -775,8 +838,9 @@ class AuthN(ServiceBase):
|
|
775
838
|
OperationId: authn_post_v2_user_profile_get
|
776
839
|
|
777
840
|
Args:
|
778
|
-
id
|
779
|
-
email
|
841
|
+
id: The identity of a user or a service.
|
842
|
+
email: An email address.
|
843
|
+
username: A username.
|
780
844
|
|
781
845
|
Returns:
|
782
846
|
A PangeaResponse with a user and its information in the response.result field.
|
@@ -788,16 +852,18 @@ class AuthN(ServiceBase):
|
|
788
852
|
email="joe.user@email.com",
|
789
853
|
)
|
790
854
|
"""
|
791
|
-
input = m.UserProfileGetRequest(id=id, email=email)
|
855
|
+
input = m.UserProfileGetRequest(id=id, email=email, username=username)
|
792
856
|
return self.request.post(
|
793
|
-
"v2/user/profile/get", m.UserProfileGetResult, data=input.
|
857
|
+
"v2/user/profile/get", m.UserProfileGetResult, data=input.model_dump(exclude_none=True)
|
794
858
|
)
|
795
859
|
|
796
860
|
def update(
|
797
861
|
self,
|
798
862
|
profile: m.Profile,
|
799
|
-
id:
|
800
|
-
email:
|
863
|
+
id: str | None = None,
|
864
|
+
email: str | None = None,
|
865
|
+
*,
|
866
|
+
username: str | None = None,
|
801
867
|
) -> PangeaResponse[m.UserProfileUpdateResult]:
|
802
868
|
"""
|
803
869
|
Update user
|
@@ -807,9 +873,10 @@ class AuthN(ServiceBase):
|
|
807
873
|
OperationId: authn_post_v2_user_profile_update
|
808
874
|
|
809
875
|
Args:
|
810
|
-
profile
|
811
|
-
id
|
812
|
-
email
|
876
|
+
profile: Updates to a user profile.
|
877
|
+
id: The identity of a user or a service.
|
878
|
+
email: An email address.
|
879
|
+
username: A username.
|
813
880
|
|
814
881
|
Returns:
|
815
882
|
A PangeaResponse with a user and its information in the response.result field.
|
@@ -828,9 +895,10 @@ class AuthN(ServiceBase):
|
|
828
895
|
id=id,
|
829
896
|
email=email,
|
830
897
|
profile=profile,
|
898
|
+
username=username,
|
831
899
|
)
|
832
900
|
return self.request.post(
|
833
|
-
"v2/user/profile/update", m.UserProfileUpdateResult, data=input.
|
901
|
+
"v2/user/profile/update", m.UserProfileUpdateResult, data=input.model_dump(exclude_none=True)
|
834
902
|
)
|
835
903
|
|
836
904
|
class Flow(ServiceBase):
|
@@ -866,7 +934,7 @@ class AuthN(ServiceBase):
|
|
866
934
|
)
|
867
935
|
"""
|
868
936
|
input = m.FlowCompleteRequest(flow_id=flow_id)
|
869
|
-
return self.request.post("v2/flow/complete", m.FlowCompleteResult, data=input.
|
937
|
+
return self.request.post("v2/flow/complete", m.FlowCompleteResult, data=input.model_dump(exclude_none=True))
|
870
938
|
|
871
939
|
def restart(
|
872
940
|
self, flow_id: str, choice: m.FlowChoice, data: m.FlowRestartData = {}
|
@@ -898,7 +966,7 @@ class AuthN(ServiceBase):
|
|
898
966
|
"""
|
899
967
|
|
900
968
|
input = m.FlowRestartRequest(flow_id=flow_id, choice=choice, data=data)
|
901
|
-
return self.request.post("v2/flow/restart", m.FlowRestartResult, data=input.
|
969
|
+
return self.request.post("v2/flow/restart", m.FlowRestartResult, data=input.model_dump(exclude_none=True))
|
902
970
|
|
903
971
|
def start(
|
904
972
|
self,
|
@@ -937,7 +1005,7 @@ class AuthN(ServiceBase):
|
|
937
1005
|
)
|
938
1006
|
"""
|
939
1007
|
input = m.FlowStartRequest(cb_uri=cb_uri, email=email, flow_types=flow_types, invitation=invitation)
|
940
|
-
return self.request.post("v2/flow/start", m.FlowStartResult, data=input.
|
1008
|
+
return self.request.post("v2/flow/start", m.FlowStartResult, data=input.model_dump(exclude_none=True))
|
941
1009
|
|
942
1010
|
def update(
|
943
1011
|
self, flow_id: str, choice: m.FlowChoice, data: m.FlowUpdateData = {}
|
@@ -971,7 +1039,7 @@ class AuthN(ServiceBase):
|
|
971
1039
|
"""
|
972
1040
|
|
973
1041
|
input = m.FlowUpdateRequest(flow_id=flow_id, choice=choice, data=data)
|
974
|
-
return self.request.post("v2/flow/update", m.FlowUpdateResult, data=input.
|
1042
|
+
return self.request.post("v2/flow/update", m.FlowUpdateResult, data=input.model_dump(exclude_none=True))
|
975
1043
|
|
976
1044
|
class Agreements(ServiceBase):
|
977
1045
|
service_name = SERVICE_NAME
|
@@ -1015,7 +1083,7 @@ class AuthN(ServiceBase):
|
|
1015
1083
|
|
1016
1084
|
input = m.AgreementCreateRequest(type=type, name=name, text=text, active=active)
|
1017
1085
|
return self.request.post(
|
1018
|
-
"v2/agreements/create", m.AgreementCreateResult, data=input.
|
1086
|
+
"v2/agreements/create", m.AgreementCreateResult, data=input.model_dump(exclude_none=True)
|
1019
1087
|
)
|
1020
1088
|
|
1021
1089
|
def delete(self, type: m.AgreementType, id: str) -> PangeaResponse[m.AgreementDeleteResult]:
|
@@ -1042,7 +1110,7 @@ class AuthN(ServiceBase):
|
|
1042
1110
|
|
1043
1111
|
input = m.AgreementDeleteRequest(type=type, id=id)
|
1044
1112
|
return self.request.post(
|
1045
|
-
"v2/agreements/delete", m.AgreementDeleteResult, data=input.
|
1113
|
+
"v2/agreements/delete", m.AgreementDeleteResult, data=input.model_dump(exclude_none=True)
|
1046
1114
|
)
|
1047
1115
|
|
1048
1116
|
def list(
|
@@ -1080,7 +1148,9 @@ class AuthN(ServiceBase):
|
|
1080
1148
|
filter = m.AgreementListFilter(**filter)
|
1081
1149
|
|
1082
1150
|
input = m.AgreementListRequest(filter=filter, last=last, order=order, order_by=order_by, size=size)
|
1083
|
-
return self.request.post(
|
1151
|
+
return self.request.post(
|
1152
|
+
"v2/agreements/list", m.AgreementListResult, data=input.model_dump(exclude_none=True)
|
1153
|
+
)
|
1084
1154
|
|
1085
1155
|
def update(
|
1086
1156
|
self,
|
@@ -1120,5 +1190,5 @@ class AuthN(ServiceBase):
|
|
1120
1190
|
|
1121
1191
|
input = m.AgreementUpdateRequest(type=type, id=id, name=name, text=text, active=active)
|
1122
1192
|
return self.request.post(
|
1123
|
-
"v2/agreements/update", m.AgreementUpdateResult, data=input.
|
1193
|
+
"v2/agreements/update", m.AgreementUpdateResult, data=input.model_dump(exclude_none=True)
|
1124
1194
|
)
|