distribits / distribits-2024-hackathon

1 stars 1 forks source link

Minimal/zero-dependency OpenNeuro git for DataLad #2

Open nellh opened 5 months ago

nellh commented 5 months ago

OpenNeuro provides direct git/git-annex access to datasets users have write permissions on (in addition to public mirrors on GitHub).

This is mediated by the OpenNeuro CLI, which is written in Javascript and uses the NodeJS runtime. NodeJS is notoriously cumbersome, especially for users not frequently using Node tools. A leaner set of standalone tools would help make this mode of access more accessible to users accustomed to git-annex/DataLad.

The features needed:

1) Store and access the user's long lived API key. 2) Request a short-lived dataset specific JWT and path value from the GraphQL API. 3) Use this short lived key and path to authenticate HTTPS git. 4) Support the OpenNeuro HTTPS git-annex special remote using the same authentication mechanism.

There is also a Deno implementation of the CLI as well (https://github.com/OpenNeuroOrg/openneuro/pull/3017) but it may be worth having a Python implementation to avoid JavaScript dependencies entirely.

1-3 could be DataladAuth?

The requirement for the path value could also be resolved on the OpenNeuro side (simplest would be to return a redirect but we could probably do this routing without one too).

effigies commented 5 months ago

If it's small enough, I was considering futzing around with Rust and distributing statically-linked binaries.