44Corresponds to TypeScript file: src/server/auth/provider.ts
55"""
66
7- from typing import List , Literal , Optional , Protocol
7+ from typing import Literal , Protocol
88from urllib .parse import parse_qs , urlencode , urlparse , urlunparse
99
1010from pydantic import AnyHttpUrl , BaseModel
@@ -23,8 +23,8 @@ class AuthorizationParams(BaseModel):
2323 Corresponds to AuthorizationParams in src/server/auth/provider.ts
2424 """
2525
26- state : Optional [ str ] = None
27- scopes : Optional [ List [ str ]] = None
26+ state : str | None = None
27+ scopes : list [ str ] | None = None
2828 code_challenge : str
2929 redirect_uri : AnyHttpUrl
3030
@@ -41,8 +41,8 @@ class AuthorizationCode(BaseModel):
4141class RefreshToken (BaseModel ):
4242 token : str
4343 client_id : str
44- scopes : List [str ]
45- expires_at : Optional [ int ] = None
44+ scopes : list [str ]
45+ expires_at : int | None = None
4646
4747
4848class OAuthTokenRevocationRequest (BaseModel ):
@@ -51,7 +51,7 @@ class OAuthTokenRevocationRequest(BaseModel):
5151 """
5252
5353 token : str
54- token_type_hint : Optional [ Literal ["access_token" , "refresh_token" ]] = None
54+ token_type_hint : Literal ["access_token" , "refresh_token" ] | None = None
5555
5656
5757class OAuthRegisteredClientsStore (Protocol ):
@@ -61,7 +61,7 @@ class OAuthRegisteredClientsStore(Protocol):
6161 Corresponds to OAuthRegisteredClientsStore in src/server/auth/clients.ts
6262 """
6363
64- async def get_client (self , client_id : str ) -> Optional [ OAuthClientInformationFull ] :
64+ async def get_client (self , client_id : str ) -> OAuthClientInformationFull | None :
6565 """
6666 Retrieves client information by client ID.
6767
@@ -170,7 +170,7 @@ async def exchange_refresh_token(
170170 self ,
171171 client : OAuthClientInformationFull ,
172172 refresh_token : RefreshToken ,
173- scopes : List [str ],
173+ scopes : list [str ],
174174 ) -> TokenSuccessResponse :
175175 """
176176 Exchanges a refresh token for an access token.
0 commit comments