zeroflag commented on a change in pull request #495:
URL: https://github.com/apache/knox/pull/495#discussion_r709352438
##########
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:
Revoker is never an empty string, right?
--
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]