knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject [knox] branch master updated: KNOX-2578 - TokenResource logging token UUIDs (#434)
Date Wed, 14 Apr 2021 20:48:38 GMT
This is an automated email from the ASF dual-hosted git repository.

pzampino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new fcac9b2  KNOX-2578 - TokenResource logging token UUIDs (#434)
fcac9b2 is described below

commit fcac9b2c5c2e1bb406e6ffd412714485ae4d0a31
Author: Phil Zampino <pzampino@apache.org>
AuthorDate: Wed Apr 14 16:47:28 2021 -0400

    KNOX-2578 - TokenResource logging token UUIDs (#434)
---
 .../apache/knox/gateway/service/knoxtoken/TokenResource.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
b/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
index 9f285ee..a5e852a 100644
--- a/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
+++ b/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
@@ -261,7 +261,9 @@ public class TokenResource {
       // If the token state service is disabled, then return the expiration from the specified
token
       try {
         JWTToken jwt = new JWTToken(token);
-        log.renewalDisabled(getTopologyName(), Tokens.getTokenDisplayText(token), TokenUtils.getTokenId(jwt));
+        log.renewalDisabled(getTopologyName(),
+                            Tokens.getTokenDisplayText(token),
+                            Tokens.getTokenIDDisplayText(TokenUtils.getTokenId(jwt)));
         expiration = Long.parseLong(jwt.getExpires());
       } catch (ParseException e) {
         log.invalidToken(getTopologyName(), Tokens.getTokenDisplayText(token), e);
@@ -279,7 +281,7 @@ public class TokenResource {
                                                     renewInterval.orElse(tokenStateService.getDefaultRenewInterval()));
           log.renewedToken(getTopologyName(),
                            Tokens.getTokenDisplayText(token),
-                           TokenUtils.getTokenId(jwt),
+                           Tokens.getTokenIDDisplayText(TokenUtils.getTokenId(jwt)),
                            renewer);
         } catch (ParseException e) {
           log.invalidToken(getTopologyName(), Tokens.getTokenDisplayText(token), e);
@@ -326,7 +328,7 @@ public class TokenResource {
           tokenStateService.revokeToken(jwt);
           log.revokedToken(getTopologyName(),
                            Tokens.getTokenDisplayText(token),
-                           TokenUtils.getTokenId(jwt),
+                           Tokens.getTokenIDDisplayText(TokenUtils.getTokenId(jwt)),
                            renewer);
         } catch (ParseException e) {
           log.invalidToken(getTopologyName(), Tokens.getTokenDisplayText(token), e);
@@ -416,7 +418,7 @@ public class TokenResource {
       if (token != null) {
         String accessToken = token.toString();
         String tokenId = TokenUtils.getTokenId(token);
-        log.issuedToken(getTopologyName(), Tokens.getTokenDisplayText(accessToken), tokenId);
+        log.issuedToken(getTopologyName(), Tokens.getTokenDisplayText(accessToken), Tokens.getTokenIDDisplayText(tokenId));
 
         HashMap<String, Object> map = new HashMap<>();
         map.put(ACCESS_TOKEN, accessToken);
@@ -443,7 +445,7 @@ public class TokenResource {
                                      expires,
                                      maxTokenLifetime.orElse(tokenStateService.getDefaultMaxLifetimeDuration()));
           tokenStateService.addMetadata(tokenId, new TokenMetadata(p.getName()));
-          log.storedToken(getTopologyName(), Tokens.getTokenDisplayText(accessToken), tokenId);
+          log.storedToken(getTopologyName(), Tokens.getTokenDisplayText(accessToken), Tokens.getTokenIDDisplayText(tokenId));
         }
 
         return Response.ok().entity(jsonResponse).build();

Mime
View raw message