use of org.elasticsearch.common.settings.MockSecureSettings in project elasticsearch by elastic.
the class AwsS3ServiceImplTests method testAwsCredsExplicitConfigSettings.
public void testAwsCredsExplicitConfigSettings() {
Settings repositorySettings = Settings.builder().put(InternalAwsS3Service.CLIENT_NAME.getKey(), "myconfig").build();
MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("s3.client.myconfig.access_key", "aws_key");
secureSettings.setString("s3.client.myconfig.secret_key", "aws_secret");
secureSettings.setString("s3.client.default.access_key", "wrong_key");
secureSettings.setString("s3.client.default.secret_key", "wrong_secret");
Settings settings = Settings.builder().setSecureSettings(secureSettings).build();
launchAWSCredentialsWithElasticsearchSettingsTest(repositorySettings, settings, "aws_key", "aws_secret");
}
use of org.elasticsearch.common.settings.MockSecureSettings in project elasticsearch by elastic.
the class InternalSettingsPreparerTests method testSecureSettings.
public void testSecureSettings() {
MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("foo", "secret");
Settings input = Settings.builder().put(baseEnvSettings).setSecureSettings(secureSettings).build();
Environment env = InternalSettingsPreparer.prepareEnvironment(input, null);
Setting<SecureString> fakeSetting = SecureSetting.secureString("foo", null, false);
assertEquals("secret", fakeSetting.get(env.settings()).toString());
}
use of org.elasticsearch.common.settings.MockSecureSettings in project elasticsearch by elastic.
the class AwsS3ServiceImplTests method testAWSConfigurationWithAwsSettings.
public void testAWSConfigurationWithAwsSettings() {
MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("s3.client.default.proxy.username", "aws_proxy_username");
secureSettings.setString("s3.client.default.proxy.password", "aws_proxy_password");
Settings settings = Settings.builder().setSecureSettings(secureSettings).put("s3.client.default.protocol", "http").put("s3.client.default.proxy.host", "aws_proxy_host").put("s3.client.default.proxy.port", 8080).put("s3.client.default.read_timeout", "10s").build();
launchAWSConfigurationTest(settings, Settings.EMPTY, Protocol.HTTP, "aws_proxy_host", 8080, "aws_proxy_username", "aws_proxy_password", null, 3, false, 10000);
}
use of org.elasticsearch.common.settings.MockSecureSettings in project elasticsearch by elastic.
the class AwsS3ServiceImplTests method testAwsCredsDefaultSettings.
public void testAwsCredsDefaultSettings() {
MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("s3.client.default.access_key", "aws_key");
secureSettings.setString("s3.client.default.secret_key", "aws_secret");
Settings settings = Settings.builder().setSecureSettings(secureSettings).build();
launchAWSCredentialsWithElasticsearchSettingsTest(Settings.EMPTY, settings, "aws_key", "aws_secret");
}
Aggregations