Search in sources :

Example 1 with OTelTraceSourceConfig

use of com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig in project data-prepper by opensearch-project.

the class CertificateProviderFactoryTest method getCertificateProviderS3ProviderSuccess.

@Test
public void getCertificateProviderS3ProviderSuccess() {
    final Map<String, Object> settingsMap = new HashMap<>();
    settingsMap.put("ssl", true);
    settingsMap.put("awsRegion", "us-east-1");
    settingsMap.put("sslKeyCertChainFile", "s3://data/certificate/test_cert.crt");
    settingsMap.put("sslKeyFile", "s3://data/certificate/test_decrypted_key.key");
    final PluginSetting pluginSetting = new PluginSetting(null, settingsMap);
    pluginSetting.setPipelineName("pipeline");
    oTelTraceSourceConfig = OBJECT_MAPPER.convertValue(pluginSetting.getSettings(), OTelTraceSourceConfig.class);
    oTelTraceSourceConfig.validateAndInitializeCertAndKeyFileInS3();
    certificateProviderFactory = new CertificateProviderFactory(oTelTraceSourceConfig);
    final CertificateProvider certificateProvider = certificateProviderFactory.getCertificateProvider();
    assertThat(certificateProvider, IsInstanceOf.instanceOf(S3CertificateProvider.class));
}
Also used : OTelTraceSourceConfig(com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig) HashMap(java.util.HashMap) CertificateProvider(com.amazon.dataprepper.plugins.certificate.CertificateProvider) ACMCertificateProvider(com.amazon.dataprepper.plugins.certificate.acm.ACMCertificateProvider) FileCertificateProvider(com.amazon.dataprepper.plugins.certificate.file.FileCertificateProvider) S3CertificateProvider(com.amazon.dataprepper.plugins.certificate.s3.S3CertificateProvider) S3CertificateProvider(com.amazon.dataprepper.plugins.certificate.s3.S3CertificateProvider) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) Test(org.junit.jupiter.api.Test)

Example 2 with OTelTraceSourceConfig

use of com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig in project data-prepper by opensearch-project.

the class CertificateProviderFactoryTest method getCertificateProviderFileProviderSuccess.

@Test
public void getCertificateProviderFileProviderSuccess() {
    final Map<String, Object> settingsMap = new HashMap<>();
    settingsMap.put("ssl", true);
    settingsMap.put("sslKeyCertChainFile", "data/certificate/test_cert.crt");
    settingsMap.put("sslKeyFile", "data/certificate/test_decrypted_key.key");
    final PluginSetting pluginSetting = new PluginSetting(null, settingsMap);
    pluginSetting.setPipelineName("pipeline");
    oTelTraceSourceConfig = OBJECT_MAPPER.convertValue(pluginSetting.getSettings(), OTelTraceSourceConfig.class);
    certificateProviderFactory = new CertificateProviderFactory(oTelTraceSourceConfig);
    final CertificateProvider certificateProvider = certificateProviderFactory.getCertificateProvider();
    assertThat(certificateProvider, IsInstanceOf.instanceOf(FileCertificateProvider.class));
}
Also used : OTelTraceSourceConfig(com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig) FileCertificateProvider(com.amazon.dataprepper.plugins.certificate.file.FileCertificateProvider) HashMap(java.util.HashMap) CertificateProvider(com.amazon.dataprepper.plugins.certificate.CertificateProvider) ACMCertificateProvider(com.amazon.dataprepper.plugins.certificate.acm.ACMCertificateProvider) FileCertificateProvider(com.amazon.dataprepper.plugins.certificate.file.FileCertificateProvider) S3CertificateProvider(com.amazon.dataprepper.plugins.certificate.s3.S3CertificateProvider) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) Test(org.junit.jupiter.api.Test)

Example 3 with OTelTraceSourceConfig

use of com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig in project data-prepper by opensearch-project.

the class CertificateProviderFactoryTest method getCertificateProviderAcmProviderSuccess.

@Test
public void getCertificateProviderAcmProviderSuccess() {
    final Map<String, Object> settingsMap = new HashMap<>();
    settingsMap.put("useAcmCertForSSL", true);
    settingsMap.put("awsRegion", "us-east-1");
    settingsMap.put("acmCertificateArn", "arn:aws:acm:us-east-1:account:certificate/1234-567-856456");
    settingsMap.put("sslKeyCertChainFile", "data/certificate/test_cert.crt");
    settingsMap.put("sslKeyFile", "data/certificate/test_decrypted_key.key");
    final PluginSetting pluginSetting = new PluginSetting(null, settingsMap);
    pluginSetting.setPipelineName("pipeline");
    oTelTraceSourceConfig = OBJECT_MAPPER.convertValue(pluginSetting.getSettings(), OTelTraceSourceConfig.class);
    certificateProviderFactory = new CertificateProviderFactory(oTelTraceSourceConfig);
    final CertificateProvider certificateProvider = certificateProviderFactory.getCertificateProvider();
    assertThat(certificateProvider, IsInstanceOf.instanceOf(ACMCertificateProvider.class));
}
Also used : OTelTraceSourceConfig(com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig) HashMap(java.util.HashMap) CertificateProvider(com.amazon.dataprepper.plugins.certificate.CertificateProvider) ACMCertificateProvider(com.amazon.dataprepper.plugins.certificate.acm.ACMCertificateProvider) FileCertificateProvider(com.amazon.dataprepper.plugins.certificate.file.FileCertificateProvider) S3CertificateProvider(com.amazon.dataprepper.plugins.certificate.s3.S3CertificateProvider) ACMCertificateProvider(com.amazon.dataprepper.plugins.certificate.acm.ACMCertificateProvider) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) Test(org.junit.jupiter.api.Test)

Aggregations

PluginSetting (com.amazon.dataprepper.model.configuration.PluginSetting)3 CertificateProvider (com.amazon.dataprepper.plugins.certificate.CertificateProvider)3 ACMCertificateProvider (com.amazon.dataprepper.plugins.certificate.acm.ACMCertificateProvider)3 FileCertificateProvider (com.amazon.dataprepper.plugins.certificate.file.FileCertificateProvider)3 S3CertificateProvider (com.amazon.dataprepper.plugins.certificate.s3.S3CertificateProvider)3 OTelTraceSourceConfig (com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig)3 HashMap (java.util.HashMap)3 Test (org.junit.jupiter.api.Test)3