fix: subclass AccessToken with custom fields

This commit is contained in:
Chetan Sarva
2026-01-29 16:06:00 -05:00
parent 24dd57a8ad
commit 6cdbc7706a
3 changed files with 21 additions and 9 deletions

View File

@@ -89,12 +89,10 @@ class ExternalOAuthProvider(GoogleProvider):
f"Validated external access token for: {user_info['email']}"
)
# Create a mock AccessToken that the middleware expects
# This matches the structure that FastMCP's AccessToken would have
from types import SimpleNamespace
scope_list = list(getattr(self, "required_scopes", []) or [])
access_token = SimpleNamespace(
from auth.oauth_types import WorkspaceAccessToken
access_token = WorkspaceAccessToken(
token=token,
scopes=scope_list,
expires_at=int(time.time())