@@ -42,14 +42,14 @@ async def __execute_async__(func: Callable[..., T], **kwargs: Any) -> T:
4242 def decode_id_token (id_token : str ) -> Optional [IDTokenClaims ]:
4343 decoded : OptStrsDict = json .loads (oidc .decode_part (id_token .split ("." )[1 ]))
4444 if decoded :
45- return IDTokenClaims .parse_obj (decoded )
45+ return IDTokenClaims .model_validate (decoded )
4646 return None
4747
4848 async def validate_id_token (self , id_token : str , nonce : OptStr = None ) -> IDTokenClaims :
4949 token_claims : OptStrsDict = await self .__execute_async__ (
5050 self ._cca .client .decode_id_token , id_token = id_token , nonce = nonce
5151 )
52- return IDTokenClaims .parse_obj (token_claims )
52+ return IDTokenClaims .model_validate (token_claims )
5353
5454 async def get_application_token (self , claims_challenge : OptStrsDict = None ) -> AuthToken :
5555 token : StrsDict = await self .__execute_async__ (
@@ -92,14 +92,14 @@ async def initiate_auth_flow(
9292 async def finalize_auth_flow (self , auth_code_flow : AuthCode , auth_response : AuthResponse ) -> AuthToken :
9393 auth_token : StrsDict = await self .__execute_async__ (
9494 self ._cca .acquire_token_by_auth_code_flow ,
95- auth_code_flow = auth_code_flow .dict (exclude_none = True ),
96- auth_response = auth_response .dict (exclude_none = True ),
95+ auth_code_flow = auth_code_flow .model_dump (exclude_none = True ),
96+ auth_response = auth_response .model_dump (exclude_none = True ),
9797 scopes = self .client_config .scopes ,
9898 )
9999 return AuthToken .parse_obj_debug (to_parse = auth_token )
100100
101101 async def remove_account (self , account : LocalAccount ) -> None :
102- await self .__execute_async__ (self ._cca .remove_account , account = account .dict (exclude_none = True ))
102+ await self .__execute_async__ (self ._cca .remove_account , account = account .model_dump (exclude_none = True ))
103103
104104 async def get_accounts (self , username : OptStr = None ) -> list [LocalAccount ]:
105105 accounts_objects : list [StrsDict ] = await self .__execute_async__ (self ._cca .get_accounts , username = username )
@@ -117,7 +117,7 @@ async def acquire_token_silent(
117117 token = await self .__execute_async__ (
118118 self ._cca .acquire_token_silent ,
119119 scopes = self .client_config .scopes ,
120- account = (account .dict (exclude_none = True ) if account else None ),
120+ account = (account .model_dump (exclude_none = True ) if account else None ),
121121 authority = authority ,
122122 force_refresh = force_refresh ,
123123 claims_challenge = claims_challenge ,
0 commit comments