Repository navigation
feat(sources): sign in to Dropbox, OneDrive and Drive through rclone on the server - #411
Merged
Merged
Conversation
…on the server Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VrczAC5nKz1zkCUvRKXG5C
This was referenced Oct 15, 2026
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: connecting Dropbox, OneDrive or Google Drive as a Google account meant installing rclone on another computer, running
rclone authorize dropboxthere, and pasting the JSON it printed into Lens. A token that stopped working showed "Paste new token", and the whole round trip started again.After: those connections have Sign in with Dropbox (or Microsoft, or Google). The service's page opens in a new tab, Lens runs
rclone authorizeon its own server, and you sign in and allow rclone. The service then sends the tab tohttp://127.0.0.1:53682/?state=…&code=…. On the machine Lens runs on, rclone receives that itself and the dialog carries on with nothing to paste. Anywhere else that page doesn't load, so you paste its address into the dialog, which fills it in as soon as it looks right. After that the connection is made and tested, OneDrive's own drive is filled in, and the dialog goes on to the test-and-name step. "Paste new token" is now "Sign in again". Pasting a token from rclone still works through "Paste a token from rclone instead".How:
rclone_signin.pystartsrclone authorize <type> [options] --auth-no-open-browserwith a private config, reads the service's link, and keeps one sign-in at a time (rclone_signin:<id>, ten minutes).state,codeanderror, and only when the state is this sign-in's.POST /sources/rclone-signin,POST /sources/rclone-signin/{id},DELETE /sources/rclone-signin/{id}.rclone_signinis declared in the schema, because SurrealDB 3 refuses to SELECT from a table nobody has written to yet.Motivation and Context
Adeel asked for Drive to connect "through OAuth and through a service account" as a sensor. This gives Drive OAuth with no Google Cloud app at all, and Dropbox and OneDrive get the same. Drive's Connect with Google, through the user's own app, joins #407's shared flow once that merges. It replaces part of the closed #404.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
POST /sources/rclone-signin, hands its personurl, then posts the address they paste back (tested intest_signing_in_again_and_agents). A read-only token gets 403./sources/rclone-signin: rclone listens on 127.0.0.1:53682 for up to ten minutes, one sign-in at a time, and only the state, code and error from a matching address are passed to it. Admin only, and the action is audited assource.signin.DEFINE TABLE IF NOT EXISTS). Stored sources keep the same shape.test_rclone_signin.pyruns 6 tests against a stand-inrclone authorize,rclone-signin.test.tsxadds 4, and the model tests are updated. Also updateddocs/processing.mdand the CHANGELOG, and regenerated the client withmake openapi. Locally the full backend suite passed (1097) on the branch before the rebase, and all 890 frontend tests passed after it.🤖 Generated with Claude Code
https://claude.ai/code/session_01VrczAC5nKz1zkCUvRKXG5C
Generated by Claude Code