There’s a number of reasons we’d want a list-files (
ls) command in gaia hubs. The biggest is data migration and portability. In order for a user to truly be able to migrate all their data (or see all their data), they’d need to be able to see all the files that the gaia hub is storing on their behalf (because an application may not show them that information). This has also been requested a number of times (example: Feature Request: Gaia `ls` functionality)
Supporting this requires 2 spec changes:
- Gaia hub driver model
- Gaia hub API
Gaia Hub Driver Model Changes
This proposal would extend the gaia hub driver model to support listing files with a given prefix:
listFiles(prefix: string) : Promise<Array<string>>
This returns all of the files which begin with the given prefix.
This would add a new
HTTP GET route to the gaia hub:
This requires a valid authentication token for
<hub-address> (see the Gaia authentication docs: https://github.com/blockstack/gaia#address-based-access-control)
How should we best support pagination?
If we want to limit the return size of these requests, we’ll need to support pagination, but many backend drivers will have different methods of doing their own pagination, and we wouldn’t want to act a buffer here.
Tagging @jude for comments