8000 fix(sources): let Google Drive sign in with a service account key file by adeelahmad · Pull Request #266 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(sources): let Google Drive sign in with a service account key file - #266

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-t4quwz
Oct 10, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-t4quwz

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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 .json key 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_credentials secret and the team_drive and impersonate fields. The key is checked (must be type: service_account with client_email and private_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

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV


Generated by Claude Code

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
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
…-private-key

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV
@adeelahmad
adeelahmad merged commit 15c4f67 into main Oct 10, 2026
7 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-t4quwz branch October 10, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0