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:
parent
6a8e02f004
commit
87bad7fbcc
4 changed files with 30 additions and 4 deletions
|
|
@ -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>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue