risdenk commented on a change in pull request #217: KNOX-2147 - Mask
username/password in case we display call history and keep them safely (by
setting proper file permissions) in JSON file
URL: https://github.com/apache/knox/pull/217#discussion_r357762209
##########
File path:
gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/JDBCKnoxShellTableBuilder.java
##########
@@ -107,15 +109,12 @@ public KnoxShellTable sql(String sql) throws
IOException, SQLException {
return this.table;
}
- public Connection createConnection() throws SQLException {
- Connection con = null;
- if (username != null && pass != null) {
- con = DriverManager.getConnection(connectionUrl, username, pass);
- }
- else {
- con = DriverManager.getConnection(connectionUrl);
+ private Connection createConnection() throws SQLException {
+ if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(pass)) {
Review comment:
should a `""` password be allowed? (I have no idea if that is valid)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services