smolnar82 commented on a change in pull request #495:
URL: https://github.com/apache/knox/pull/495#discussion_r709357669



##########
File path: 
gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
##########
@@ -527,6 +527,12 @@ public Response revoke(String token) {
     return resp;
   }
 
+  private boolean triesToRevokeOwnToken(String tokenId, String revoker) throws 
UnknownTokenException {
+    final TokenMetadata metadata = tokenStateService.getTokenMetadata(tokenId);
+    final String tokenUserName = metadata == null ? "" : 
metadata.getUserName();
+    return revoker != null && revoker.equals(tokenUserName);

Review comment:
       In theory, it should always be set, but you are right: an additional 
emptiness checking does not hurt and could avoid weird issues.
   I submitted a new PS.




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