kaloyan-raev / hello-storj

Demo app for integrating the libstorj native library in Android
GNU General Public License v3.0
5 stars 3 forks source link

getBucket Method #28

Closed dri94 closed 6 years ago

dri94 commented 6 years ago

Include a method to getBucket with a given mnemonic. This is an alternative to the bucket/key association. A method that just gets a single bucket with a specified mnemonic will allow users who set a different mnemonic in multiple apps (My app AllStorj, and another developers app) can then access all their files regardless of which app they use. Specifying different mnemonics depending on the app is also good as Storj's ecosystem develops and apps have different purposes.

This will also allow for uploading to one bucket in a background process that cannot call the getBuckets() method.

kaloyan-raev commented 6 years ago

Can you explain why users would set different mnemonic to different apps?

dri94 commented 6 years ago

Say someone creates a backup app just to backup files on their phone, then they have an app where they share photos and videos with their friends. They might want different mnemonics for increased security. But even then, a getBucket method would help for background processes where you only need to work with one bucket

kaloyan-raev commented 6 years ago

The mnemonic is not something that users should share each other. It is something that should be kept really in secret. Shared buckets is yet to be implemented in the Bridge: https://github.com/Storj/bridge/issues/396. When it is implemented, I would still expect that users will be able to share buckets without exchanging their mnemonics.

For now I would avoid a model encouraging usage of multiple mnemonics in a single account. Users may really misunderstand the purpose of the mnemonic and start sharing it. This would seriously compromise the security.

dri94 commented 6 years ago

No problem. However a getBucket (doesn't need to include mnemonic). would still be very useful for retrieving a single bucket when doing background work and such.

kaloyan-raev commented 6 years ago

What does "retrieving a single bucket" mean? What do you exactly expect in return of the method? And what would you pass as argument? ID?

dri94 commented 6 years ago

It means instead of using

public static native void getBuckets(String user, String pass, String mnemonic, GetBucketsCallback callback);

to get a list of buckets. you could use

getBucket(String bucketId, [whatever other arguments you need])

And retrieve a Bucket. So yes. you pass the bucketId, to retrieve the bucket back.

kaloyan-raev commented 6 years ago

OK. Got it. I will add such method in the API.