Skip to main content

KeyVersionStatus

Struct KeyVersionStatus 

Source
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: i32

Version 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

Source

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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeyVersionStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for KeyVersionStatus

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for KeyVersionStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.