pub struct RotatingKeyProvider { /* private fields */ }Expand description
A rotation-aware key provider: one active (write) key plus an ordered list of additional keys accepted for reads only.
During a rotation an operator constructs this with the new key as
active and the previous key(s) in also_accept; new puts sign
under active, while get / list continue to see blobs written
under the retired keys until they are migrated or GC’d. The active key
is automatically included in KeyProvider::read_keys (first), so the
caller passes only the extra accepted keys.
Implementations§
Source§impl RotatingKeyProvider
impl RotatingKeyProvider
Sourcepub fn new(
active: [u8; 32],
also_accept: impl IntoIterator<Item = [u8; 32]>,
) -> Self
pub fn new( active: [u8; 32], also_accept: impl IntoIterator<Item = [u8; 32]>, ) -> Self
Build a provider whose write/active key is active and which also
accepts every key in also_accept for reads. Duplicates of the
active key in also_accept are harmless (the store dedups by
fingerprint when listing).
Trait Implementations§
Source§impl KeyProvider for RotatingKeyProvider
impl KeyProvider for RotatingKeyProvider
Source§fn active_key(&self) -> [u8; 32]
fn active_key(&self) -> [u8; 32]
The key new
puts sign with. MUST be one of Self::read_keys.Auto Trait Implementations§
impl Freeze for RotatingKeyProvider
impl RefUnwindSafe for RotatingKeyProvider
impl Send for RotatingKeyProvider
impl Sync for RotatingKeyProvider
impl Unpin for RotatingKeyProvider
impl UnsafeUnpin for RotatingKeyProvider
impl UnwindSafe for RotatingKeyProvider
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