Skip to content

feat: gdrive export frontend service integration#5251

Open
Sentiaus wants to merge 7 commits into
apache:mainfrom
Sentiaus:gdrive/service
Open

feat: gdrive export frontend service integration#5251
Sentiaus wants to merge 7 commits into
apache:mainfrom
Sentiaus:gdrive/service

Conversation

@Sentiaus
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds the frontend service layer for Google Drive integration. No UI surfaces are changed in this PR — those are in the follow-up.

DriveService (drive.service.ts): New injectable service with four responsibilities:

  • getToken() — calls GET /api/auth/google/drive/token and returns the connection status and short-lived access token
  • connect(reauth?) — opens a popup to the /connect URL; emits on onConnected() when the OAuth flow completes
  • onConnected() — observable that fires when the popup posts a gdrive-connected window message
  • exportToDrive(blob, fileName) — opens the Google Picker folder selector, then uploads the blob to the chosen folder via the Drive multipart upload API

GoogleDriveConnectComponent: OAuth callback landing page at /gdrive-connect. Receives the authorization code from Google's redirect, posts a gdrive-connected message to the opener window, and closes itself.

Routing: Adds /gdrive-connect to the app router pointing at GoogleDriveConnectComponent.

index.html: Injects the gapi and Google Identity Services scripts needed by the Picker API.

Any related issues, documentation, discussions?

Closes #4240 (partial — UI wiring in follow-up PR)

How was this PR tested?

Unit tests in drive.service.spec.ts and google-drive-connect.component.spec.ts covering:

  • getToken() returns status and access token
  • connect() opens a popup and onConnected() emits on message receipt
  • exportToDrive() calls the Drive multipart upload API and resolves

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Sonnet 4.6

Sentiaus and others added 4 commits May 26, 2026 23:59
… DB schema

- Add user_oauth_token table to store encrypted OAuth refresh tokens per provider
- Add TokenEncryptionService using jose4j AES-256-GCM for encrypting auth blobs
- Add AuthConfig.encryptionSecretKey reading from auth.encryption.256-bit-secret
- Add GoogleDriveAuthResource with /connect, /callback, and /token endpoints
- Add GoogleAuthResource config endpoint exposing client ID and redirect URI
- Add DriveTokenIssueResponse and GoogleAuthConfigResponse HTTP models
- Wire GoogleDriveAuthResource into TexeraWebApplication and GuestAuthFilter
- Add google.client-id, client-secret, and app-domain to UserSystemConfig
- Update k8s values with new config keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd error case

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added engine ddl-change Changes to the TexeraDB DDL frontend Changes related to the frontend GUI dev common labels May 27, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.95%. Comparing base (d8c254c) to head (9ebbe10).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5251      +/-   ##
============================================
- Coverage     48.95%   48.95%   -0.01%     
  Complexity     2377     2377              
============================================
  Files          1048     1048              
  Lines         40270    40269       -1     
  Branches       4272     4272              
============================================
- Hits          19714    19713       -1     
  Misses        19402    19402              
  Partials       1154     1154              
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø)
agent-service 33.76% <ø> (ø) Carriedforward from a0b97fa
amber 51.56% <ø> (-0.01%) ⬇️ Carriedforward from a0b97fa
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 37.99% <ø> (ø)
frontend 40.64% <ø> (ø) Carriedforward from a0b97fa
python 90.79% <ø> (ø) Carriedforward from a0b97fa
workflow-compiling-service 56.81% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Sentiaus Sentiaus changed the title Gdrive/service feat: gdrive export frontend service integration May 27, 2026
@Sentiaus Sentiaus mentioned this pull request May 27, 2026
5 tasks
@chenlica chenlica requested a review from xuang7 May 28, 2026 00:12
Sentiaus and others added 3 commits May 28, 2026 00:31
…ogleDriveAuthResource

OAuth state is now a UUID stored in a ConcurrentHashMap with a 10-minute TTL,
consumed exactly once on callback. Removes JwtParser/JwtAuth dependency from
the Drive resource and avoids encoding user info in the callback URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rive

- Add DriveService to manage Drive token retrieval, OAuth connection, and file export
- Add GoogleDriveConnectComponent as the OAuth callback landing page
- Add /gdrive-connect route to the app router
- Inject gapi and Google Identity Services scripts into index.html

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot removed the dev label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common ddl-change Changes to the TexeraDB DDL engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export to external storage

2 participants