pzampino commented on a change in pull request #252: KNOX-2207 -
TokenStateService revocation should remove persisted token state
URL: https://github.com/apache/knox/pull/252#discussion_r374855185
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/AliasBasedTokenStateService.java
##########
@@ -125,11 +126,27 @@ protected boolean isUnknown(final String token) {
return isUnknown;
}
+ @Override
+ protected void removeRevokedExpiredToken(final String token) {
+ if (isUnknown(token)) {
+ log.unknownToken(getTokenDisplayText(token));
+ throw new IllegalArgumentException("Unknown or revoked token.");
+ }
+
+ try {
+ aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME, token);
+ aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME,token +
"--max");
+ } catch (AliasServiceException e) {
+ log.failedToUpdateTokenExpiration(e);
+ }
+
+ }
+
@Override
protected void updateExpiration(final String token, long expiration) {
if (isUnknown(token)) {
log.unknownToken(getTokenDisplayText(token));
- throw new IllegalArgumentException("Unknown token.");
+ throw new IllegalArgumentException("Unknown or revoked token.");
Review comment:
I think we can continue treating them simply as "unknown", rather than
giving the illusion of distinction.
----------------------------------------------------------------
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