Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Actually prune old entries when generating new token
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Drwięga committed Dec 23, 2016
1 parent 9a58a77 commit f54c502
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpc/src/v1/helpers/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ impl SignerService {
/// Generates a new web proxy access token.
pub fn generate_web_proxy_access_token(&self) -> String {
let token = random_string(16);
self.web_proxy_tokens.lock().insert(token.clone(), ());
let mut tokens = self.web_proxy_tokens.lock();
tokens.prune();
tokens.insert(token.clone(), ());
token
}

Expand Down

0 comments on commit f54c502

Please sign in to comment.