fmorg-git commented on code in PR #11030:
URL: https://github.com/apache/ozone/pull/11030#discussion_r3800236583


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/STSSecurityUtil.java:
##########
@@ -157,8 +159,9 @@ private static Token<STSTokenIdentifier> 
decodeTokenFromString(String encodedTok
     try {
       token.decodeFromUrlString(encodedToken);
       return token;
-    } catch (IOException e) {
-      throw new SecretManager.InvalidToken("Failed to decode STS token string: 
" + e);
+    } catch (IOException | RuntimeException e) {
+      throw new SecretManager.InvalidToken(
+          "Failed to decode STS token string: " + e + " for encodedToken: " + 
encodedToken);

Review Comment:
   updated (sorry I forgot why I left it out originally)



##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java:
##########
@@ -603,6 +603,14 @@ protected AuditMessage.Builder auditMessageFor(AuditAction 
op) {
     Map<String, String> auditMap = getAuditParameters();
     auditMap.put("x-amz-request-id", requestIdentifier.getRequestId());
     auditMap.put("x-amz-id-2", requestIdentifier.getAmzId());
+    if (s3Auth != null) {
+      // For STS temporary credentials, record the originalAccessKeyId (the 
permanent principal that
+      // created the token) so the audit trail is not limited to the opaque 
tempAccessKeyId.
+      final String originalAccessKeyId = 
AuditUtils.getStsOriginalAccessKeyId(s3Auth.getSessionToken());
+      if (originalAccessKeyId != null) {
+        auditMap.put("originalAccessKeyId", originalAccessKeyId);

Review Comment:
   updated



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to