Skip to content

Commit d941508

Browse files
committed
fix pyright
1 parent 6488b40 commit d941508

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

examples/servers/simple-auth/mcp_simple_auth/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ async def exchange_authorization_code(
214214

215215
return OAuthToken(
216216
access_token=mcp_token,
217-
token_type="bearer",
217+
token_type="Bearer",
218218
expires_in=3600,
219219
scope=" ".join(authorization_code.scopes),
220220
)

tests/client/test_auth.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def oauth_client_info():
9191
def oauth_token():
9292
return OAuthToken(
9393
access_token="test_access_token",
94-
token_type="bearer",
94+
token_type="Bearer",
9595
expires_in=3600,
9696
refresh_token="test_refresh_token",
9797
scope="read write",
@@ -374,7 +374,7 @@ async def test_has_valid_token_expired(self, oauth_provider, oauth_token):
374374
@pytest.mark.anyio
375375
async def test_validate_token_scopes_no_scope(self, oauth_provider):
376376
"""Test scope validation with no scope returned."""
377-
token = OAuthToken(access_token="test", token_type="bearer")
377+
token = OAuthToken(access_token="test", token_type="Bearer")
378378

379379
# Should not raise exception
380380
await oauth_provider._validate_token_scopes(token)
@@ -385,7 +385,7 @@ async def test_validate_token_scopes_valid(self, oauth_provider, client_metadata
385385
oauth_provider.client_metadata = client_metadata
386386
token = OAuthToken(
387387
access_token="test",
388-
token_type="bearer",
388+
token_type="Bearer",
389389
scope="read write",
390390
)
391391

@@ -398,7 +398,7 @@ async def test_validate_token_scopes_subset(self, oauth_provider, client_metadat
398398
oauth_provider.client_metadata = client_metadata
399399
token = OAuthToken(
400400
access_token="test",
401-
token_type="bearer",
401+
token_type="Bearer",
402402
scope="read",
403403
)
404404

@@ -413,7 +413,7 @@ async def test_validate_token_scopes_unauthorized(
413413
oauth_provider.client_metadata = client_metadata
414414
token = OAuthToken(
415415
access_token="test",
416-
token_type="bearer",
416+
token_type="Bearer",
417417
scope="read write admin", # Includes unauthorized "admin"
418418
)
419419

@@ -427,7 +427,7 @@ async def test_validate_token_scopes_no_requested(self, oauth_provider):
427427
oauth_provider.client_metadata.scope = None
428428
token = OAuthToken(
429429
access_token="test",
430-
token_type="bearer",
430+
token_type="Bearer",
431431
scope="admin super",
432432
)
433433

@@ -534,7 +534,7 @@ async def test_refresh_access_token_success(
534534

535535
new_token = OAuthToken(
536536
access_token="new_access_token",
537-
token_type="bearer",
537+
token_type="Bearer",
538538
expires_in=3600,
539539
refresh_token="new_refresh_token",
540540
scope="read write",
@@ -567,7 +567,7 @@ async def test_refresh_access_token_no_refresh_token(self, oauth_provider):
567567
"""Test token refresh with no refresh token."""
568568
oauth_provider._current_tokens = OAuthToken(
569569
access_token="test",
570-
token_type="bearer",
570+
token_type="Bearer",
571571
# No refresh_token
572572
)
573573

tests/server/fastmcp/auth/test_auth_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async def exchange_authorization_code(
9696

9797
return OAuthToken(
9898
access_token=access_token,
99-
token_type="bearer",
99+
token_type="Bearer",
100100
expires_in=3600,
101101
scope="read write",
102102
refresh_token=refresh_token,
@@ -160,7 +160,7 @@ async def exchange_refresh_token(
160160

161161
return OAuthToken(
162162
access_token=new_access_token,
163-
token_type="bearer",
163+
token_type="Bearer",
164164
expires_in=3600,
165165
scope=" ".join(scopes) if scopes else " ".join(token_info.scopes),
166166
refresh_token=new_refresh_token,

0 commit comments

Comments
 (0)