Skip to main content

Module trust

Module trust 

Source
Expand description

Per-provider trust state (enable/disable controls).

Trust decisions are local and user-owned. State is persisted under $SYNAPS_BASE_DIR/extensions/trust.json. Enabled-by-default semantics: a provider with no entry is considered enabled. Users explicitly disable providers they distrust.

Structs§

ProviderTrustEntry
ProviderTrustState

Functions§

disable_provider
Record a disabled decision. Replaces any existing entry for the runtime_id.
enable_provider
Re-enable a previously disabled provider. Removes the entry.
is_provider_enabled
Returns true if the runtime_id is permitted to be routed (i.e. NOT disabled). Default: true (enabled when absent).
load_trust_state
Load the persisted state. Missing file → Default::default(). IO errors → Err. Malformed JSON → Err with a descriptive message.
save_trust_state
Persist the state. Creates parent dirs if needed. Atomic via tempfile + rename.
trust_file_path
Path to the trust file under the active base dir. Caller is responsible for creating parent directories when writing.