Add TTL cache for CSRF
Dependencies
- [2]
HTYEGVBUAdd data to reset password page - [*]
WW3KRXX6Add page for reset game password - [*]
EVP2FSBHSplit index page - [*]
WVHXYKCVAdd postgresql pools - [*]
4MZ4VIR7Initial commit - [*]
BCXEUKX6Add config, static files and web server - [*]
7R6HAATPOptional publish static files if use reverse-proxy - [*]
IM5ZPD4NUpdate dependencies
Change contents
- edit in src/pages/reset_game_pwd.rs at line 58
{let mut cache = data.cache.lock().await;cache.insert(csrf, token, std::time::Duration::from_secs(600));} - edit in src/pages/mod.rs at line 2
use tokio::sync::Mutex;use ttl_cache::TtlCache;use uuid::Uuid; - edit in src/pages/mod.rs at line 13
pub cache: Mutex<TtlCache<Uuid, Uuid>>, - edit in src/main.rs at line 41
cache_capacity, - edit in src/main.rs at line 88
cache: tokio::sync::Mutex::new(ttl_cache::TtlCache::new(cache_capacity)), - edit in src/config.rs at line 13
pub cache_capacity: usize, - edit in Cargo.toml at line 22
ttl_cache = "0.5"tokio = "1.15" - edit in Cargo.lock at line 594
"tokio", - edit in Cargo.lock at line 597
"ttl_cache", - edit in Cargo.lock at line 876[10.8455][10.8455]
name = "linked-hash-map"version = "0.5.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"[[package]] - edit in Cargo.lock at line 1596
name = "ttl_cache"version = "0.5.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4189890526f0168710b6ee65ceaedf1460c48a14318ceec933cb26baa492096a"dependencies = ["linked-hash-map",][[package]]