Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dropbox): add root_namespace_id to access teams folder #5929

Merged
merged 4 commits into from
Jan 24, 2024

Conversation

shouko
Copy link
Contributor

@shouko shouko commented Jan 21, 2024

Just started using this tool recently, it's a great project!
Still not very familiar with the codebase or golang, feel free to provide feedback and suggestions.

It's been quickly tested with my Dropbox Business account manually, now it's able to see teams folders.

Background

Related to #5126 and #5760

Sending Dropbox API request without a Dropbox-API-Path-Root header defaults to user home namespace.
To access Dropbox Team Space, proper namespace needs to be provided.

Namespace IDs can be obtained from /2/users/get_current_account.
For non-business users, root_info.root_namespace_id and root_info.home_namespace_id seem to be identical values.

For Business users, setting root_namespace_id in Dropbox-API-Path-Root header allows API client to start from a higher level root where the requesting user's personal home as well as other shared folders can be seen at the same time.

Changes

  • Makes a request to get namespace IDs in Init
  • Set Dropbox-API-Path-Root header in request method when d.RootNamespaceId is available

References

Copy link

welcome bot commented Jan 21, 2024

Thanks for opening this pull request! Please check out our contributing guidelines.

@shouko shouko force-pushed the feat/dropbox-team-drive branch from 4b95846 to 367e9b2 Compare January 21, 2024 12:33
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 21, 2024
@xhofe xhofe merged commit aef952a into AlistGo:main Jan 24, 2024
3 checks passed
Copy link

welcome bot commented Jan 24, 2024

Congrats on merging your first pull request! We here at behavior bot are proud of you!

EtherealAO pushed a commit to EtherealAO/alist that referenced this pull request Apr 12, 2024
…5929)

* feat(dropbox): add root_namespace_id to access teams folder

* fix(dropbox): get_current_account API request

* feat(dropbox): extract root_namespace_id properly

* style: format code
EtherealAO pushed a commit to EtherealAO/alist that referenced this pull request Apr 12, 2024
…5929)

* feat(dropbox): add root_namespace_id to access teams folder

* fix(dropbox): get_current_account API request

* feat(dropbox): extract root_namespace_id properly

* style: format code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants