aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2018-02-20 18:03:30 +0200
committerOfir Sonsino <os0695@intl.att.com>2018-02-27 14:47:52 +0200
commitefedea1c5d80532f5b1180d57c8dafce5dcb302a (patch)
treec4bdefe8758b01f31c9e91a9ded0ab989daeb5e2 /vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
parentb94bd70f1595fad9546c3506393613f68504f495 (diff)
org.onap migration
Change-Id: I5e2d01a6da21d4003c910b5fe0702b35c2089a77 Issue-ID: VID-86 Signed-off-by: Ofir Sonsino <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
index 13b7d30b0..226850d2d 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
@@ -35,8 +35,8 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.att.eelf.configuration.EELFLogger;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
import org.eclipse.jetty.util.security.Password;
import org.onap.vid.utils.Logging;
import org.springframework.http.HttpMethod;
@@ -292,12 +292,17 @@ public class AAIRestInterface {
initRestClient();
url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
+ String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
+ String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
+ String encodeThis = vidUsername + ":" + vidPassword;
+
Logging.logRequest(outgoingRequestsLogger, HttpMethod.PUT, url, payload);
final Response cres = client.target(url)
.request()
.accept(responseType)
.header(TRANSACTION_ID_HEADER, transId)
.header(FROM_APP_ID_HEADER, fromAppId)
+ .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
.header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
.put(Entity.entity(payload, MediaType.APPLICATION_JSON));
Logging.logResponse(outgoingRequestsLogger, HttpMethod.PUT, url, cres);