Ian Denhardt writes:
> Quoting John Kemp (2021-02-11 12:46:02)
>
>> As far as I can tell, this is a misuse of a Uniform Resource
>> *Identifier*. That is to say, a URI is an identifier for a resource,
>> not the resource that it identifies. You may be able to (depending on
>> the URI scheme) dereference the URI, certainly (follow the link if it's
>> a URL). What is the point to the URI here, and what does the `ocap'
>> scheme do?
>
> I suspect it would probably be more correct to call these URLs than
> URIs. Indeed, URIs that are not also URLs inherently violate the
> "central dogma" for capabilities: Don't separate designation from
> authority.
At least one of the types shown, the certificate, is more URI than
URL... it really is data for an assembled certificate, but not the way
to invoke it (since it does not have the attached key, except for in the
composed CertBear abstraction).
>> From past experience though, parsing URIs sucks (or at least, is
>> brittle). Is there a specification of the ocap scheme?
>
> I wonder, is there a strong reason to come up with custom ad-hoc syntax
> for ocap URLs at all?
As I wrote:
These are URI types so they can be copy-pasted around for legacy
systems, including at the REPL, in a browser application (?), etc.
Implementations of and applications using OCapN SHOULD decode URIs to
internal datastructures early and encode late.
Inside of captp, there's no need even to have a stringy URI. More
efficient representations that map to the same abstract record structure
I indicated are possible.
I have a few applications in progress where I am demonstrating starting
up a session by a user suppling some kind of capability they presumably
got over an out-of-band environment. For example, a chat program.
> As an alternative, why not just:
>
> ocapn:$(base64(<serialized datatype>))
>
> Where <serialized datatype> is the serialized form of some data type
> that is in-line with what you'd pass around on the wire when speaking
> captp itself?
Note that there are four different types of URIs here. I wanted them to
be visually distinct. In fact, in my first iteration they looked *very*
visually distinct, where after the ocapn: there would be a marker like:
;; Ocapn machine type URI:
;;
;; ocapn:m.<transport>.<transport-location>[.<transport-hints>]
;; Ocapn swissnum URI:
;;
;; ocapn:s.<transport>.<transport-location>/<swiss-num>
;; Ocapn certificate URI:
;;
;; ocapn:c.<transport>.<transport-location>/<cert>
;; Ocapn bearer certificate union URI:
;;
;; ocapn:b.<transport>.<transport-location>/<cert>/<key-type>.<private-key>
The awkward thing about this is that from a URI perspective, the
"location" would change every time, and this wasn't really accurate.
So instead I decided to use the path part of the URI structure to
distinguish between the last three.
Another option could be to put these all in the URI scheme:
ocapn-m:...
ocapn-s:...
ocapn-c:...
ocapn-b:...
but this seemed strange also. Maybe it's more correct to the proposed
nature of URI schemes though, dunno.
- Chris