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

How to configure credentials #20

Open
mxmlnkn opened this issue Oct 12, 2024 · 4 comments
Open

How to configure credentials #20

mxmlnkn opened this issue Oct 12, 2024 · 4 comments

Comments

@mxmlnkn
Copy link

mxmlnkn commented Oct 12, 2024

I read the ReadMe and saw this issue: #2
But how do I specify that token? I have tried: fsspec.open("dropbox:///path?token=123) but that did not work.

Furthermore, I am confused about which token to use. After creating the app, I also have the App key, App secrete, and the very long OAuth 2 token with the "do not share" warning. I assume that this one is to be used? What then are the app key and secret for? This sounds like something that could also be used for access and could be shipped with an app.

@MarineChap
Copy link
Collaborator

Indeed, the token you need to use is the OAuth2 token obtained on your docker app.

There is probably a way with app key/secret but I did not explore it.

@mxmlnkn
Copy link
Author

mxmlnkn commented Oct 12, 2024

Thanks, that seems to work. It seems there is no way to specify the token with the URL scheme. It would be nice if there was an environment variable DROPBOX_TOKEN or maybe a file ~/.config/dropbox.token that would be used.

Another issue I had is that I was failing to list the root directory because ls("/") does not work. ls("") does work though. I think this implementation detail o the dropbox SDK should be hidden by dropboxdrivefs.

dropbox.exceptions.BadInputError: BadInputError('12345',
'Error in call to API function "files/list_folder": 
request body: path: Specify the root folder as an empty string rather than as "/".')
import os
from dropboxdrivefs import DropboxDriveFileSystem as DFS

fs = DFS(token=os.environ["DROPBOX_TOKEN"])

print(fs.stat("/single-file.tar"))
print(fs.ls(""))
print(fs.ls("/"))

@mxmlnkn
Copy link
Author

mxmlnkn commented Oct 12, 2024

Btw, having to use that token, which seems to only have read access to the corresponding app folder, does that mean that this project cannot be used to access public Dropbox shares?

@MarineChap
Copy link
Collaborator

For your first comment, sound like good ideas. You were welcome to do a pr.

For your second comment, it depends on the setting used to create the token. I was using it on public share of Dropbox. But I did not recreate a token in few years now.

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

No branches or pull requests

2 participants