dmaap client using wrong auth property 97/89897/1
authorBoslet, Cory <cory.boslet@att.com>
Fri, 14 Jun 2019 13:44:54 +0000 (09:44 -0400)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Fri, 14 Jun 2019 13:45:00 +0000 (09:45 -0400)
Changed dmaap client to set auth property correctly to prevent double
decryting and wrong value

Change-Id: I83dc8c67e94a8bec187c056e7dfa1f966cc5ee3c
Issue-ID: SO-2019
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java

index 86d4aa7..48c2d14 100644 (file)
@@ -49,12 +49,12 @@ public abstract class DmaapClient {
         this.msoProperties = dmaapProperties.getProperties();
         this.properties = new Properties();
         this.properties.load(resource.getInputStream());
-        try {
-            this.properties.put("auth", CryptoUtils.decrypt(this.getAuth(), this.getKey()).getBytes());
-        } catch (GeneralSecurityException e) {
-            logger.error(e.getMessage(), e);
+        if (this.getAuth() != null && this.getKey() != null) {
+            this.properties.put("auth", this.getAuth());
+            this.properties.put("key", this.getKey());
+        } else {
+            logger.error("Dmaap auth or key is null");
         }
-        this.properties.put("key", this.getKey());
         this.properties.put("topic", this.getTopic());
         Optional<String> host = this.getHost();
         if (host.isPresent()) {