import java.util.Objects;
import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.eclipse.jetty.util.security.Password;
import org.springframework.beans.factory.annotation.Value;
/**
* @return the decrypted password
*/
public String getTrustStorePassword() {
- return trustStorePassword;
+ return Password.deobfuscate(trustStorePassword);
}
public void setTrustStorePassword(String trustStorePassword) {
* @return the decrypted password
*/
public String getKeyStorePassword() {
- return keyStorePassword;
+ return Password.deobfuscate(keyStorePassword);
}
public void setKeyStorePassword(String keyStorePassword) {
import java.util.List;
/**
- * Loads the properties needed by the controller using spring.
+ * Loads the properties needed by the controller using Spring.
*/
public class RuleIndexingConfig extends PropertiesConfig {
import java.util.Properties;
import javax.annotation.Resource;
import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.eclipse.jetty.util.security.Password;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
/**
- * Gets the configuration of the topics. The topics are configured using Spring in topic-config-beans.xml.
+ * Gets the configuration of the topics using Spring.
*/
public class TopicConfig {
private String consumerGroup;
private String consumerId;
private String transportType;
+ private String protocol;
public String getName() {
return name;
}
public String getPassword() {
- return password;
+ return Password.deobfuscate(password);
}
public void setPassword(String password) {
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.validation.config.RestConfig;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
expectedRestConfig.setProtocol("https");
expectedRestConfig.setBaseModelURI("${baseModelURI}");
expectedRestConfig.setTrustStorePath("/dir1/dir2/trustStorePath");
- expectedRestConfig.setTrustStorePassword("70c87528c88dcd9f9c2558d30e817868");
+ expectedRestConfig.setTrustStorePassword("OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o");
expectedRestConfig.setKeyStorePath("/dir1/dir2/keyStorePath");
- expectedRestConfig.setKeyStorePassword("70c87528c88dcd9f9c2558d30e817868");
+ expectedRestConfig.setKeyStorePassword("OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o");
expectedRestConfig.setKeyManagerFactoryAlgorithm("AES");
expectedRestConfig.setKeyStoreType("jks");
expectedRestConfig.setSecurityProtocol("TLS");
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.validation.config.TopicAdminConfig;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
TopicAdminConfig expectedTopicAdminConfig = new TopicAdminConfig();
expectedTopicAdminConfig.setPublishEnable(true);
- expectedTopicAdminConfig.setPublishRetries(3l);
+ expectedTopicAdminConfig.setPublishRetries(3L);
expectedTopicAdminConfig.setConsumeEnable(true);
- expectedTopicAdminConfig.setConsumePollingIntervalSeconds(3l);
+ expectedTopicAdminConfig.setConsumePollingIntervalSeconds(3L);
assertThat(expectedTopicAdminConfig, is(topicAdminConfig));
assertThat(expectedTopicAdminConfig.hashCode(), is(topicAdminConfig.hashCode()));
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import org.eclipse.jetty.util.security.Password;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
TopicAdminConfig mockTopicAdminConfig = Mockito.mock(TopicAdminConfig.class);
when(mockTopicAdminConfig.isPublishEnable()).thenReturn(true);
- Topic topic1 = new TopicConfig("poa-rule-validation","poa-audit-result").new Topic();
+ Topic topic1 = mockTopicConfig.new Topic();
topic1.setName("aai-data-integrity");
topic1.setHost("integrity-dummy-host");
topic1.setPartition("integrity-dummy-partition");
topic1.setUsername("integrity-dummy-username");
- topic1.setPassword("integrity-dummy-password");
+ topic1.setPassword(Password.obfuscate("integrity-dummy-password"));
topic1.setTransportType("integrity-dummy-transport-type");
topicList.add(topic1);
port=8080
httpProtocol=https
trustStorePath=/dir1/dir2/trustStorePath
-trustStorePassword.x=70c87528c88dcd9f9c2558d30e817868
+trustStorePassword.x=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
keyStorePath=/dir1/dir2/keyStorePath
-keyStorePassword.x=70c87528c88dcd9f9c2558d30e817868
+keyStorePassword.x=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
keyManagerFactoryAlgorithm=AES
keyStoreType=jks
securityProtocol=TLS