Skip to main content

SecretResolver

Trait SecretResolver 

Source
pub trait SecretResolver: Send + Sync {
    // Required method
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, OperationError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

Trait for resolving secrets at operation execution time.

Implementations provide read-only access to encrypted secrets scoped to the current workflow. The engine passes a resolver through OperationContext so that operations can fetch credentials without depending on the store crate.

§Examples

use ironflow_core::operation::{SecretResolver, NoopSecretResolver};

let resolver = NoopSecretResolver;
let result = resolver.get("any_key").await;
assert!(result.unwrap().is_none());

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, OperationError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Look up a secret by key.

Returns Ok(Some(value)) if the secret exists, Ok(None) if it does not, or Err on storage/decryption failure.

§Errors

Returns OperationError::Secret if the underlying store fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§