1use std::collections::{HashMap, HashSet};
2use std::sync::atomic::AtomicBool;
3use std::sync::{Arc, Mutex};
4
5pub struct VaultState {
7 pub cert_cache: HashMap<
10 String,
11 (
12 std::time::Instant,
13 crate::vault_ssh::CertStatus,
14 Option<std::time::SystemTime>,
15 ),
16 >,
17 pub cert_checks_in_flight: HashSet<String>,
19 pub cleanup_warning: Option<String>,
21 pub signing_cancel: Option<Arc<AtomicBool>>,
23 pub sign_thread: Option<std::thread::JoinHandle<()>>,
25 pub sign_in_flight: Arc<Mutex<HashSet<String>>>,
27 pub pending_config_write: bool,
29}
30
31impl Default for VaultState {
32 fn default() -> Self {
33 Self {
34 cert_cache: HashMap::new(),
35 cert_checks_in_flight: HashSet::new(),
36 cleanup_warning: None,
37 signing_cancel: None,
38 sign_thread: None,
39 sign_in_flight: Arc::new(Mutex::new(HashSet::new())),
40 pending_config_write: false,
41 }
42 }
43}