ChenSammi commented on code in PR #12011:
URL: https://github.com/apache/ozone/pull/12011#discussion_r4560894580


##########
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:
   Will it better to use INVALID_REQUEST here, instead of INTERNAL_ERROR? 



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