pub trait SecretProvider: Send + Sync {
// Required method
fn get<'a>(
&'a self,
name: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, String>> + Send + 'a>>;
// Provided methods
fn get_encrypted<'a>(
&'a self,
_name: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<EncryptedSecret>, String>> + Send + 'a>> { ... }
fn decrypt(
&self,
_name: &str,
_secret: &EncryptedSecret,
) -> Result<String, String> { ... }
}Expand description
Host-provided resolver for blueprint-declared secrets.
Ok(None) means the secret is not available to the script: undeclared,
declared but missing, or otherwise absent. Infrastructure/configuration
failures should be returned as Err so scripts cannot confuse them with
ordinary absence.
Required Methods§
fn get<'a>( &'a self, name: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, String>> + Send + 'a>>
Provided Methods§
Sourcefn get_encrypted<'a>(
&'a self,
_name: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<EncryptedSecret>, String>> + Send + 'a>>
fn get_encrypted<'a>( &'a self, _name: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<EncryptedSecret>, String>> + Send + 'a>>
Retrieve and encrypt before returning to the effect recorder. Implementations must not include plaintext credentials in either the value or an error. Direct-only providers fail closed when used with recorded execution.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".