API rate limiting: implement stub
API rate limiting: implement stub: a task in smol-software-harbor (Harbor dataset). Implement Limiter:allow(key, now) in src/limiter.lua as its comment describes: per key, allow at most limit events in any window seconds; an event at time t stops counting once now - t = window , and refused events…
The task
Implement `Limiter:allow(key, now)` in `src/limiter.lua` as its comment describes: per key, allow at most `limit` events in any `window` seconds; an event at time `t` stops counting once `now - t >= window`, and refused events are not recorded. Return true when the event is allowed. Run `lua tests/run.lua`.
Part of efederici/smol-software-harbor.