-
Notifications
You must be signed in to change notification settings - Fork 17
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
Use absolute file paths for did:web DIDs. #52
Comments
@tplooker this would be a breaking change for did web, but IMO something so simple may actually by worth it... |
I think there is a way for it to not be a breaking change. It'll be ugly/hacky, but we can provide an optional code path where if you detect more than two colons in the DID URL for did:web, you can do the weird replacement thing... but we make it a MAY. Or we could do something like -- dereference, and if you don't get anything back, and there are more than two colons, do the weird replacement thing, and try dereferencing again (and if you get a document back, cache that so future dereferences don't have to go through all that rigmarole). All that said, I'd really like to avoid doing all that (because it adds complexity and attack surface). |
There is a further positive (imo) implication here. Consider the following cases:
In both cases, the server would be returning an index document if
+1 on breaking over hacky. |
That would certainly be my preference -- stay silent, leave web architecture alone. That said, it seems like @OR13 and @mprorock are both -1s to that? As an alternative, I suggested the absolute paths thing, where you can be specific about the file extension and therefore, media type... and by doing so, you lock yourself into a media type for that particular DID. I do agree that disabling conneg is probably going to result in multiple objections in the future. My suggestion is that we don't say anything about conneg right now and just say "use absolute URLs"... dodge the question for the time being so we can make some progress w/o painting ourselves into a corner. |
If we feel compelled to lock ourselves into We would eventually wind up very nearly at the original proposal. We might have been there a couple of years ago, but the core spec was different then. |
Yeah, I do agree that that's where we'll probably end up... which is why both @OR13 and @mprorock need to provide some justification that content negotiation will result in "something bad happening". The only argument that I know of that is of concern is when one representation differs from the other in a way that matters (verification method information or service description change). It is a valid concern, but not one where the solution needs to be: Ban content negotiation. Mitigations could be "if conneg is supported, implementations SHOULD derive the serialized content from a single source of data", "if conneg is supported, implementations SHOULD NOT serve serialized content that semantically differ for verification methods or service descriptions".
I'll also mention the elephant in the room... |
One other disadvantage to ignoring the Returning the DID at the same URL based on a request header would be rather elegant, in my opinion. |
Also remember that if we serve up HTML, you can embed a JSON-LD DID Document in HTML using this feature: https://www.w3.org/TR/json-ld11/#embedding-json-ld-in-html-documents ... and that's a mechanism that search indexers (like Google and Bing) use to catalog data into their search indexes. If a site can produce that sort of thing at https://did.example/did.json or in the HTML document served from https://did.example/ ... it could then publish Verifiable Credentials in HTML using the same mechanism. Food for thought. |
Yes, I've been thinking that the human readable profile should embed the structured data of the ID and populate the view using that data. +1 Whether that creates a compatibility issue remains open. It is possible that there would be some value in a specifically tailored exemplary method for this limited set of potential use cases. |
I think folks are expecting all interoperable did methods to support the same DID URL structures... here is an example:
In did web today, this looks like:
If we accept this proposal, this becomes:
^ This seems not great. |
I'm not a huge fan of requiring absolute file paths. It takes us to the bad old days of specifying |
Very few developers are going to hardcode Google still returns JSON-LD as I will continue to object to any attempt to destroy I think {"id": "did:web:did.actor:alice"} ^ This is a valid JSON DID Document. {"@context": "https://www.w3.org/ns/did/v1", "id": "did:web:did.actor:alice"} ^ This is a valid JSON-LD DID Document. |
However, regardless of the underlying JSON document, I am in favor of simplifying resolution rules, so long as we don't loose interoperability with other did methods... We can forbid folks from using ":" in their did web paths...that would be smarter than encouraging it IMO, since directories that use reserved characters like that are not interoperable and in fact, allowing that kind of stuff can lead to security issues. (/../../pwd.json), etc... |
I can understand the frustration around multiple representations that are all, at the end of the day, valid JSON. I am more interested in future representations if and when they emerge (i.e. CBOR for tighter transmissions) and the reuse of URLs that make sense intuitively as human readable destinations. I realize the complexity I've laid out above will be daunting and generally unnecessary for most use cases, and is therefore not really appropriate for a general standard. |
@OR13 wrote:
What is the use case for this URL? Why would someone create something that looks like this? |
@dmitrizagidulin wrote:
Do you think that we should disable content negotiation for did:web? I'm trying to figure out what the matrix of requirements is... |
That question implies that conneg is somehow enabled, or in any way supported, currently. :) I think several things:
|
Conneg is defined by RFC7231, the vast majority of HTTP clients support it. I disagree with any notion that conneg is not enabled by default. This is the Web, it's enabled by default. Here's what's confusing, it seems like @OR13 and @dmitrizagidulin are saying that they want DID URIs like
Agree. Dumb web servers support content negotiation. What should happen when an
What specific normative statement would you write to do that?
I'm sorta fine with that if most people do the right thing, but remember that all expressed key formats could be broken if we do that and implementers don't do the right thing (include the other contexts). That is, if we serve as |
@OR13 wrote:
Who in this thread is attempting to destroy
Accept headers are processed by default by the vast majority of web servers today per RFC7231. Are you saying that you want to disable default behavior for all HTTP clients and servers? Or are you saying something else?
We're playing games with file extensions because you and @mprorock are (it seems) objecting to content negotiation.
Please detail the security hole -- what is the attack you are concerned about? Please be specific.
That decision was made by the DID WG and achieved consensus. Neither you nor I agree with it, but conflating that w/ content negotiation isn't helping the discussion. At this point, I'm having a hard time tracking your arguments. Could you please list a set of rules that you'd like to see implemented that we can analyze? |
Yeah, some supported key formats (and contexts) should be included (by default) as well in some way. This should only be for those people that are looking to do the simplest thing anyway -- so they shouldn't care if their choices are restricted to recommended crypto suites. There should be some consideration for an upgrade path as well; perhaps reserving something in the DID string could signal a new resolver is needed. It might be a good idea to do this anyway. This would put a shelf-life on simplistic DIDs but they'd have an upgrade path to use new crypto suites without changing their DID (they'd just have to list those new contexts). |
Ah, right, ok, so, the main key to this is that the mapping is /not/ done on the server. The mapping is always done client side, meaning, the resolver client library sees |
Here is a complete did:web resolver:
Notice that no http header was specified. https://www.w3.org/TR/did-core/#did-resolution I think did web does not need to support representations other than JSON... doing so increases attack surface, decreases interoperability. There is nothing in DID Core that says a method must implement resolution for all possible did document representations. Its a bad idea to implement resolution for representations other than JSON, and its a bad idea to make JSON and JSON-LD different...
Any of these would be find IMO... clients know how to handle json. Should did web allow for a client to request another representation other than JSON? no. Today did web only supports JSON, and tomorrow will be the same unless we change the resolution rules... we should not change the rules, except to make them simpler. In order to make the rules simpler, we should remove Adding support for
Cool now we have a did resolve representation implementation that implements did core correctly.... that 99% of clients won't understand the responses from, since nobody knows what 'application/did+json' or 'application/did+ld+json' is... and we didn't need to change the did web resolution rules... to do it... so we shouldn't change them... let folks who want to implement resolver middleware like this do it outside the did method... we should not be doing this inside the did method, it increases the attack surface, content negotiation is not needed if the only representation is JSON... put a proxy up if you want to translate did:web to yaml or XML... don't force did web implementers support representations other than JSON... they will shoot their eyes out. |
I like @OR13 's proposal as it simplifies the resolution and makes the implementation easy. I'm for keeping |
FWIW, here's some feedback from a recent early platformitization of
Looking at One way or another, I'm invested in did:web for the duration. So, I'm on the side of simplicity - whatever that looks like. |
Thanks @sbutterfield , I'm glad
|
@sbutterfield wrote:
Yes, exactly, which is why Digital Bazaar has been arguing against the
Yes, and this was the driving force behind this issue: The did:web path-colon syntax was an early attempt to shove URL paths into the
You might be interested in using a parameterized Hashlink parameter there.
The straight translation of an HTTPS URL into a did:web URL is probably the simplest thing. The only issue is the DID Subject identifier in the DID Document. For did:web, it really needs to be the canonical URL -- so, ideally something like I'll also note that we can probably do all of the above AND keep supporting the legacy colon-to-path translation. At present, I believe the following approach might be able to achieve consensus:
I have a clear enough idea of the normative statements to create a PR at this point. I'll raise a PR when I get to it in my work queue. |
@msporny wrote:
We're planning to make use of
Just curious - I didn't think
Could The DID for one of our customers at their issuing agent address would be: |
Here is an example of using did web with GitHub https://github.com/OR13/signor |
@OR13 for the win |
Strong +1
+1
I would support the revision even without backward compatibility.
Happy to assist if needed. |
@sbutterfield wrote:
There is a bit of a work-around in that the method handles resolution and can simply handle that resolution inconsistently with the core specification, but that leaves the method in violation of the core specification. I did this with |
There is a lot of translation that's done with a did:web URL that feels like it could be simplified. For example, why don't we just require that all DID URL paths are absolute?
I just checked DID syntax, all the above is valid IIUC... why aren't we just doing that instead? It would allow people to just replace "https://" with "did:web:" to get a valid DID Web URL.
The text was updated successfully, but these errors were encountered: