Skip to main content

Integration

Trait Integration 

Source
pub trait Integration: Sized {
    type KeyId: AppendIntegrationKey<Self>;
    type PrivateKey;
    type Config: IntegrationConfig<Self>;

    const NAME: &'static str;

    // Required methods
    fn parse_key_id(key_id_str: &str) -> Result<Self::KeyId, IntegrationError>;
    fn parse_private_key(
        private_key_str: impl AsRef<str>,
    ) -> Result<Self::PrivateKey, IntegrationError>;
    fn encrypt_data_key(
        key_id: &Self::KeyId,
        data_key: &DataKey,
    ) -> Result<String, IntegrationError>;
    fn decrypt_data_key(
        key_id: &Self::KeyId,
        encrypted_data_key: &str,
    ) -> Result<Option<DataKey>, IntegrationError>;
    fn select_metadata_units(
        integration_metadata: &mut IntegrationMetadata,
    ) -> &mut IntegrationMetadataUnits<Self>;

    // Provided methods
    fn private_key_env_var_name() -> String { ... }
    fn private_key_file_path_override_env_var_name() -> String { ... }
    fn private_keys_from_env(    ) -> Result<Vec<Self::PrivateKey>, IntegrationError> { ... }
    fn private_keys_from_default_key_file(    ) -> Result<Vec<Self::PrivateKey>, IntegrationError> { ... }
    fn retrieve_private_keys(    ) -> Result<Vec<Self::PrivateKey>, IntegrationError> { ... }
}

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Source

type KeyId: AppendIntegrationKey<Self>

Source

type PrivateKey

Source

type Config: IntegrationConfig<Self>

Required Methods§

Source

fn parse_key_id(key_id_str: &str) -> Result<Self::KeyId, IntegrationError>

Source

fn parse_private_key( private_key_str: impl AsRef<str>, ) -> Result<Self::PrivateKey, IntegrationError>

Source

fn encrypt_data_key( key_id: &Self::KeyId, data_key: &DataKey, ) -> Result<String, IntegrationError>

Source

fn decrypt_data_key( key_id: &Self::KeyId, encrypted_data_key: &str, ) -> Result<Option<DataKey>, IntegrationError>

Source

fn select_metadata_units( integration_metadata: &mut IntegrationMetadata, ) -> &mut IntegrationMetadataUnits<Self>

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Integration for AgeIntegration

Available on crate feature age only.
Source§

const NAME: &'static str = "age"

Source§

type KeyId = Recipient

Source§

type PrivateKey = Identity

Source§

type Config = AgeConfig

Source§

impl Integration for AwsKmsIntegration

Available on crate feature aws-kms only.
Source§

const NAME: &'static str = "aws_kms"

Source§

type KeyId = AwsKeyId

Source§

type PrivateKey = AwsPrivateKey

Source§

type Config = AwsKmsConfig