+36
−20
lib/labkit/rate_limit/configuration.rb
0 → 100644
+9
−0
+56
−112
lib/labkit/rate_limit/limiter.rb
0 → 100644
+63
−0
Loading
Address all 10 unresolved threads from MR !270 review and Bob Van Landuyt's spec update (2026-04-28). Key changes: - Add Limiter class (single Evaluator per call-site, no per-request allocation) - Add Configuration class with configure/config block pattern - Add Result object (matched?, exceeded?, action, rule, error?) - Compound multi-characteristic Redis key (one incr per rule, not N) - First-match-wins evaluation — stops on first matching rule - Add name: field to Rule (used in Redis key, replaces positional index) - Sentinel _unknown_ for missing/nil/empty characteristics - Callable limit/period resolved at check-time - Remove KNOWN_CHARACTERISTICS — any identifier key is valid - Normalize endpoint in Identifier#initialize (not in Evaluator) - Rename call_site → name throughout Closes #28792 Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>