You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The /users/:userID/app/:appid/resources API endpoint isn't going to work, since application resources can live outside of Blockstack to be backwards-compatible with existing Web services. For example, I would expect that something like /users/judecn.id/app/blockstack_maps/resources/maps.google.com?... to be a valid GET request (which happens to pull data from maps.google.com through the client daemon).
The API is meant to allow the application code to fetch external data on-the-fly while verifying that it was signed by the application author (or triggering a warning if not). This is so the developer can keep using data stored in their preferred hosting service. To make it compatible with Blockstack, they'd either re-encode their data as a signed JWT, or they'd include a .sig file alongside each path that contains the signature over the data (which the daemon would fetch and use to verify the data's authenticity).
This API isn't really part of the user accounts or names APIs. I'd imagine that it should go under /resources/:appID/:resourceName/ or the like.
the HTML file is verified (how is this done if the HTML file is a resource too?)
you're using HTML (how is this done if you're using e.g. curl?)
What if we did this instead?
route: /resources/:appName/:appID
required query fields:
path=: the URL to the resource
optional query fields:
sig=: the URL to the signature over the resource (to be checked against the app-specific public key pointed to by :appID, which in turn is vouched for by the key pointed to by :appName). Defaults to $path.sig
Activity
shea256 commentedon Dec 7, 2016
OK what alternatives do we have?
jcnelson commentedon Dec 7, 2016
The API is meant to allow the application code to fetch external data on-the-fly while verifying that it was signed by the application author (or triggering a warning if not). This is so the developer can keep using data stored in their preferred hosting service. To make it compatible with Blockstack, they'd either re-encode their data as a signed JWT, or they'd include a
.sigfile alongside each path that contains the signature over the data (which the daemon would fetch and use to verify the data's authenticity).This API isn't really part of the user accounts or names APIs. I'd imagine that it should go under
/resources/:appID/:resourceName/or the like.shea256 commentedon Dec 8, 2016
Good call on the separation. I'll make that change.
shea256 commentedon Dec 8, 2016
Also, since we're providing a path, I'm thinking it be more like this for resources where the signature is checked:
...and it should be something like this where the hash is checked:
shea256 commentedon Dec 8, 2016
Here's the code for integrating bootstrap into HTML in a way that the browser automatically checks the hash:
jcnelson commentedon Dec 8, 2016
That works as long as:
curl?)What if we did this instead?
/resources/:appName/:appIDpath=: the URL to the resourcesig=: the URL to the signature over the resource (to be checked against the app-specific public key pointed to by:appID, which in turn is vouched for by the key pointed to by:appName). Defaults to$path.sigExamples:
/resources/chord.app/chord.app?path=https://s3.amazonaws.com/onename/avatar-placeholder.png/resources/judecn.id/helloworld?path=https://www.cs.princeton.edu/~jcnelson/avatar.png&sig=https://github.com/jcnelson/helloworld/avatar.png.sig