syndicate-js/packages/core/protocols/schemas/gatekeeper.prs

52 lines
2.5 KiB
Plaintext

version 1 .
embeddedType EntityRef.Cap .
;---------------------------------------------------------------------------
; Protocol at *gatekeeper* entities
; Assertion. Gatekeeper will attempt to resolve `step`, responding with a `Resolved` to
; `observer`.
Resolve = <resolve @step any @observer #!Resolved> .
Resolved = <accepted @responderSession #!any> / Rejected .
;---------------------------------------------------------------------------
; Protocol at dataspaces *associated* with gatekeeper entities
; Assertion. Gatekeeper will compute an appropriate `step` from `description` pointing at
; `target`, and will respond with a `Bound` to `observer`, if supplied.
Bind = <bind @description any @target #!any @observer BindObserver> .
BindObserver = @present #!Bound / @absent #f .
Bound = <bound @step any> / Rejected .
;---------------------------------------------------------------------------
; Protocol at client-side dataspaces, for resolution utilities
; Assertion. In response to observation of this with appropriate captures/wildcards in `addr`
; and `resolved`, respondent will follow `route.pathSteps` starting from one of the
; `route.transports`, asserting `ResolvePath` with the final `Resolved` as well as the selected
; transport `addr` and a `control` for it.
ResolvePath = <resolve-path @route Route @addr any @control #!TransportControl @resolved Resolved> .
ResolvePathStep =
/ @base <connect-transport @addr any @observer #!Resolved>
/ @step <resolve-path-step @gatekeeper #!Resolve @pathStep any @observer #!Resolved>
.
; A `Route` describes a network path that can be followed to reach some target entity.
;
; It starts with zero or more possible non-Syndicate `transports`, in preference order. These
; could be `transportAddress.Tcp` values or similar. They are just suggestions; it's quite
; possible the endpoint is reachable by some means not listed. The network outside Syndicate
; is, after all, pretty diverse! In particular, *zero* `transports` may be provided, in which
; case some out-of-band means has to be used to make that first connection.
;
; The `transports` give instructions for contacting the first entity in the `Route` path. Often
; this will be a `gatekeeper`, or a `noise` protocol endpoint, or both. Occasionally, it may
; even be the desired target entity. Subsequent `pathSteps` describe how to proceed from the
; initial entity to the target.
Route = <route @transports [any ...] @pathSteps any ...> .
TransportControl = ForceDisconnect .
ForceDisconnect = <force-disconnect> .
Rejected = <rejected @detail any> .