Decision: should login rate limiting survive a shared bucket, or should TRUSTED_PROXIES be mandatory in production? #150
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by the final integration review of #111. The immediate 1.0.0 blocker is #149, which makes the consequence visible via a startup warning and honest docs. This issue is the structural question underneath it, and it does NOT block the tag.
The problem restated: with
TRUSTED_PROXIESempty behind the mandated reverse proxy, every client shares one login bucket, so 5 requests/minute from a stranger denies the operator the only admin path. Documenting it is necessary but does not remove it — an operator who never setsTRUSTED_PROXIESstill ships a remotely-lockable admin UI.Needs your call, because every option trades something real.
Options
TRUSTED_PROXIESmandatory in production — fail startup when it is empty andWEBHOOKER_ENVIRONMENTis production. Coherent with the fail-loud philosophy of #80 and with the policy that a proxy is always present, but it is a breaking change for anyone deploying without one, and it converts a soft misconfiguration into a hard outage.Recommendation: option 1. It targets the actual failure — one shared bucket for all accounts — without changing deployment requirements or the #88 default, and it keeps brute-force protection intact. Option 2 is defensible and arguably more honest, but it turns a documentation gap into a startup failure for existing deployments, which is not something to do in a 1.0.0. Option 3 does not solve it. Option 4 leaves a remotely-triggerable admin denial in the shipped default.
If you pick option 1, the bound on the username key set is the part that needs care: cap distinct tracked usernames and fall back to the address bucket beyond the cap, or the limiter itself becomes the memory-amplification surface that #133 just closed elsewhere.
Done-criteria once decided