pub struct SecretMap { /* private fields */ }Expand description
A named collection of secrets.
SecretMap provides a way to access resolved secrets by user-defined names
rather than by their 1Password references. This makes code more readable
and decouples the application from specific vault/item/field paths.
§Security
SecretMap does NOT implement Debug in a way that would expose secret values.
The Debug implementation only shows the keys (names), not the values.
§Examples
ⓘ
use corteq_onepassword::{OnePassword, SecretMap, ExposeSecret};
async fn example(op: &OnePassword) -> Result<(), Box<dyn std::error::Error>> {
let secrets = op.secrets_named(&[
("db_host", "op://prod/database/host"),
("db_pass", "op://prod/database/password"),
]).await?;
let host = secrets.get("db_host").unwrap().expose_secret();
let pass = secrets.get("db_pass").unwrap().expose_secret();
Ok(())
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretMap
impl RefUnwindSafe for SecretMap
impl Unpin for SecretMap
impl UnwindSafe for SecretMap
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more