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

56 lines
2.8 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 Step @observer #!Resolved> .
Resolved = <accepted @responderSession #!any> / Rejected .
Step = <<rec> @stepType symbol @details [any ...]> .
;---------------------------------------------------------------------------
; 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 Description @target #!any @observer BindObserver> .
Description = <<rec> @stepType symbol @details [any ...]> .
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> .
TransportConnection = <connect-transport @addr any @control #!TransportControl @resolved Resolved> .
ResolvedPathStep = <path-step @origin #!Resolve @pathStep PathStep @resolved Resolved> .
PathStep = <<rec> @stepType symbol @details [any ...]> .
; 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 PathStep ...> .
TransportControl = ForceDisconnect .
ForceDisconnect = <force-disconnect> .
;---------------------------------------------------------------------------
Rejected = <rejected @detail any> .