ChenSammi commented on code in PR #12011:
URL: https://github.com/apache/ozone/pull/12011#discussion_r4571827598
##########
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:
INTERNAL_ERROR is OK in secure cluster setup. In non-secure cluster setup,
there is possibility that a raft client can send request direct to OM ratis
port -> applyTransaction -> validateAndUpdateCache, then terminate the OM. But
in non-secure cluster setup, there are many other ways to do the damage, so
this error code is not a big deal.
--
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]