feat: add in-memory rate limiting for login endpoint

Rate-limit POST /admin/login at 10 attempts per 60 seconds per IP.
Stored in Volumen.login_attempts so tests can reset the counter.
This commit is contained in:
2026-06-25 21:33:16 +02:00
parent 2348352fab
commit 140b16b55a
3 changed files with 25 additions and 0 deletions
+7
View File
@@ -18,4 +18,11 @@ require_relative "volumen/users"
# The Sinatra app (`Volumen::Server`) and the CLI (`Volumen::CLI`) are loaded
# on demand to keep the core library light.
module Volumen
def self.login_attempts
@login_attempts ||= {}
end
def self.reset_login_attempts!
@login_attempts = {}
end
end