pub struct VaultIssuer { /* private fields */ }Expand description
Client for issuing credentials via HashiCorp Vault’s AWS secrets engine.
Implementations§
Source§impl VaultIssuer
impl VaultIssuer
Sourcepub async fn new(config: &VaultConfig) -> Result<Self>
pub async fn new(config: &VaultConfig) -> Result<Self>
Create a new VaultIssuer by authenticating with the configured method.
Sourcepub async fn issue(
&self,
vault_role: &str,
ttl: Duration,
) -> Result<TempCredentials>
pub async fn issue( &self, vault_role: &str, ttl: Duration, ) -> Result<TempCredentials>
Issue temporary AWS credentials via Vault’s AWS secrets engine.
Uses the /v1/{mount}/creds/{role} endpoint to generate dynamic credentials.
The ttl parameter is passed as a request parameter to control credential lifetime.
Sourcepub async fn read_sts_creds(
&self,
vault_role: &str,
ttl: Duration,
) -> Result<TempCredentials>
pub async fn read_sts_creds( &self, vault_role: &str, ttl: Duration, ) -> Result<TempCredentials>
Read a Vault secret from an arbitrary path (for STS credential generation where the Vault role uses assumed_role or federation_token type).
Sourcepub async fn health_check(&self) -> Result<bool>
pub async fn health_check(&self) -> Result<bool>
Check if Vault is healthy and the secrets engine is accessible.
Auto Trait Implementations§
impl Freeze for VaultIssuer
impl RefUnwindSafe for VaultIssuer
impl Send for VaultIssuer
impl Sync for VaultIssuer
impl Unpin for VaultIssuer
impl UnsafeUnpin for VaultIssuer
impl UnwindSafe for VaultIssuer
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 moreCreates a shared type from an unshared type.