core-wg / href

Other
2 stars 0 forks source link

Add optional userinfo (feature "userinfo"). #42

Closed cabo closed 2 years ago

cabo commented 2 years ago

Close #40.

chrysn commented 2 years ago

Going with a colon (":") for a separator would be the first time we're making an own choice in delimiting components that have no structure per URI or other specs.

The slashes between paths are special even in URI references (but not URIs). The ampersands of query parameters come from CoAP, and the dots in the host at least from DNS.

The colon is merely pointed out as a deprecated form, and while 3986 talks of special treatment ("should not render anything after the first colon"), none of that is normative text.

What is unclear to me at first reading is how a parser can use this without lookahead. A 2-long authority list whose first component is an array could be [userinfo, host], or it could be [host, port] if the first element of host uses the pet variant of text-or-pet.

cabo commented 2 years ago

3986 fails to use 2119 capitalization (*), so the "should" is actually quite normative.

For me, the ":" stands out in:

      userinfo    = *( unreserved / pct-encoded / sub-delims / ":" )

The ambiguity between pet for a hostname segment and userinfo is a problem, of course.

(*) Which seems to be a fad in some circles, https://infra.spec.whatwg.org/#conformance

cabo commented 2 years ago

3986 says that 'Use the format "user:password" is deprecated'. I'm not sure I'd interpret that as "anything with a colon is deprecated" or just "sending a password after a user name is deprecated".

This is all pretty murky, and taking on userinfo is going to be about as clean as zone info.

We clearly have moved beyond 3986 in our understanding how deeply user:password is deprecated. For a sender of foo:bar, there is a strong danger of falling into a black hole due to this deprecation, so I think unadorned colons in userinfo are now essentially unusable.
(But you still can add them in PET...)

Next step: Adding userinfo to CoAP :-) (Note that we already have psk-identity in CoAP over DTLS...)