Closed dmitrizagidulin closed 3 years ago
Specifically: https://tools.ietf.org/html/rfc3986#section-2.1
https://tools.ietf.org/html/rfc3986#section-2.3
For consistency, percent-encoded octets in the ranges of ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved characters by URI normalizers.
I think this makes sense, but should we perhaps do:
idchar = ALPHA / DIGIT / "." / "-" / "_" / pct-encoded
pct-encoded = "%" HEXDIG HEXDIG
... in order to only allow %
encoding in a URI-compatible way, not for arbitrary use?
@talltree also needs to review this.
IMO, %
is a very useful addition, so +1.
PR #703 has been raised to address this issue. This issue will be closed once PR #703 is merged.
PR #703 has been merged, closing.
Although the current
idchar
DID URI ABNF rule is inspired by RFC3986 URI Syntax, it is more tightly constrained, and prevents the implementation of a couple of crucial encoding use cases.This came up in the development and implementation of the
did:web
DID Method spec with @awoie and others, although I expect this issue to affect other DID methods as well. Specifically, the current DID URI ABNF rules don't allow for did-method-specific strings to contain data encoded in various key formats (base64url encoding (no=
char allowed), Punycode encoding (several ASCII chars not allowed), or Percent-encoding).Proposal: Let's add the
%
character to theidchar
ABNF rule which currently reads:idchar = ALPHA / DIGIT / "." / "-" / "_"
to be:
idchar = ALPHA / DIGIT / "." / "-" / "_"/ "%"
This will enable DID Methods to perform Percent encoding (which then enables base64url encoding of binary data, Punycode encoding of Unicode international characters, and others).