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
Create a simplified kepler API. #35
Conversation
When working on this I realised it would be really nice if we could delegate the "create" capability to the session key, as then the user would only need to sign one SIWE message. Is this something that will be possible with the new cap subsystem @chunningham ? |
Curious about the change in Also, this patch to the
|
@krhoda thanks for the patch. I think I changed the target when I was testing the behaviour of something async, but there's no reason for it to be ES2017 -- I'll revert |
it makes sense, no semantic or logical reason the peer permission can't be delegated alongside read and write |
f27238d
to
5eed781
Compare
FYI - when trying to do this I couldn't work out how to construct the invocation to contain the generated peer ID. In the SIWE authn, the peer id is stored in the URI field, but I couldn't work out what the analogue for that is in the zcap authn. |
bit of misleading code there, that message is actually a delegation, so the URI is the delegate/peer. in the zcap delegation the equivalent is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, although I would recommend we don't restrict the mime types when put
ting, as I think there's no reason we should prevent users from uploading any type they want and it doesn't make it easier to use. I much enjoyed seeing how much cleaner index.ts and other stuff is though
Spoke about this in the Kepler meeting. To clarify, the put function doesn't restrict mime types, it just only knows how to construct blobs for certain types:
This gives us the flexibility to support other types directly in the future, but for now users would need to construct a Blob themselves if they want to store something that isn't text or json. An alternative would be to remove the Another alternative would be to again remove the
I'm not a massive fan of this since json-serialisation fails silently, so a user might not know that some of the data is lost because it could not be parsed. But it would give us a simple api (everything is Opinions? @wyc @skgbafa @chunningham |
For @skgbafa and anyone else who wants to test this, this branch is currently dependent on the fat_packaged version of didkit, which can be built by running this script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mis-read the put
mime-type logic, LGTM
Also fixed a bug where File's couldn't be put directly.
Also rename S3 to KV.
When testing building a test dapp I found some improvements that could be made to reduce polyfilling.
After more testing and discussions with Simon, we decided the best option would be to vendor the didkit fat pkg here until we figure out and resolve the async import issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Overall the PR looks great! Love the tsdoc. Only reviewed code, did not execute functions.
- Some small js/stucture feedback
- Do we see more changes possible for config stuff? If so, setting up a global config pattern could be good. Not worth doing if we don't see much change
invHeaderStr
"https://kepler.test.spruceid.xyz:443"
- Add a linter? Maybe later. For collaboration reasons.
- Add .nvmrc. For collaboration reasons.
- Do we see more changes possible for config stuff? If so, setting up a global config pattern could be good. Not worth doing if we don't see much change
- Deploy the docs to gh pages? Add a small script to do so? Maybe done by a gh action as part of a release process?
ac6c81c
to
a38c628
Compare
a38c628
to
9316858
Compare
Linter and .nvmrc added. Will address the publishing of the docs in a future PR. |
Based on the API described here.
Todo:
Discuss and come up with appropriate types for the response from the orbit methods (or is the fetch Response type sufficient?)Sam agreed on slack that the fetch Response is appropriate, and I believe Kelsey and Charles previously agreed on this type too.See new design in the proposal above.