-
Notifications
You must be signed in to change notification settings - Fork 0
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
figure out where we should store gateway-assigned content commitments (and implement it) #138
Comments
What started as a comment and clarification became a whole proposal. A Location Claim is a specific kind of Content Claim. A Content Claim is a verifiable (ie, signed) claim about a piece of content which can be distributed so that entities other than the original claimer can publish them and prove their validity. A Location Claim specifically claims that a piece of content may be located and retrieved via some method, one which does not need to know about anything web3-y—most commonly, an HTTP URL. A Location Claim tells anyone where to find the content. A Location Claim does not authorize anyone to retrieve the content. That's a separate concern. Moreover, a Location Claim is an attestation made by a Storage Node that it can provide the content. It's not the Storage Node's responsibility to determine if a request is authorized, so the Location Claim can't implement that. Who does decide if a request is authorized? A moment ago, I would have said the Gateway does. But after thinking it through a bit, I think that's not in line with how Storacha works. Storacha is built on self-sovereignty. Who decides who is authorized to access a piece of content? The owner of the content: the Space. Who is the gatekeeper? Who looks at the authorization to decide who actually gets to access the content? It could be the Storage Node, as they're closest to the stored content, but we'd like to leave them out of the authorization system, at least for now—we want them to be able to act like an FTP server we keep stuff on. So the duty falls to the next step away from the content: the Gateway. The Gateway will be looking at UCAN's and deciding whether or not to fulfill requests based on authority delegated, ultimately, from the Space. And so here's where the UCANs finally come in. The root authority to access content within a Space—call it Now, what's a Downloader, again? The Downloader is the entity which retrieves content, with a notable caveat: the Downloader, much like the Storage Node at the other end of the chain, doesn't speak UCAN. It has only an HTTP URL, which we'd like to contain two things: a reference to the content (CID? Path?) and a Token. The Token is enough to authorize retrieval. The Token may have a lifetime, and the Token should be revokable, but while the Token is valid, simply providing it is enough to be able to authorize them for retrieval. It is thus a Bearer Token. So the Downloader doesn't speak UCAN, but does have a form of authentication: the Token. Anyone holding the Token is authorized, so it must authenticate them as an entity which is authorized. Who is that entity? I posit that the entity is the Token itself! Just as a keypair can be UCAN principal, so, I propose, can a Token. I propose a new DID method, {
"iss": "did:key:zAgent",
"aud": "did:bearer:f78b5c9e-4913-4b6b-9600-1b28bde09ef6",
"sub": "did:key:zSpace",
"cmd": "/retrieve/content",
"pol": [
["==", ".cid", "bafy...data"],
]
} This communicates to the Gateway the intended authorization, by delegated authority of the Space. In English, "Whoever bears this Token may retrieve from the Space this piece of content." This is enforceable by the Gateway. If a request bears the token, it finds the content by way of Location Claim and proxies it to the Downloader. If it does not, or if the delegation has become invalid, the request is unauthorized. Some notes:
|
Currenty, I with @Peeja but I'd propose going a step farther -- I've been meaning to write this up but: |
The only downside is that puts the generation of tokens on the gateway, taking some power out of the hands of the space |
we had a video chat about this and @Peeja is currently writing up an RFC describing our latest thinking about how this should work - will link here when that's ready! |
We don't currently have a solid plan for storing and indexing the "content commitments" that get delegated to the gateway and used to "prove" that an invocation requesting a given CID's data is valid.
I'd propose we use roughly the same pattern we use for
access/claim
-related delegations, but in Cloudflare - store the raw delegation data in R2 and create some rough indexes in KV to map from "auth token" to delegations.I think the accounting service may be the right place for this to live - uploaders can tell it about new commitments to the gateway and the gateway can query it for commitments.
The text was updated successfully, but these errors were encountered: