smolnar82 commented on code in PR #799:
URL: https://github.com/apache/knox/pull/799#discussion_r1350100958


##########
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/TokenStateDatabase.java:
##########
@@ -192,7 +196,9 @@ Collection<KnoxToken> getDoAsTokens(String userName) throws 
SQLException {
   private Collection<KnoxToken> fetchTokens(String userName, String sql) 
throws SQLException {
     Map<String, KnoxToken> tokenMap = new LinkedHashMap<>();
     try (Connection connection = dataSource.getConnection(); PreparedStatement 
getTokenIdsStatement = connection.prepareStatement(sql)) {
-      getTokenIdsStatement.setString(1, userName);
+      if (userName != null) {
+        getTokenIdsStatement.setString(1, userName);

Review Comment:
   The result is an empty token list in the response for `getUserTokens`.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to