You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ChenSammi (via GitHub)" <gi...@apache.org> on 2026/07/15 04:39:54 UTC

Re: [PR] HDDS-15861. [STS] Actions must not be sent in RequestContext to Authorizer if feature flag is off [ozone]

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataReader.java:
##########
@@ -673,14 +673,21 @@ public boolean checkAcls(OzoneObj obj, RequestContext.Builder contextBuilder,
    * thread locals: the session policy from {@link STSTokenIdentifier} (set on STS requests) and the
    * S3 action from {@link S3Authentication} (set on S3 requests). Either or both may be absent, in
    * which case the corresponding field is left untouched on the builder.
+   * <p>
+   * The S3 action is only propagated when the S3 STS feature flag is enabled, since it is only used
+   * for fine-grained STS authorization.
    * @param contextBuilder the builder to enrich in-place
    */
-  public static void maybeAddToContextFromThreadLocal(RequestContext.Builder contextBuilder) {
+  private void maybeAddToContextFromThreadLocal(RequestContext.Builder contextBuilder) {
     final STSTokenIdentifier stsTokenIdentifier = OzoneManager.getStsTokenIdentifier();
     if (stsTokenIdentifier != null) {
       contextBuilder.setSessionPolicy(stsTokenIdentifier.getSessionPolicy());
     }
 
+    if (!ozoneManager.isS3STSEnabled()) {
+      return;

Review Comment:
   If sts is diabled, do we still need to set SessionPolicy into context? 



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org