pub struct KeyVersionStatus {
pub active: i32,
pub configured: Vec<i32>,
pub in_use: Vec<i32>,
pub missing: Vec<i32>,
pub retirable: Vec<i32>,
}Expand description
How the configured key ring lines up with what the stored secrets use.
This is what tells an operator whether an old key can be dropped from the configuration, without having to guess.
§Examples
use ironflow_store::entities::KeyVersionStatus;
let status = KeyVersionStatus {
active: 2,
configured: vec![1, 2],
in_use: vec![2],
missing: vec![],
retirable: vec![1],
};
assert!(status.is_consistent());Fields§
§active: i32Version used to encrypt new secrets.
configured: Vec<i32>Versions present in the configured key ring, ascending.
in_use: Vec<i32>Versions actually used by stored secrets, ascending.
missing: Vec<i32>Versions used by stored secrets but absent from the key ring.
Non-empty means some secrets are unreadable: the server refuses to start in that state.
retirable: Vec<i32>Versions that can be removed from the key ring safely: configured, not active, and unused by any secret.
Implementations§
Source§impl KeyVersionStatus
impl KeyVersionStatus
Sourcepub fn is_consistent(&self) -> bool
pub fn is_consistent(&self) -> bool
Whether every stored secret can be decrypted with the current ring.
§Examples
use ironflow_store::entities::KeyVersionStatus;
let broken = KeyVersionStatus {
active: 1,
configured: vec![1],
in_use: vec![1, 2],
missing: vec![2],
retirable: vec![],
};
assert!(!broken.is_consistent());Trait Implementations§
Source§impl Clone for KeyVersionStatus
impl Clone for KeyVersionStatus
Source§fn clone(&self) -> KeyVersionStatus
fn clone(&self) -> KeyVersionStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyVersionStatus
impl Debug for KeyVersionStatus
Source§impl<'de> Deserialize<'de> for KeyVersionStatus
impl<'de> Deserialize<'de> for KeyVersionStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KeyVersionStatus
impl RefUnwindSafe for KeyVersionStatus
impl Send for KeyVersionStatus
impl Sync for KeyVersionStatus
impl Unpin for KeyVersionStatus
impl UnsafeUnpin for KeyVersionStatus
impl UnwindSafe for KeyVersionStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more