HostServ: throttle vhost requests

A member may request a vhost at most once a minute; a request sooner is
refused with the wait time. In-memory per-account (not event-logged), the
same shape as the identify brute-force throttle.
This commit is contained in:
Jean Chevronnet 2026-07-13 22:47:02 +00:00
parent 6a8e02f004
commit 87bad7fbcc
No known key found for this signature in database
4 changed files with 30 additions and 4 deletions

View file

@ -601,6 +601,7 @@ pub trait Store {
fn vhost(&self, account: &str) -> Option<VhostView>;
fn vhosts(&self) -> Vec<VhostView>;
fn request_vhost(&mut self, account: &str, host: &str) -> Result<(), RegError>;
fn vhost_request_wait(&self, account: &str) -> u64;
fn take_vhost_request(&mut self, account: &str) -> Result<Option<String>, RegError>;
fn vhost_requests(&self) -> Vec<(String, String)>;
fn vhost_offer_add(&mut self, host: &str) -> Result<bool, RegError>;