diff options
author | Thomas Nelson arthudent3 <nelson24@att.com> | 2019-06-19 22:19:10 +0000 |
---|---|---|
committer | Thomas Nelson arthudent3 <nelson24@att.com> | 2019-06-25 13:20:59 +0000 |
commit | 881f14bc8676cedd68e17bd007a869fa85578fa1 (patch) | |
tree | 0dc37c36af2483d5d0925dd84993f93f344688f8 /jar/src/main/java/org/onap/music/rest | |
parent | 078f69315e4b4faffc50e1c7dfde717396e48194 (diff) |
Some bug fixes and Minor Chages.
Remove some Commented out code.
Cleaned up Variables.
Encryption of passwords added
Updated Test Cases
Fixed some errors in how they were reported.
Reduced Logging clutter
Some Vulnerability fixes.
Change-Id: I64c7935d167d4a976681b5a18fd51aa667d0cd95
Issue-ID: MUSIC-413
Signed-off-by: Thomas Nelson arthudent3 <nelson24@att.com>
Diffstat (limited to 'jar/src/main/java/org/onap/music/rest')
-rwxr-xr-x | jar/src/main/java/org/onap/music/rest/RestMusicDataAPI.java | 14 |
1 files changed, 9 insertions, 5 deletions
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)); |