Feat/redis rate limiter - #17
Closed
raymondproguy wants to merge 8 commits into
Closed
raymondproguy wants to merge 8 commits into
raymondproguy wants to merge 8 commits into
Conversation
The in-process limiter counts in one process's memory, so N replicas enforce N times the configured limit. This keeps the same fixed-window policy and moves the counter into Redis, atomically in one script so two replicas cannot each arm their own window over the same key.
Injected already constructed, like every store, so the engine never dials Redis or owns its lifecycle. Nil keeps the in-memory default built from RateLimitAttempts/RateLimitWindow, which is what every existing caller gets.
The fake models the Lua rather than running it, so it pins the allow/deny arithmetic, the fixed window, key namespacing and the EVALSHA→EVAL fallback — not Redis's own execution of the script.
Runs against an in-process stand-in by default and against a real server when REDIS_ADDR is set — the second mode is the one that actually executes the Lua, so both are documented in the header.
Leads on the fail-closed decision, since wiring Redis in makes it a hard dependency of SignUp/Login/RequestMagicLink and that is the one thing to settle before deploying rather than during an incident.
Tier 2 is now complete, so NEXT.md opens on Tier 3. PROGRESS.md records the open gap plainly: no Redis was reachable here, so the Lua ran only against a modelled stand-in, never a real server.
Added new audit event types for anomaly detection and credential stuffing, along with structures for login attempts and anomaly tracking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.