MARS documentation
Rust librariesmars-server

mars-server · production

Public declarations and documentation for mars-server::production.

Package: mars-server · Workspace version: 0.1.0 · Module: production

This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.

production::validate_production_config

Fail fast if the resolved [ServerConfig] would silently break in production.

Enforces production configuration invariants that can be checked before constructing runtime adapters.

  1. Cursor integrity: an operator-provided, non-fixture HMAC key and a bounded cursor lifetime are required.
  2. Durable state: a non-empty PostgreSQL URL, at least one auth profile, positive TTLs, and no duplicate profile names are required.
  3. Anchor worker: required anchoring must be enabled, worker settings must be bounded, and enabled execution requires a registered live [crate::anchor::AnchorPort].
  4. Federation peer URLs: every entry in cfg.federation.peers must be a non-loopback URL.
  5. SIWS live adapter (when the sigil feature is compiled in): production requires credential-free HTTPS Sigil RPC configuration and protected token/signing-key environment sources. Runtime startup then proves revocation-first GAL, chain, storage, and replay-safe readiness.
  6. Operator trust: required publisher/peer pin sets must be populated, and every configured Ed25519 key must parse before startup continues.

Non-production environments always return Ok(()).

pub fn validate_production_config(cfg: &ServerConfig) -> anyhow::Result<()>;

Source line: 42.

production::validate_production_anchor

Validate the runtime anchor adapter registration after the application has assembled provider adapters.

pub fn validate_production_anchor(
    cfg: &ServerConfig,
    adapter_registered: bool,
) -> anyhow::Result<()>;

Source line: 269.

production::validate_production_auth

Validate runtime authentication wiring after concrete adapters and stores have been assembled.

Production requires restart-safe storage and exactly resolvable enabled profiles. OpenAgent and Arsenal remain extension seams until a concrete adapter is registered; configuring either prematurely fails startup.

pub fn validate_production_auth(
    cfg: &ServerConfig,
    registry: &AuthProfileRegistry,
    durable_storage: bool,
) -> anyhow::Result<()>;

Source line: 287.

Source provenance

Source: mars-server/src/production.rs · SHA-256 83a4f86ad41c4965f609874226a8f80899f19f7bf7783644a4cafdd05c6d8e92. Package overview.

On this page