File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 13
13
14
14
class JWT (AuthBase ):
15
15
def update_jwt (
16
- self , jwt : str , custom_claims : dict , refresh_duration : Optional [ int ]
16
+ self , jwt : str , custom_claims : dict , refresh_duration : int = 0
17
17
) -> str :
18
18
"""
19
19
Given a valid JWT, update it with custom claims, and update its authz claims as well
Original file line number Diff line number Diff line change @@ -69,6 +69,26 @@ def test_update_jwt(self):
69
69
timeout = DEFAULT_TIMEOUT_SECONDS ,
70
70
)
71
71
72
+ resp = client .mgmt .jwt .update_jwt ("test" , {"k1" : "v1" })
73
+ self .assertEqual (resp , "response" )
74
+ expected_uri = f"{ common .DEFAULT_BASE_URL } { MgmtV1 .update_jwt_path } "
75
+ mock_post .assert_called_with (
76
+ expected_uri ,
77
+ headers = {
78
+ ** common .default_headers ,
79
+ "Authorization" : f"Bearer { self .dummy_project_id } :{ self .dummy_management_key } " ,
80
+ },
81
+ json = {
82
+ "jwt" : "test" ,
83
+ "customClaims" : {"k1" : "v1" },
84
+ "refreshDuration" : 0 ,
85
+ },
86
+ allow_redirects = False ,
87
+ verify = True ,
88
+ params = None ,
89
+ timeout = DEFAULT_TIMEOUT_SECONDS ,
90
+ )
91
+
72
92
def test_impersonate (self ):
73
93
client = DescopeClient (
74
94
self .dummy_project_id ,
You can’t perform that action at this time.
0 commit comments