Skip to main content

client/service/message-policy

packages/client/src/service/message-policy

Purpose

The message-policy document sharnessd reads and the firewall it builds from one.

Public surface

decodeMessagePolicy

Variable
Decodes the text of a message-policy document, refusing any property it does not name, so a misspelled or newer setting never silently weakens the policy.

MessagePolicy

TypeAlias
One decoded message-policy document, with Client’s defaults filled in.

MessagePolicy

Variable
The message policy of one daemon: its firewall mode, the built-in code middleware of each direction in chain order, its fixed and initial editable English rules, the decision provider those rules and the collective norms need, and the check bounds. Absent settings take Client’s defaults. English rules or the collective norms without a decision provider, the collective norms with the unavailable provider, which would leave every one of their English checks unavailable, and an English rule id given twice across the fixed and initial rules are refused.

messagePolicyFirewall

Variable
The firewall installation of one message-policy document: its built-in middleware in chain order, its English rules assessed by provider, and its settings. This is the trusted-composition hook: a composition that brings its own decision provider installs the result with Daemon.withFirewall. codeDigest is the SHA-256 of the Client release, the mode, each registration’s id and revision, the fixed English rules, the decision provider and the settings. It leaves out what differs between the agents of one arm: the facilitator role, which no revision holds, the allowed-sender list and the initial editable rules, so every member records the same digest.

Files

  • compose.ts
  • policy.ts