Skip to content

Commit 6b119d9

Browse files
committed
Reorganize AuthInfo
1 parent 6d24518 commit 6b119d9

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

src/mcp/server/auth/middleware/bearer_auth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
from starlette.requests import HTTPConnection
1111
from starlette.types import Scope
1212

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
1514

1615

1716
class AuthenticatedUser(SimpleUser):

src/mcp/server/auth/provider.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from pydantic import AnyHttpUrl, BaseModel
55

6-
from mcp.server.auth.types import AuthInfo
76
from mcp.shared.auth import (
87
OAuthClientInformationFull,
98
OAuthToken,
@@ -33,6 +32,13 @@ class RefreshToken(BaseModel):
3332
expires_at: int | None = None
3433

3534

35+
class AuthInfo(BaseModel):
36+
token: str
37+
client_id: str
38+
scopes: list[str]
39+
expires_at: int | None = None
40+
41+
3642
class OAuthRegisteredClientsStore(Protocol):
3743
async def get_client(self, client_id: str) -> OAuthClientInformationFull | None:
3844
"""

src/mcp/server/auth/types.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/server/fastmcp/auth/test_auth_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from starlette.routing import Mount
2121

2222
from mcp.server.auth.provider import (
23+
AuthInfo,
2324
AuthorizationCode,
2425
AuthorizationParams,
2526
OAuthRegisteredClientsStore,
@@ -32,7 +33,6 @@
3233
RevocationOptions,
3334
create_auth_router,
3435
)
35-
from mcp.server.auth.types import AuthInfo
3636
from mcp.server.fastmcp import FastMCP
3737
from mcp.shared.auth import (
3838
OAuthClientInformationFull,

0 commit comments

Comments
 (0)