Merge branch 'main' of github.com:taylorwilsdon/google_workspace_mcp into add-chat-spaces-readonly-scope

This commit is contained in:
Taylor Wilsdon
2026-02-18 12:36:18 -05:00
20 changed files with 577 additions and 154 deletions

View File

@@ -54,6 +54,7 @@ from auth.scopes import (
SCRIPT_PROJECTS_READONLY_SCOPE,
SCRIPT_DEPLOYMENTS_SCOPE,
SCRIPT_DEPLOYMENTS_READONLY_SCOPE,
has_required_scopes,
)
logger = logging.getLogger(__name__)
@@ -275,7 +276,7 @@ async def get_authenticated_google_service_oauth21(
if not scopes_available and getattr(access_token, "scopes", None):
scopes_available = set(access_token.scopes)
if not all(scope in scopes_available for scope in required_scopes):
if not has_required_scopes(scopes_available, required_scopes):
raise GoogleAuthenticationError(
f"OAuth credentials lack required scopes. Need: {required_scopes}, Have: {sorted(scopes_available)}"
)
@@ -305,7 +306,7 @@ async def get_authenticated_google_service_oauth21(
else:
scopes_available = set(credentials.scopes)
if not all(scope in scopes_available for scope in required_scopes):
if not has_required_scopes(scopes_available, required_scopes):
raise GoogleAuthenticationError(
f"OAuth 2.1 credentials lack required scopes. Need: {required_scopes}, Have: {sorted(scopes_available)}"
)