Skip to content

Add support for Dropbox team folders with path-root header#217

Open
neon-ninja wants to merge 1 commit into
dropbox:masterfrom
UoA-eResearch:master
Open

Add support for Dropbox team folders with path-root header#217
neon-ninja wants to merge 1 commit into
dropbox:masterfrom
UoA-eResearch:master

Conversation

@neon-ninja

@neon-ninja neon-ninja commented Mar 17, 2026

Copy link
Copy Markdown

This pull request improves the handling of Dropbox root namespaces to ensure team folders are accessible.

  • Added logic in initDbx (in cmd/root.go) to automatically detect and set the Dropbox root namespace header for non-admin tokens, making team folders accessible by default. This involves calling users.GetCurrentAccount and setting the Dropbox-API-Path-Root header (via config.WithRoot) based on the user's or team's root namespace.
  • Added new imports for users and common packages to support root namespace detection.

Copilot AI review requested due to automatic review settings March 17, 2026 22:32
@CLAassistant

CLAassistant commented Mar 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.GetCurrentAccount and set Dropbox-API-Path-Root for non-teamManage tokens.
  • Update ls to avoid calling get_metadata for 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.

Comment thread cmd/ls.go
Comment thread cmd/root.go
Comment thread cmd/root.go Outdated
Comment thread cmd/root.go
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.

3 participants