Set a per-napplet, per-opClass token-bucket rate limit.
Returns a new FirewallConfig with napplets[napplet].rateLimits[opClass] set to limit. If the napplet has no existing entry, a fresh entry is created. The original config is never modified.
napplets[napplet].rateLimits[opClass]
limit
Current firewall config
Napplet dTag to configure
Operation class string (e.g. 'relay:write', 'outbox:write')
Token-bucket rate limit to apply
New FirewallConfig with the rate limit set
const cfg2 = setRateLimit(cfg, 'chat', 'relay:write', { capacity: 10, windowMs: 5000, action: 'block' });// cfg2.napplets['chat'].rateLimits['relay:write'].capacity === 10 Copy
const cfg2 = setRateLimit(cfg, 'chat', 'relay:write', { capacity: 10, windowMs: 5000, action: 'block' });// cfg2.napplets['chat'].rateLimits['relay:write'].capacity === 10
Set a per-napplet, per-opClass token-bucket rate limit.
Returns a new FirewallConfig with
napplets[napplet].rateLimits[opClass]set tolimit. If the napplet has no existing entry, a fresh entry is created. The original config is never modified.