Sentiaus opened a new pull request, #5721: URL: https://github.com/apache/texera/pull/5721
### What changes were proposed in this PR? Adds a Google Drive OAuth flow that allows users to export workflows and datasets to Drive, with **no server-side token storage of any kind**. **Backend (`GoogleDriveAuthResource`):** - `GET /auth/google/drive/connect` — generates a Google OAuth URL scoped to `drive.file` with a CSRF state token (10-minute TTL), returns it to the frontend - `GET /auth/google/drive/callback` — exchanges the authorization code for an access token, uses it immediately to confirm the connection, then discards it. Posts a success or error message back to the opener window via `postMessage` and closes the popup. After discussing with @aicam over the earlier designs, the following were intentionally removed: - No `/token` endpoint — the access token is never returned to the frontend or stored - No `/disconnect` endpoint — there is no stored token to revoke - No database table for OAuth credentials - No refresh token storage or encryption - No `reauth` flow — the standard OAuth redirect handles re-authorization naturally **Frontend:** - New `DriveService` with a `connect()` method that opens the OAuth popup and returns an `Observable<void>` that completes on success - The Download button on list items is replaced with an Export dropdown (Download / Export to Drive) - `exportMenuVisible` tracks dropdown open state and applies a visual highlight to the card via the `export-menu-open` CSS class --- ### Any related issues, documentation, discussions? #4240 Related to the Google Drive integration effort. This is the first PR in a two-part series: 1. This PR — OAuth connect flow and Export to Drive entry point 2. Follow-up PR — Google Drive Picker for folder selection, then backend streaming from MinIO to Drive via resumable upload session URI --- ### How was this PR tested? **Backend:** Unit tests added in `GoogleDriveAuthResourceSpec.scala` covering: - Empty `code` or `state` parameters return error HTML - Expired/unknown state token returns error HTML - OAuth URL contains `drive.file` scope - OAuth URL contains a `state=` parameter **Frontend:** Unit tests added/updated in `drive.service.spec.ts` and `list-item.component.spec.ts` covering: - `DriveService.connect()` fetches the URL and opens a popup - Observable completes when popup posts `gdrive-connected` - Observable errors when popup posts `gdrive-error` - Cross-origin messages are ignored - `onClickExportToDrive()` calls `driveService.connect()` - Success and error notifications fire correctly --- ### Was this PR authored or co-authored using generative AI tooling? Co-authored by: Claude Sonnet 4.6 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
