3

Is there a way to get sandboxed, user-selected directory access on any major file service without first getting read level access to their entire filesystem?

There's a lot of talk about "unhosted" static webapps that allow users to access their data from a 3rd party file service (Google Drive, Dropbox, their own server, etc.). The most notable effort I've found so far is remoteStorage.io, but there doesn't seem to be a way with any major provider to let the user select a directory and then use that as a sandbox without breaking their trust (i.e. getting read access to all their files first).

From the user's perspective, the webapp shouldn't have access to anything else on the remote file storage except the one folder the user grants it access to (for example, I might grant a text editor access to my FunnyJokes folder).

The current work around seems to be having the webapp force a specific folder name ahead of time ("this app wants access to /appname_notes"), but that rules out letting the user point it to where they may already have their notes.

Does anyone know of a nice way to do this with Google Drive, Dropbox, or the like?

The user experience that makes the most sense to me is something like...

  1. User opens an unhosted webapp (for example, a basic text editor TextyApp). They click a button to connect with their data.
  2. 3rd party auth page appears (for example, Google Drive) and it says "The app TextyApp has requested read/write access to your files. Please select a directory to use."
  3. Confirmation screen: "Grant read/write access to folder FunnyJokes for TextyApp?"
  4. The page redirects back to the webapp with sandboxed accessed to the user-specified folder and the files within it.

This seems like how remote file storage should work, but I haven't found a way to do it yet. Any thoughts/suggestions would be great!

Cheers, Adam

Edit: To clarify, I'm not talking about storing hidden "application data", but instead letting the user specify a particular directory to sandbox for use with a webapp that they may not want to give broader access to.

2 Answers 2

0

The Dropbox Apps API provides the ability to restrict any app using your API key to a single directory of your Dropbox account. So users could create an API key with access to a specific directory and then plug that into your app. However, that's not a user-friendly workflow.

I think the Dropbox Drop-Ins Chooser/Saver API might be close to what you want. The user is presented with a Dropbox file selection popup, and your app only gets access to the specific file(s) that the user selects.

6
  • Similarly, Drive supports the Drive.File scope which only gives access to specific files the user selects. Jun 9, 2015 at 16:31
  • So get that the suggestion would be to: 1. ask a user to select a folder in Drive/Dropbox, and 2. ask again for sandboxed access to only that user-specified folder. Would two different scopes cause an issue? And can you specify a single folder as root with the Drive API?
    – Adam Kumpf
    Jun 9, 2015 at 17:05
  • @AdamKumpf that doesn't really sound like what I'm suggesting. Did you look at the Dropbox Chooser/Saver API? Will that not work for you?
    – Mark B
    Jun 9, 2015 at 18:55
  • 1
    Hi @mbaird - The Drop-Ins Chooser/Saver doesn't seem to let you specify a folder, only individual files. Am I missing something there? I'm looking for a way to let the user select a folder, and then have the webapp get read/write access to that folder only (assuring the user only files in the selected directory can be changed). Edit: I suppose 1 file at a time would be okay, but I was hoping for a directory-level solution. :)
    – Adam Kumpf
    Jun 10, 2015 at 7:59
  • 1
    The permissions offered by the Dropbox API are documented here: dropbox.com/developers/reference/devguide#app-permissions It sounds like the "app folder" permission is closest to what you're looking for, but that results in a new folder being created for the app, and doesn't let the user select an arbitrary/pre-existing folder. (We'll consider this a feature request for that though.)
    – Greg
    Jun 11, 2015 at 20:17
0

With remoteStorage, sandboxed directory access is currently the default way for apps to request (and users to grant) access to the storage. However, users cannot manually select or enter custom directories during the connect phase.

1
  • By the way, could someone with more karma tag this question with "remotestorage"? Would be great if people with less karma could also use that as a tag, and if we could link to the tag on SO from the remoteStorage website. Thanks! :)
    – raucao
    Jun 15, 2015 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.