pub struct BlobConfig { /* private fields */ }Expand description
The blob spine’s configuration.
All three variables are required and none has a default. A default root would put ciphertext somewhere nobody chose, and a default KEK would be a key everyone shares — the failure mode being avoided is a deployment that starts successfully while storing blobs it cannot protect.
Debug is safe to log: the KEK is a SecretBox, which redacts itself.
The label beside it is deliberately NOT secret, because it has to travel in
the clear inside every container header.
Implementations§
Source§impl BlobConfig
impl BlobConfig
pub fn from_env() -> Result<Self>
pub fn from_lookup(get: impl Fn(&str) -> Option<String>) -> Result<Self>
Sourcepub fn new(root: PathBuf, kek: [u8; 32], kek_id: String) -> Result<Self>
pub fn new(root: PathBuf, kek: [u8; 32], kek_id: String) -> Result<Self>
Build a config directly, for tests and for a caller that already holds the key material.
pub fn root(&self) -> &Path
pub fn kek(&self) -> &SecretBox<[u8; 32]>
pub fn kek_id(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlobConfig
impl RefUnwindSafe for BlobConfig
impl Send for BlobConfig
impl Sync for BlobConfig
impl Unpin for BlobConfig
impl UnsafeUnpin for BlobConfig
impl UnwindSafe for BlobConfig
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more