-
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
How to handle hostnames with ports? #7
Comments
retry logic I suppose. |
The other option we have is - we can require the hostname portion to be URL-encoded. |
^ much better idea. |
Do we have a timeline for a resolution of this issue? As far as I can see this prevents actual adoption in a real life scenario. |
@felixwatts you could just use a URL instead of a DID, and return a did document with the same URL everywhere the DID would be. |
@felixwatts - apologies, I did the thing where I implemented the proposed solution and thought I updated the spec but didn't. Will be making a PR shortly. |
@dmitrizagidulin is your PR arriving any time soon? Could you explain the proposed solution? |
I guess the proposed solution is base64url-encoding the host portion as per #7 (comment) and what @felixwatts did. |
We are going to adopt the base64url-encoding proposal in aries-framework-go. |
@llorllale sure. I'll make the PR today. The proposed solution is - URL-encoding (as in,
|
@llorllale -1 to So for example, |
Fully agree - I mixed them up this morning before coffee somehow. |
+1 |
@dmitrizagidulin @OR13 I just realized url-encoding the path components results in a non-compliant DID as per the syntax: https://www.w3.org/TR/did-core/#did-syntax |
Nevermind: https://tools.ietf.org/html/rfc3986#section-2.4 So in summary, if I understand it right:
|
URI recommendations: https://www.w3.org/Addressing/URL/4_URI_Recommentations.html
Some test vectors for percent-encoding: https://www.w3.org/2004/04/uri-rel-test.html#reg-percent |
@llorllale Hi,
can you clarify please if we should incorporate encodeUrI into implementation or not? |
It sounds like did web does not currently support |
yeh, incorporating ngrok to use did:web in development. Seems like the easiest way to be compliant in development |
hah, nice i <3 ngrok.... thats an awesome idea. |
I'm not sure if this should be a separate issue or not, but it's related to encoding 😅. punycode is an option for that, but it won't cover the port issue and is not as easily available as |
@mirceanis non ascii domain names cannot be DIDs.... if the spec needs to be updated to support them we need URL safe bidirectional transformations. |
Update: The DID Core spec is being updated to accept |
fixes #91 implements w3c-ccg/did-method-web#7 BREAKING CHANGES: * resolver is now returning a DIDResolutionResult that wraps a DIDDocument * No errors are thrown, instead returned as didResolutionMetadata.error/message
* feat: update to latest did spec fixes #91 implements w3c-ccg/did-method-web#7 BREAKING CHANGE: Resolver now returns a `DIDResolutionResult` that wraps a DIDDocument. No errors are thrown, instead returned as `didResolutionMetadata.error/message`
Updated the text for this in #38 |
|
@letmaik - good point, about |
imo, |
That's a DID URL, not a DID. I think this has to be solved for the DID itself, right? |
yes, that example was a did url with a path that contained a colon. today:
if we wanted to allow the identifier to use ports:
and for completness, here is a did url that uses ports and colons in paths:
|
But what follows after that is important:
This applies to DIDs, not just DID URLs. Or are you suggesting to remove that part? |
The issue mentioned is in the other direction:
But that should still be covered by the overall algorithm (that requires percent-encoding of path fragments when encoding from URL to DID). |
ahh yes, thanks for clarifying! |
Thinking in terms of the changes for #42 , the percent encoding would work like this:
and percent encoding in the path as well would work like this:
Is that correct? |
@gribneau -- that looks right, +1 |
^ yes, i think thats the case we needed |
What about IDNs? For the domain räksmörgås.josefsson.org how would the did:web look like? Are the unicode characters percent encoded? I guess so. How does resolve work then? Since this is an IDN and the resolve algo assumes URLs, not IRIs, it would have to undo the percent encoding and then convert via punycode to a URL: https://xn--rksmrgs-5wao1o.josefsson.org. I think this complicates things too much and I would probably just simplify this to url-decoding each segment in full and putting the parts together to form an IRI. So, did:web:r%C3%A4ksm%C3%B6rg%C3%A5s.josefsson.org%3A1337:r%C3%A4ks becomes https://räksmörgås.josefsson.org:1337/räks (plus /did.json appended). If you need a URI then that's an application concern and most libraries accept UTF-8 encoded IRIs anyway these days. Doing it this way also covers the port automatically and doesn't have to be mentioned specifically in the spec. |
@letmaik - Great point. |
Now that we support paths (as of PR #5) in our
did:web
URLs, and we're using the:
to encode the/
characters for paths, this poses another challenge.Since we're using the
:
character for paths, what do we do about the actual most common intended purpose of that character, which is to specify a port number?So, specifically, say I am a developer who has just fired up a test server on their local machine, which is running on
https://localhost:8443
(thehttps
is deliberate of course - I made a self-signed cert for it and everything). This kind of thing happens all the time (it's happening to me right now :) ).If there's a
did:web
document residing on that domain (say in/.well-known/did.json
), what will that URL look like? According to our rules so far:Except now we're using
:
(in thedid-specific-identifier
portion of the url) to encode path fragments. So that URL would "decode" tohttps://localhost/8443
. Not what we want.So, what are people's thoughts on how to best handle this? @awoie, @OR13 ?
The text was updated successfully, but these errors were encountered: