-
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
Percent-decode each path fragment. #51
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,13 +287,18 @@ <h3> | |
-> https://w3c-ccg.github.io/user/alice/did.json | ||
</pre> | ||
|
||
<pre class="example nohighlight" title="Creating the DID with a path containing a colon (not recommended but allowed by URI rules)"> | ||
did:web:example.com:example%3Asubdirectory | ||
-> https://example.com/example:subdirectory/did.json | ||
</pre> | ||
|
||
<p> | ||
If an optional port is specified on the domain, the port colon splitting the | ||
host and the port MUST be percent encoded to prevent collision with the path. | ||
</p> | ||
|
||
<pre class="example nohighlight" title="Creating the DID with optional path and port"> | ||
did:web:example.com%3A3000:user:alice | ||
did:web:example.com%3A3000:user:alice | ||
-> https://example.com:3000/user/alice/did.json | ||
</pre> | ||
</section> | ||
|
@@ -309,11 +314,19 @@ <h3> | |
|
||
<ol> | ||
<li> | ||
Remove the <code>did:web:</code> prefix. | ||
</li> | ||
<li> | ||
Replace ":" with "/" in the method specific identifier to obtain the fully | ||
qualified domain name and optional path. | ||
</li> | ||
<li> | ||
If the domain contains a port percent decode the colon. | ||
If the domain contains a port, percent decode the colon. | ||
</li> | ||
<li> | ||
Percent-decode each path fragment. (Note that although URI paths are technically | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest removing this change suggestion (move to an issue / tackle in a subsequent pr). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the main point of the PR tho.. |
||
allowed to contain <code>:</code> characters, doing so is not recommended, and | ||
may hinder interoperability.) | ||
Comment on lines
+327
to
+329
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't percent-decoding each path part mean that percent-encoded non-URL-safe characters in the DID would end up not being representable in the HTTPS URL (because they need to be percent-encoded)? These would then have to be double-percent-encoded in the DID. e.g. Would it make more sense to just say percent-decode the colon character in each path part, similar to how that is done for the domain part in the previous step? i.e. replace occurrences of Maybe saying "path part" instead of "path fragment" could be more clear, so that the term fragment could be used more consistently? |
||
</li> | ||
<li> | ||
Generate an HTTPS URL to the expected location of the DID document by | ||
|
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.
wonder if we can keep the port part, and scratch the rest of this...
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.
Fwiw, the spec already mentions ports ("A port MAY be included and the colon MUST be percent encoded to prevent a conflict with paths.") So this PR is mainly about the path part.