support clear text/jetty obfuscated password for talking to secure Elastic search
Change-Id: I864320f3884da1171b7c7980edbe8858197afc97
Issue-ID: AAI-1971
Signed-off-by: Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Optional<String> passwordValue = Optional.ofNullable(props.getProperty(ES_TRUST_STORE_ENC));
if (passwordValue.isPresent()) {
Optional<String> passwordValue = Optional.ofNullable(props.getProperty(ES_TRUST_STORE_ENC));
if (passwordValue.isPresent()) {
+ if(passwordValue.get().startsWith("OBF:")){
setTrustStorePassword(Password.deobfuscate(passwordValue.get()));
setTrustStorePassword(Password.deobfuscate(passwordValue.get()));
+ }else{
+ setTrustStorePassword(passwordValue.get());
+ }
}
Optional<String> keyStoreFile = Optional.ofNullable(props.getProperty(ES_KEY_STORE));
}
Optional<String> keyStoreFile = Optional.ofNullable(props.getProperty(ES_KEY_STORE));
passwordValue = Optional.ofNullable(props.getProperty(ES_KEY_STORE_ENC));
if (passwordValue.isPresent()) {
passwordValue = Optional.ofNullable(props.getProperty(ES_KEY_STORE_ENC));
if (passwordValue.isPresent()) {
+ if(passwordValue.get().startsWith("OBF:")){
setKeyStorePassword(Password.deobfuscate(passwordValue.get()));
setKeyStorePassword(Password.deobfuscate(passwordValue.get()));
+ }else{
+ setKeyStorePassword(passwordValue.get());
+ }
metricsLogger.info(message,
new LogFields() //
.setField(LogLine.DefinedFields.RESPONSE_CODE, operationResult.getResultCode())
metricsLogger.info(message,
new LogFields() //
.setField(LogLine.DefinedFields.RESPONSE_CODE, operationResult.getResultCode())
- .setField(LogLine.DefinedFields.RESPONSE_DESCRIPTION, operationResult.getResult()),
+ .setField(LogLine.DefinedFields.RESPONSE_DESCRIPTION, operationResult.getResult())
+ .setField(LogLine.DefinedFields.SERVER_IP, "ElasticHost-"+config.getIpAddress()),