File tree Expand file tree Collapse file tree 4 files changed +9
-12
lines changed
tests/server/fastmcp/auth Expand file tree Collapse file tree 4 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 10
10
from starlette .requests import HTTPConnection
11
11
from starlette .types import Scope
12
12
13
- from mcp .server .auth .provider import OAuthServerProvider
14
- from mcp .server .auth .types import AuthInfo
13
+ from mcp .server .auth .provider import AuthInfo , OAuthServerProvider
15
14
16
15
17
16
class AuthenticatedUser (SimpleUser ):
Original file line number Diff line number Diff line change 3
3
4
4
from pydantic import AnyHttpUrl , BaseModel
5
5
6
- from mcp .server .auth .types import AuthInfo
7
6
from mcp .shared .auth import (
8
7
OAuthClientInformationFull ,
9
8
OAuthToken ,
@@ -33,6 +32,13 @@ class RefreshToken(BaseModel):
33
32
expires_at : int | None = None
34
33
35
34
35
+ class AuthInfo (BaseModel ):
36
+ token : str
37
+ client_id : str
38
+ scopes : list [str ]
39
+ expires_at : int | None = None
40
+
41
+
36
42
class OAuthRegisteredClientsStore (Protocol ):
37
43
async def get_client (self , client_id : str ) -> OAuthClientInformationFull | None :
38
44
"""
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 20
20
from starlette .routing import Mount
21
21
22
22
from mcp .server .auth .provider import (
23
+ AuthInfo ,
23
24
AuthorizationCode ,
24
25
AuthorizationParams ,
25
26
OAuthRegisteredClientsStore ,
32
33
RevocationOptions ,
33
34
create_auth_router ,
34
35
)
35
- from mcp .server .auth .types import AuthInfo
36
36
from mcp .server .fastmcp import FastMCP
37
37
from mcp .shared .auth import (
38
38
OAuthClientInformationFull ,
You can’t perform that action at this time.
0 commit comments