iterative / PyDrive2

Google Drive API Python wrapper library. Maintained fork of PyDrive.
https://docs.iterative.ai/PyDrive2
Other
581 stars 69 forks source link

fs: simplify auth #193

Closed efiop closed 2 years ago

efiop commented 2 years ago

We are currently creating auth ourselves in https://github.com/iterative/dvc-objects/blob/main/src/dvc_objects/fs/implementations/gdrive.py , which is very messy and still relies on a convention of keeping the creds files in tmp_dir provided by dvc. It would be great to simplify the authentication and not require tmp_dir (make it optional) and make it about as easy to use as gdrivefs https://github.com/fsspec/gdrivefs/blob/083996b503194424d11772570077fffdab758377/gdrivefs/core.py#L44

shcheklein commented 2 years ago

So, there are two separate things:

Not sure this way this ticket is actionable. I feel we need to better understand the credentials flow in DVC itself first for dvc get scenarios. E.g. we should agree that will be writing into appdir not into repo.tmp_dir by default. Clearly it will have certain implications (project will affect each other).

efiop commented 2 years ago

Right now auth is complex for the fs user (e.g. I really don't want to be forced to generate GoogleAuth myself). Some friendly user-facing config options in __init__ is what we want for simple cases.

gdrivefs is using pydata conventions and stashes a cached creds file there, which is limiting, but at least it is human-friendly. We need to do similar thing in pydrive2fs, but be a bit more general, maybe. I don't feel comfortable using pydata-google-auth directly, as it seems to be a bit dead and poorly maintained (e.g. red CI) and strictly speaking pydrive2 has nothing to do with pydata anyways, so it would be werid depending on it.