feat: granular permissions for Google Drive integration#921
feat: granular permissions for Google Drive integration#921jeremyeder wants to merge 2 commits intomainfrom
Conversation
Add file-level (drive.file) permissions for Google Drive integration, replacing the default full-drive access scope. Users select specific files via the Google Picker instead of granting access to all Drive files. Backend: - Add DriveIntegration and FileGrant models with state machines - Add K8s ConfigMap/Secret-backed storage for integrations and tokens - Add OAuth scope constants and GetGoogleDriveScopes() helper - Add drive integration handlers (setup, callback, picker-token, get, disconnect) - Add file grant handlers (list, update with add/remove counting) - Add route registration with Unleash feature flag gating - Fix nil-pointer dereference in GetIntegration not-found path Frontend: - Add drive-api.ts service with React Query hooks for all endpoints - Add GooglePicker component wrapping Google Picker API - Add FileSelectionSummary component with mime-type icons - Add google-picker-loader for async script loading - Add alert-dialog Shadcn UI component - Add setup and settings pages for Drive integration Specs: - Add speckit artifacts (spec, plan, tasks, research, data-model, contracts, checklists, quickstart) Tests (80 total): - Backend: 40 tests (models, storage, integration, file grants) - Frontend: 35 tests (API client, components, loader) + 5 loader tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can validate your CodeRabbit configuration file in your editor.If your editor has YAML language server, you can enable auto-completion and validation by adding |
Register DriveIntegrationHandler and DriveFileGrantsHandler in the backend's route setup via InitDriveIntegration(). Constructs handlers from GOOGLE_OAUTH_CLIENT_ID/SECRET env vars, creates DriveStorage backed by the backend's K8s client, and registers routes under /api/projects/:projectName/integrations/google-drive/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Implements file-level (
drive.file) permissions for Google Drive integration (#918), replacing the default full-drive access scope. Users select specific files via the Google Picker instead of granting access to all Drive files.drive.file, new handlers for integration lifecycle and file grant CRUD, K8s ConfigMap/Secret storage, Unleash feature flag gatingKey changes
components/backend/models/drive.go— DriveIntegration and FileGrant models with state machinescomponents/backend/handlers/drive_*.go— integration, file grants, storage, routescomponents/backend/handlers/oauth.go— scope constants andGetGoogleDriveScopes()helpercomponents/frontend/src/services/drive-api.ts— API client with React Query hookscomponents/frontend/src/components/google-picker/— Picker and file summary componentscomponents/frontend/src/pages/integrations/google-drive/— setup and settings pagesspecs/001-granular-drive-permissions/— speckit artifactsTest plan
Closes #918
🤖 Generated with Claude Code