fm-cdera commented on code in PR #12011:
URL: https://github.com/apache/ozone/pull/12011#discussion_r4568524687


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/security/S3RevokeSTSTokenRequest.java:
##########
@@ -107,15 +105,17 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
       final RevokeSTSTokenRequest revokeReq = 
validateReplicatedRevokeRequestFields(getOmRequest());
       final String originalAccessKeyId = revokeReq.getOriginalAccessKeyId();
       auditMap.put(OzoneConsts.S3_REVOKESTSTOKEN_USER, originalAccessKeyId);
-      final long revocationTimeMillis = revokeReq.getRevocationTimeMillis();
+      // Update the cache immediately so subsequent validation checks see the 
revocation
+      final Long cutoff = S3SecretRequestHelper.updateStsRevocationCutoff(
+          ozoneManager.getMetadataManager(), getOmRequest(), 
originalAccessKeyId, context.getIndex());
+      if (cutoff == null) {
+        throw new OMException("revocationTimeMillis is required for STS token 
revocation", INTERNAL_ERROR);

Review Comment:
   I think `INTERNAL_ERROR` might be better since that branch could only be hit 
if the leader didn't replicate the STS revoke token request or some existing 
validation was removed.  I pushed a commit to add a comment around this.



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