Skip to content

Commit dfcba82

Browse files
committed
Get rid of silly TS comments
1 parent e88b4aa commit dfcba82

File tree

11 files changed

+1
-96
lines changed

11 files changed

+1
-96
lines changed

src/mcp/server/auth/errors.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
OAuth error classes for MCP authorization.
3-
4-
Corresponds to TypeScript file: src/server/auth/errors.ts
5-
"""
6-
71
from typing import Literal
82

93
from pydantic import BaseModel, ValidationError
@@ -19,8 +13,6 @@ class ErrorResponse(BaseModel):
1913
class OAuthError(Exception):
2014
"""
2115
Base class for all OAuth errors.
22-
23-
Corresponds to OAuthError in src/server/auth/errors.ts
2416
"""
2517

2618
error_code: ErrorCode
@@ -39,8 +31,6 @@ def error_response(self) -> ErrorResponse:
3931
class InvalidRequestError(OAuthError):
4032
"""
4133
Invalid request error.
42-
43-
Corresponds to InvalidRequestError in src/server/auth/errors.ts
4434
"""
4535

4636
error_code = "invalid_request"
@@ -49,8 +39,6 @@ class InvalidRequestError(OAuthError):
4939
class InvalidClientError(OAuthError):
5040
"""
5141
Invalid client error.
52-
53-
Corresponds to InvalidClientError in src/server/auth/errors.ts
5442
"""
5543

5644
error_code = "invalid_client"

src/mcp/server/auth/handlers/authorize.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Handler for OAuth 2.0 Authorization endpoint.
3-
4-
Corresponds to TypeScript file: src/server/auth/handlers/authorize.ts
5-
"""
6-
71
import logging
82
from dataclasses import dataclass
93
from typing import Literal

src/mcp/server/auth/handlers/metadata.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Handler for OAuth 2.0 Authorization Server Metadata.
3-
4-
Corresponds to TypeScript file: src/server/auth/handlers/metadata.ts
5-
"""
6-
71
from dataclasses import dataclass
82
from typing import Any
93

src/mcp/server/auth/handlers/register.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Handler for OAuth 2.0 Dynamic Client Registration.
3-
4-
Corresponds to TypeScript file: src/server/auth/handlers/register.ts
5-
"""
6-
71
import secrets
82
import time
93
from dataclasses import dataclass

src/mcp/server/auth/handlers/revoke.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Handler for OAuth 2.0 Token Revocation.
3-
4-
Corresponds to TypeScript file: src/server/auth/handlers/revoke.ts
5-
"""
6-
71
from dataclasses import dataclass
82
from typing import Literal
93

src/mcp/server/auth/handlers/token.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Handler for OAuth 2.0 Token endpoint.
3-
4-
Corresponds to TypeScript file: src/server/auth/handlers/token.ts
5-
"""
6-
71
import base64
82
import hashlib
93
import time

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Bearer token authentication middleware for ASGI applications.
3-
4-
Corresponds to TypeScript file: src/server/auth/middleware/bearerAuth.ts
5-
"""
6-
71
import time
82
from typing import Any, Callable
93

@@ -65,8 +59,6 @@ class RequireAuthMiddleware:
6559
6660
This will validate the token with the auth provider and store the resulting
6761
auth info in the request state.
68-
69-
Corresponds to bearerAuthMiddleware in src/server/auth/middleware/bearerAuth.ts
7062
"""
7163

7264
def __init__(self, app: Any, required_scopes: list[str]):

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Client authentication middleware for ASGI applications.
3-
4-
Corresponds to TypeScript file: src/server/auth/middleware/clientAuth.ts
5-
"""
6-
71
import time
82

93
from pydantic import BaseModel
@@ -14,12 +8,7 @@
148

159

1610
class ClientAuthRequest(BaseModel):
17-
"""
18-
Model for client authentication request body.
19-
20-
Corresponds to ClientAuthenticatedRequestSchema in
21-
src/server/auth/middleware/clientAuth.ts
22-
"""
11+
# TODO: mix this directly into TokenRequest
2312

2413
client_id: str
2514
client_secret: str | None = None

src/mcp/server/auth/router.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Router for OAuth authorization endpoints.
3-
4-
Corresponds to TypeScript file: src/server/auth/router.ts
5-
"""
6-
71
from dataclasses import dataclass
82
from typing import Any
93

@@ -72,8 +66,6 @@ def create_auth_router(
7266
"""
7367
Create a Starlette router with standard MCP authorization endpoints.
7468
75-
Corresponds to mcpAuthRouter in src/server/auth/router.ts
76-
7769
Args:
7870
provider: OAuth server provider
7971
issuer_url: Issuer URL for the authorization server

src/mcp/server/auth/types.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
"""
2-
Authorization types for MCP server.
3-
4-
Corresponds to TypeScript file: src/server/auth/types.ts
5-
"""
6-
71
from pydantic import BaseModel
82

93

104
class AuthInfo(BaseModel):
11-
"""
12-
Information about a validated access token, provided to request handlers.
13-
14-
Corresponds to AuthInfo in src/server/auth/types.ts
15-
"""
16-
175
token: str
186
client_id: str
197
scopes: list[str]

src/mcp/shared/auth.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""
2-
Authorization types and models for MCP OAuth implementation.
3-
4-
Corresponds to TypeScript file: src/shared/auth.ts
5-
"""
6-
71
from typing import Any, List, Literal, Optional
82

93
from pydantic import AnyHttpUrl, BaseModel, Field
@@ -60,8 +54,6 @@ class OAuthClientMetadata(BaseModel):
6054
class OAuthClientInformation(BaseModel):
6155
"""
6256
RFC 7591 OAuth 2.0 Dynamic Client Registration client information.
63-
64-
Corresponds to OAuthClientInformationSchema in src/shared/auth.ts
6557
"""
6658

6759
client_id: str
@@ -74,8 +66,6 @@ class OAuthClientInformationFull(OAuthClientMetadata, OAuthClientInformation):
7466
"""
7567
RFC 7591 OAuth 2.0 Dynamic Client Registration full response
7668
(client information plus metadata).
77-
78-
Corresponds to OAuthClientInformationFullSchema in src/shared/auth.ts
7969
"""
8070

8171
pass
@@ -84,8 +74,6 @@ class OAuthClientInformationFull(OAuthClientMetadata, OAuthClientInformation):
8474
class OAuthClientRegistrationError(BaseModel):
8575
"""
8676
RFC 7591 OAuth 2.0 Dynamic Client Registration error response.
87-
88-
Corresponds to OAuthClientRegistrationErrorSchema in src/shared/auth.ts
8977
"""
9078

9179
error: str
@@ -95,8 +83,6 @@ class OAuthClientRegistrationError(BaseModel):
9583
class OAuthMetadata(BaseModel):
9684
"""
9785
RFC 8414 OAuth 2.0 Authorization Server Metadata.
98-
99-
Corresponds to OAuthMetadataSchema in src/shared/auth.ts
10086
"""
10187

10288
issuer: str

0 commit comments

Comments
 (0)