Repository navigation
feat(sources): connect Google Drive with Connect with Google - #417
Merged
Merged
Conversation
adeelahmad
force-pushed
the
claude/project-thread-kkr74u
branch
3 times, most recently
from
October 15, 2026 15:02
8fc7015 to
0e438aa
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrczAC5nKz1zkCUvRKXG5C
adeelahmad
force-pushed
the
claude/project-thread-kkr74u
branch
from
October 15, 2026 15:15
0e438aa to
b9f0c4a
Compare
Drive's Google account mode connects through Lens's Google client in one click when it has one, shows the account it is connected as, and keeps rclone and a Google app of your own a click away. Docs, changelog and threat model follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrczAC5nKz1zkCUvRKXG5C
adeelahmad
force-pushed
the
claude/project-thread-kkr74u
branch
from
October 15, 2026 15:15
b9f0c4a to
0ad789c
Compare
Merged
16 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.
Description
Before: a Google Drive connection could sign in as a Google account only through rclone (signing in on the server, or pasting a token from
rclone authorize), or as a service account.After: when Lens has a Google OAuth client (the Google sign-in provider's, or an earlier Google connection's), a new Drive connection's Google account option is Connect with Google. One click saves the connection and opens Google's consent screen. Google then sends you back to Sources with the account connected, and the connection shows "as mara@…". Read only asks Google for
drive.readonly; Full access asks for all of Drive.With no client, Drive signs in through rclone as before. Connect through your own Google app instead takes a client ID and secret and shows the redirect URI to register. Either way, the other route is one link away. A Drive connection whose sign-in stopped working shows Connect Google account on its row.
How: Drive joins #407's shared Connect with Google flow through a new
gdrive.py(SCOPES(params)andkeep). rclone keeps a Google account as its own token JSON and renews it with the client in its config. So the source keeps rclone's token shape, the client's id as a parameter (client_id), and its secret sealed (client_secret); the connected address isaccount, which is never passed to rclone. A token that comes from rclone (signed in through rclone, or pasted) renews with rclone's own client, sosources.updatedrops a client left over from before.Motivation and Context
Adeel asked for Drive as a sensor through OAuth and a service account, with an optional root folder (#410 and #411 shipped the root-folder link and the rclone sign-in). This brings Drive onto the same one-click Google flow as Calendar and Gmail.
Types of changes
!in the title)Checklist:
tests/api/test_drive_google.pyruns against the fake Google. It covers the rclone config Drive gets (token shape, client, parsed root folder, noaccount), full scope, and how a token from rclone drops the client.__tests__/drive-google.test.tsxcovers the one-click connect, the rclone default with no client, your own app, connecting again, and the model.docs/accordingly (docs/processing.md, Storage sources).## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
POST /sources/rclone-signin), or saves a token through the API. The consent step itself is a person's, as in feat(sources): Connect with Google for Google Calendar connections #407.google.tokenrow in the activity ledger.client_idandaccountdefault to empty, and an old source without them behaves as before.openapi-checkclean).🤖 Generated with Claude Code
https://claude.ai/code/session_01VrczAC5nKz1zkCUvRKXG5C