Repository navigation
fix(sources): let Google Drive sign in with a service account key file - #266
Merged
Merged
Conversation
Drive connections only took a token pasted from rclone authorize, so a service account JSON key had nowhere to go (the API refused it as an unknown option). Drive now takes service_account_credentials (checked and stored on one line, as rclone reads it), plus team_drive and impersonate. The connection dialog gets a Google account / Service account switch with a key file upload. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV
…-private-key Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV
19 of 22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: a Google Drive connection only took a token pasted from
rclone authorize drive. A service account's JSON key had nowhere to go in the dialog, and the API refused it (drive has no option service_account_credentials).After: the Drive dialog has a Google account / Service account switch. Service account takes the
.jsonkey file as an upload, shows the address it signs in as, and offers optional shared drive ID and "act as user" (Workspace domain-wide delegation).How: Drive gains the
service_account_credentialssecret and theteam_driveandimpersonatefields. The key is checked (must betype: service_accountwithclient_emailandprivate_key) and stored compacted to one line, because rclone's config is line-based and the pretty-printed file would break it. Saving one sign-in method clears the other, since rclone prefers the service account when both are set. Checked by hand against rclone v1.75.2: the generated config makes rclone sign a JWT and request a Google token (previously:empty token found).Motivation and Context
Reported in the project thread: Google Drive service-account auth didn't work.
Types of changes
Checklist:
docs/accordingly.🤖 Generated with Claude Code
https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV
Generated by Claude Code