Add support for Dropbox team folders with path-root header#217
Open
neon-ninja wants to merge 1 commit into
Open
Add support for Dropbox team folders with path-root header#217neon-ninja wants to merge 1 commit into
neon-ninja wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the CLI’s Dropbox client initialization to automatically set the Dropbox-API-Path-Root header (so Dropbox Business team folders are accessible by default), and adjusts ls to better distinguish file vs folder paths (especially for root).
Changes:
- Auto-detect root namespace via
users.GetCurrentAccountand setDropbox-API-Path-Rootfor non-teamManagetokens. - Update
lsto avoid callingget_metadatafor the root path and to short-circuit when the target is a file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| cmd/root.go | Adds root-namespace auto-detection and configures Dropbox-API-Path-Root header generation. |
| cmd/ls.go | Improves file-vs-folder detection (and avoids root-path get_metadata errors). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
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.
This pull request improves the handling of Dropbox root namespaces to ensure team folders are accessible.
initDbx(incmd/root.go) to automatically detect and set the Dropbox root namespace header for non-admin tokens, making team folders accessible by default. This involves callingusers.GetCurrentAccountand setting theDropbox-API-Path-Rootheader (viaconfig.WithRoot) based on the user's or team's root namespace.usersandcommonpackages to support root namespace detection.