Trait SecretProvider

Source
pub trait SecretProvider: Send + Sync {
    // Required methods
    fn provider_name(&self) -> &str;
    fn sync_secrets<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        secrets: &'life1 [Secret],
        targets: &'life2 [Target],
    ) -> Pin<Box<dyn Future<Output = Result<SyncResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn validate_access<'life0, 'life1, 'async_trait>(
        &'life0 self,
        targets: &'life1 [Target],
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_targets<'life0, 'life1, 'async_trait>(
        &'life0 self,
        target_type: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_configured<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for secret providers (GitHub, GitLab, Azure DevOps, etc.)

Required Methods§

Source

fn provider_name(&self) -> &str

Get provider name

Source

fn sync_secrets<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, secrets: &'life1 [Secret], targets: &'life2 [Target], ) -> Pin<Box<dyn Future<Output = Result<SyncResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sync secrets to targets

Source

fn validate_access<'life0, 'life1, 'async_trait>( &'life0 self, targets: &'life1 [Target], ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate access to targets

Source

fn list_targets<'life0, 'life1, 'async_trait>( &'life0 self, target_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List available targets (organizations, repositories, etc.)

Source

fn is_configured<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if provider is properly configured

Implementors§