feat: implement --read-only mode with tool filtering
- Adds --read-only CLI flag to restrict OAuth scopes to read-only permissions - Implements dynamic tool filtering to disable tools requiring write permissions when in read-only mode - Updates auth/scopes.py to manage read-only scope mappings - Enhances @require_google_service and handle_http_errors decorators to propagate scope metadata - Updates documentation in README.md
This commit is contained in:
@@ -336,6 +336,10 @@ def handle_http_errors(
|
||||
logger.exception(message)
|
||||
raise Exception(message) from e
|
||||
|
||||
# Propagate _required_google_scopes if present (for tool filtering)
|
||||
if hasattr(func, "_required_google_scopes"):
|
||||
wrapper._required_google_scopes = func._required_google_scopes
|
||||
|
||||
return wrapper
|
||||
|
||||
return decorator
|
||||
|
||||
Reference in New Issue
Block a user