Expand description
BIDIR-5 / BIDIR-8: the gate’s rules for a duplex call — who sends, who answers, how much, and what crosses a hop. BIDIR-5 / BIDIR-8 — the gate’s rules for a duplex call, in this crate’s terms.
A duplex call is params, then an input half and an output half
(BIDIR-1). The gate decides it at open exactly as it decides any call
(Gate::check: the method’s grant on its
target, within the ceiling). What this module adds is what a duplex call
needs beyond that, each as data a method or a service declares — no rule is
written in an application:
| when | the gate does | in these terms |
|---|---|---|
| the call opens | Gate::check, once; the call holds the caller and the Reach | a grant |
| an input frame arrives | no gate check: the frame’s connection is the call’s, the half is open, the grants generation is the one last verified, the frame is within credit and the CallCeiling | InputBy::Caller, CallCeiling |
| the grants generation moves, a sign-out, the expiry | the caller verified again, once per call; a refusal closes the input half with forbidden / unauthenticated | a grant |
| a question is answered | Answerer: the caller’s own connection; a person; or whoever holds a grant on the call’s target | Answerer |
| a call goes into a client or a service that dialed in | that peer’s own gate, deciding for the principal on that connection — the other side of the call is a caller like any other | a grant on the peer |
| a call crosses a hop | hop_identity: the hop is the principal, the caller is named for and grants nothing, the hop’s verdict is a ceiling layer; the far side decides again | a ceiling |
Structs§
- Call
Ceiling - How much one call may take in (BIDIR-1: “every item that flows has a limit”). Beside the transport’s per-connection call count, which counts a duplex call as one call.
- CallRef
- BIDIR-8: which call a refusal was about — the connection it runs on and its subscription there (the slot BIDIR-6 keys a duplex call by).
Enums§
- Answerer
- Who may answer a question a method asks mid-call — an output item that
expects a reply (BIDIR-1
mechanism). The method declares it (#[method(answer_by = "…")], BIDIR-1answerer). - Duplex
Refusal Code - BIDIR-8: every typed refusal the gate makes over a duplex call — its
error_kindon the wire, and thereasonof its audit record (AuditRecordKind::DuplexRefused). - InputBy
- Who may send a call’s input items. Only the caller, on the call’s own connection: an input item carries no target of its own, so there is nothing another principal could be checked against. (A wider sender is a second call, gated as one.)
Constants§
- ANSWER_
BY_ SPELLINGS - BIDIR-8: the spellings
#[method(answer_by = "…")]takes, for a refusal to name (the macro’s compile error says the same three). - FOR_KEY
- The metadata key naming whom a hop acts for (IDENTITY-2’s
for; RFC 8693’s actor chain, read the other way): a list, nearest caller first. It is attribution only — it grants nothing.
Functions§
- hop_
identity - BIDIR-1
forward= identity: the context a call carries across a hop. - is_
person - A person, as the identity’s issuer vouches: a sign-in through plexus-idp or an OIDC provider. A key, an API key or a nostr key is not (a nostr key may be a person’s, but nothing vouches it — AUTH-35 grades that).