94edc80b

By: Michael Lynch <git@mtlynch.io>

Configure login rate limits through limiter params

Make ratelimit.NewLimiter accept LimiterParams so callers configure the clock and per-window/IP limits explicitly. Keep the rate limit window as the only package constant.

Merge the limiter tests into one table that describes concrete previous and next login attempts.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 1s 8s 8s 9s 1s
Eval 8s 1m23s 1m23s 1m32s 0s
Build 18s 7m42s 1m14s 1m33s 0s
Suite 1s 9m14s 1m32s 1m33s 1s

Timeline

0s10s20s30s40s50s1m1m10s1m20s1m30s