search: wire ratelimit.Limiter into /search Mount (SR2 H4 wiring)
Threads a separate ratelimit.New(pool) into buildSearchHandlers so
SR2 H4's middleware actually fires on the live route. Shares the
DB-backed counter table with auth's RateLimiter; segregated by
Policy.Scope='search'.
Tests covering H4 use a constructed limiter directly (no DB needed
beyond a stub pool) — see search.go's documented Mount path.
Together with the previous commit (H5 tab-count cache), /search
goes from worst-case 6 FTS queries per request unrate-limited to
1 query per request on cache hit + 60/min/viewer hard ceiling.
SR2 H4's middleware actually fires on the live route. Shares the
DB-backed counter table with auth's RateLimiter; segregated by
Policy.Scope='search'.
Tests covering H4 use a constructed limiter directly (no DB needed
beyond a stub pool) — see search.go's documented Mount path.
Together with the previous commit (H5 tab-count cache), /search
goes from worst-case 6 FTS queries per request unrate-limited to
1 query per request on cache hit + 60/min/viewer hard ceiling.
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
334b0c741555f0fc5e2917db6a75aa88147057af- Parents
-
fe289bb - Tree
25f0286