summaryrefslogtreecommitdiffstats
path: root/jar
diff options
context:
space:
mode:
authorThomas Nelson <nelson24@att.com>2019-06-25 14:31:10 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-25 14:31:10 +0000
commitfcca903302375403ff16216ce9b4b3cca2d1362c (patch)
tree95290ef0389ba7ad6ff6b565820453fee2530f4b /jar
parent57af690a4a1bbf8cb50691385601e2bb43465965 (diff)
parent881f14bc8676cedd68e17bd007a869fa85578fa1 (diff)
Merge "Some bug fixes and Minor Chages."
Diffstat (limited to 'jar')
-rwxr-xr-xjar/src/main/java/org/onap/music/main/MusicUtil.java2
-rwxr-xr-xjar/src/main/java/org/onap/music/main/PropertiesListener.java2
-rwxr-xr-xjar/src/main/java/org/onap/music/rest/RestMusicDataAPI.java14
3 files changed, 11 insertions, 7 deletions
diff --git a/jar/src/main/java/org/onap/music/main/MusicUtil.java b/jar/src/main/java/org/onap/music/main/MusicUtil.java
index 686b0d04..4acc3c5a 100755
--- a/jar/src/main/java/org/onap/music/main/MusicUtil.java
+++ b/jar/src/main/java/org/onap/music/main/MusicUtil.java
@@ -82,7 +82,7 @@ public class MusicUtil {
"all.pubic.ips", "cassandra.user", "cassandra.password", "aaf.endpoint.url" };
private static String cassName = "cassandra";
- private static String cassPwd = "cassandra";
+ private static String cassPwd = "";
private static String aafEndpointUrl = null;
private static int cassandraPort = 9042;
diff --git a/jar/src/main/java/org/onap/music/main/PropertiesListener.java b/jar/src/main/java/org/onap/music/main/PropertiesListener.java
index beb88af6..724d3d45 100755
--- a/jar/src/main/java/org/onap/music/main/PropertiesListener.java
+++ b/jar/src/main/java/org/onap/music/main/PropertiesListener.java
@@ -81,7 +81,7 @@ public class PropertiesListener implements ServletContextListener {
break;
case "debug":
MusicUtil.setDebug(Boolean
- .getBoolean(prop.getProperty(key).toLowerCase()));
+ .parseBoolean(prop.getProperty(key).toLowerCase()));
break;
case "version":
MusicUtil.setVersion(prop.getProperty(key));
diff --git a/jar/src/main/java/org/onap/music/rest/RestMusicDataAPI.java b/jar/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
index fc31cd9e..4b29f9a1 100755
--- a/jar/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
+++ b/jar/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
@@ -218,12 +218,16 @@ public class RestMusicDataAPI {
try {
queryObject = new PreparedQueryObject();
- queryObject.appendQueryString("CREATE ROLE IF NOT EXISTS '" + userId
- + "' WITH PASSWORD = '" + password + "' AND LOGIN = true;");
+// queryObject.appendQueryString("CREATE ROLE IF NOT EXISTS '" + userId
+// + "' WITH PASSWORD = '" + password + "' AND LOGIN = true;");
+ queryObject.appendQueryString("CREATE ROLE IF NOT EXISTS ? "
+ + " WITH PASSWORD = ? AND LOGIN = true;");
+ queryObject.addValue(userId);
+ queryObject.addValue(password);
MusicCore.nonKeyRelatedPut(queryObject, consistency);
queryObject = new PreparedQueryObject();
queryObject.appendQueryString("GRANT ALL PERMISSIONS on KEYSPACE " + keyspaceName
- + " to '" + userId + "'");
+ + " to '" + userId + "'");
queryObject.appendQueryString(";");
MusicCore.nonKeyRelatedPut(queryObject, consistency);
} catch (Exception e) {
@@ -235,8 +239,8 @@ public class RestMusicDataAPI {
String hashedpwd = BCrypt.hashpw(password, BCrypt.gensalt());
queryObject = new PreparedQueryObject();
queryObject.appendQueryString(
- "INSERT into admin.keyspace_master (uuid, keyspace_name, application_name, is_api, "
- + "password, username, is_aaf) values (?,?,?,?,?,?,?)");
+ "INSERT into admin.keyspace_master (uuid, keyspace_name, application_name, is_api, "
+ + "password, username, is_aaf) values (?,?,?,?,?,?,?)");
queryObject.addValue(MusicUtil.convertToActualDataType(DataType.uuid(), newAid));
queryObject.addValue(MusicUtil.convertToActualDataType(DataType.text(), keyspaceName));
queryObject.addValue(MusicUtil.convertToActualDataType(DataType.text(), ns));