Documentation
    Preparing search index...

    Function setGlobalRate

    • Set a per-napplet global fallback rate limit (RATE-03).

      The global rate is applied to all op-classes for this napplet that lack a specific rateLimits entry. This provides a single budget covering all unlisted operations rather than relying solely on the config-wide defaultRate.

      Returns a new FirewallConfig with napplets[napplet].globalRate set. The original config is never modified.

      Parameters

      • config: FirewallConfig

        Current firewall config

      • napplet: string

        Napplet dTag to configure

      • limit: RateLimit

        Global fallback rate limit for this napplet

      Returns FirewallConfig

      New FirewallConfig with the global rate set

      const cfg2 = setGlobalRate(cfg, 'chat', { capacity: 30, windowMs: 30000, action: 'flag' });
      // cfg2.napplets['chat'].globalRate is set; other napplets unaffected