Conversation
Notices
-
Embed this notice
FenTiger (fentiger@zotum.net)'s status on Saturday, 09-Mar-2024 20:06:16 JST FenTiger
Oh, joy: it turns out that Go's net/url package doesn't understand that DID URLs can have paths.
Parsing "https://example.social/path/to/object" gives me a useful result:
&url.URL{
Scheme:"https",
Opaque:"",
Host:"example.social",
Path:"/path/to/object",
[...]
}But parsing "did:ap: key:z6abcdef/path/to/object" gives me this:
&url.URL{
Scheme:"did",
Opaque:"ap🔑z6abcdef/path/to/object",
Host:"",
Path:"",
[...]
}So I need some kind of wrapper to detect DID URLs and parse the paths out of them. That's easy enough, I suppose, but then I need to actually use that wrapper, in all the relevant places...
#ActivityPub #FediDev #BangHeadHere-
Embed this notice
silverpill (silverpill@mitra.social)'s status on Saturday, 09-Mar-2024 20:06:15 JST silverpill
@fentiger Rust url library says that ap🔑z6abcdef/path/to/object is a path. I guess DID URLs haven't seen much use before and we just need to file bug reports.
-
Embed this notice
silverpill (silverpill@mitra.social)'s status on Saturday, 16-Mar-2024 20:22:50 JST silverpill
@greyarea @fentiger Yes, you're right. I found the issue where this behavior was discussed:
https://github.com/w3c/did-core/issues/556
>the design of DID URL syntax was patterned after URN syntax
>Parsing of the rootless path into the segment-nz component and the *( "/" segment) component must be done "manually" by the parser as with URNs. -
Embed this notice
Grey Area (greyarea@mitra.vpclmulqdq.moe)'s status on Saturday, 16-Mar-2024 20:22:51 JST Grey Area
The Rust URL library is correct, according to spec (none of the updates change the behavior here).
-
Embed this notice