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 1313
1414class JWT (AuthBase ):
1515 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
1717 ) -> str :
1818 """
1919 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):
6969 timeout = DEFAULT_TIMEOUT_SECONDS ,
7070 )
7171
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+
7292 def test_impersonate (self ):
7393 client = DescopeClient (
7494 self .dummy_project_id ,
You can’t perform that action at this time.
0 commit comments