-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: pass gaia hub to both get and putFile fns #794
feat: pass gaia hub to both get and putFile fns #794
Conversation
Dope! Now add the code to add scopes to the auth token :) |
@zone117x @reedrosenbluth @yknl @hstove maybe we can set up some time to talk through this kind of thing / use case in a sync meeting? |
Let's discuss this, I would prefer an approach that abstracts away the Gaia hub config for developers. For example, when you create a scoped auth token for another user, it could be stored on your hub and encrypted using the public key of the authorized user. When the authorized user is making a putFile request, they would just provide a username and the auth token/hub config lookup would be automatic. |
Sure thing! I am just trying to make the thing I am building work, and this seems to be the way that I've found so far. I wonder how what you suggest would work when each file shared has a different auth token? (scoped to that file/path) |
I think that can be handled by having a list of auth tokens stored on your own Gaia hub, keyed by the hash of the file name. The authorized user already supplies a file name to putFile. |
23f8552
to
0ae7a97
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
closing this for now. please re-open if you think this requires attention. if you re-open, please also suggest who could help resolve and carry it to the finish line 🙏🏼 |
Description
If someone wants to build an app that allows for collaborative editing of shared files, we need to allow the application to provide any gaia hub config that could contain the scoped auth token for that file. This PR implements the minimum amount of changes to allow for this kind of api:
This would also allow the application to generate a new auth tokens that can change the way gaia writes their files (for example: automatic versioning with
putFileArchival
):related to #545
Type of Change
Does this introduce a breaking change?
no
Are documentation updates required?
Yes, to explain the additional option and probably show them how to generate the tokens
Checklist
npm run test
passes