Documentation
    Preparing search index...

    Function createFirewallState

    • Create a firewall state container backed by @kehto/rate-limit/legacy and optionally persisted via the given persistence hooks.

      When persistence is absent (or undefined), firewall config is in-memory only and resets on container recreation. This is safe for hosts that do not need durable per-napplet policies.

      Parameters

      • Optionalpersistence: FirewallPersistence

        Optional storage backend for firewall config.

      • OptionalonMutation: () => void

        Internal runtime observer, called after a config change validates.

      Returns FirewallStateContainer

      A FirewallStateContainer instance.

      const firewall = createFirewallState(persistence);
      firewall.load();
      firewall.setPolicy('chat', 'allow');
      firewall.persist();