aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
diff options
context:
space:
mode:
authorThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-07-16 16:41:20 -0400
committerThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-07-16 16:41:20 -0400
commit9b6efbd93a12c858a0d2643013217ec3d6c3a46d (patch)
treebaf6c8de19daba3f4dc2b7761bda4cb858ba90e4 /src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
parent5a28a331688c5578fef9c64d462d07cbae6797da (diff)
various Updates
Q-api, triggers, conductor conditional updates. Bug fixes Change-Id: Iec392309787cd90f0a2827a2955399723640e800 Issue-ID: MUSIC-93 Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>
Diffstat (limited to 'src/main/java/org/onap/music/rest/RestMusicAdminAPI.java')
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicAdminAPI.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
index c66944cb..d1e82337 100755
--- a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
@@ -37,7 +37,10 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;
+
+import org.mindrot.jbcrypt.BCrypt;
import org.onap.music.datastore.PreparedQueryObject;
+import org.onap.music.datastore.jsonobjects.JSONObject;
import org.onap.music.datastore.jsonobjects.JsonOnboard;
import org.onap.music.eelf.logging.EELFLoggerDelegate;
import org.onap.music.eelf.logging.format.AppMessages;
@@ -107,7 +110,7 @@ public class RestMusicAdminAPI {
MusicUtil.DEFAULTKEYSPACENAME));
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), appName));
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.cboolean(), "True"));
- pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), password));
+ pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), BCrypt.hashpw(password, BCrypt.gensalt())));
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), userId));
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.cboolean(), isAAF));
@@ -142,7 +145,7 @@ public class RestMusicAdminAPI {
ErrorSeverity.CRITICAL, ErrorTypes.AUTHENTICATIONERROR);
resultMap.put("Exception",
"Unauthorized: Please check the request parameters. Enter atleast one of the following parameters: appName(ns), aid, isAAF.");
- return Response.status(Status.UNAUTHORIZED).entity(resultMap).build();
+ return Response.status(Status.BAD_REQUEST).entity(resultMap).build();
}
PreparedQueryObject pQuery = new PreparedQueryObject();
@@ -348,7 +351,7 @@ public class RestMusicAdminAPI {
if (userId != null)
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), userId));
if (password != null)
- pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), password));
+ pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), BCrypt.hashpw(password, BCrypt.gensalt())));
if (isAAF != null)
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.cboolean(), isAAF));
@@ -367,4 +370,14 @@ public class RestMusicAdminAPI {
return Response.status(Status.OK).entity(resultMap).build();
}
+
+ @POST
+ @Path("/callbackOps")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
+ public String callbackOps(JSONObject inputJsonObj) throws Exception {
+
+ System.out.println("Input JSON: "+inputJsonObj.getData());
+ return "Success";
+ }
}