You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "fmorg-git (via GitHub)" <gi...@apache.org> on 2026/03/31 01:07:31 UTC
[PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
fmorg-git opened a new pull request, #10009:
URL: https://github.com/apache/ozone/pull/10009
Please describe your PR in detail:
* Currently, S3 APIs are not consistent in how ACL checks are applied. For example, `PutObject` (i.e. OMKeyCreateRequest, OMAllocateBlockRequest, OMKeyCommitRequest), `DeleteObject` (i.e. OMKeyDeleteRequest), `PutObjectTagging` (i.e. S3PutObjectTaggingRequest), etc. perform their ACL checks in `preExecute()` which is on the OM leader RPC thread.
However, APIs like `DeleteBucket` (i.e. OMBucketDeleteRequest), `PutBucketAcl` (i.e. OMBucketAclRequest), etc. perform their ACL checks in `validateAndUpdateCache()` which is on the Ratis apply thread. This affects STS in that the STSTokenIdentifier ThreadLocal currently is not available on the Ratis apply thread, so if the STS token has an inline session policy, some ACL checks that should pass would fail. This ticket addresses the inconsistency by ensuring the ThreadLocal is always available on the Ratis apply thread via updates to `OzoneManagerStateMachine`.
* This PR depends on https://github.com/apache/ozone/pull/9977
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14935
## How was this patch tested?
unit tests, smoke tests
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3278319117
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/acl/OMBucketSetAclRequest.java:
##########
@@ -54,14 +54,15 @@ public class OMBucketSetAclRequest extends OMBucketAclRequest {
@Override
public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
- long modificationTime = Time.now();
- OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
+ final long modificationTime = Time.now();
+ final OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
getOmRequest().getSetAclRequest().toBuilder()
.setModificationTime(modificationTime);
- return getOmRequest().toBuilder()
+ // super.preExecute resolves S3Authentication (STS) for Ratis apply. Merge SetAclRequest changes on top.
+ final OMRequest request = super.preExecute(ozoneManager);
Review Comment:
> There are two other requests, OMBucketAddAclRequest, OMBucketRemoveAclRequest. So we should consider move this to OMBucketAclRequest.
updated as part of 6d43f3971493255c82538f7f413466a81380bfe0. I changed the subclasses directly.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3271132719
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java:
##########
@@ -662,7 +664,29 @@ public void close() {
*/
@VisibleForTesting
OMResponse runCommand(OMRequest request, TermIndex termIndex) {
+ boolean isStsThreadLocalSet = false;
try {
+ if (ozoneManager.isSecurityEnabled() && request.hasS3Authentication()) {
+ // STS token verification runs on the leader RPC path so we don't need to recheck here on the apply
+ // after the log is committed
+ STSSecurityUtil.ensureResolvedStsFieldsInvariants(request);
+
+ final OzoneManagerProtocolProtos.S3Authentication s3Auth = request.getS3Authentication();
+ if (s3Auth.hasSessionToken() && !s3Auth.getSessionToken().isEmpty()) {
+ // ThreadLocal carries session policy for OmMetadataReader
+ final STSTokenIdentifier rehydratedTokenIdentifier = new STSTokenIdentifier(
+ s3Auth.hasResolvedStsTempAccessKeyId() ? s3Auth.getResolvedStsTempAccessKeyId() : "",
+ s3Auth.hasResolvedStsOriginalAccessKeyId() ? s3Auth.getResolvedStsOriginalAccessKeyId() : "",
+ s3Auth.hasResolvedStsRoleArn() ? s3Auth.getResolvedStsRoleArn() : "",
+ java.time.Instant.MAX, // ensure it deterministically is not expired
+ "", // no secretAccessKey needed
+ s3Auth.hasResolvedStsSessionPolicy() ? s3Auth.getResolvedStsSessionPolicy() : "",
+ null // no encryption key needed
+ );
+ OzoneManager.setStsTokenIdentifier(rehydratedTokenIdentifier);
+ isStsThreadLocalSet = true;
+ }
Review Comment:
The added STS apply-path behavior (invariant check + setting/clearing STS_TOKEN ThreadLocal) isn’t covered by existing OzoneManagerStateMachine tests. Please add a unit test that runs runCommand() with an OMRequest containing S3Authentication+sessionToken+resolvedSts* fields and asserts the ThreadLocal is set during handler.handleWriteRequest and cleared afterward, plus a test that missing resolved fields yields an error response.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java:
##########
@@ -112,15 +114,50 @@ public OMClientRequest(OMRequest omRequest) {
*/
public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
- LayoutVersion layoutVersion = LayoutVersion.newBuilder()
+ final LayoutVersion layoutVersion = LayoutVersion.newBuilder()
.setVersion(ozoneManager.getVersionManager().getMetadataLayoutVersion())
.build();
- omRequest = getOmRequest().toBuilder()
+
+ final OMRequest.Builder requestBuilder = getOmRequest().toBuilder()
.setUserInfo(getUserIfNotExists(ozoneManager))
- .setLayoutVersion(layoutVersion).build();
+ .setLayoutVersion(layoutVersion);
+
+ if (requestBuilder.hasS3Authentication()) {
+ requestBuilder.setS3Authentication(
+ resolveS3Authentication(requestBuilder.getS3Authentication(), OzoneManager.getStsTokenIdentifier()));
+ }
+
Review Comment:
The new STS field resolution is only applied in OMClientRequest.preExecute(). Any request class that overrides preExecute without calling super will bypass resolveS3Authentication(), so STS requests can reach Ratis apply without resolvedSts* fields and then fail STSSecurityUtil.ensureResolvedStsFieldsInvariants() in OzoneManagerStateMachine. To avoid breaking those request types, either enforce this logic (eg make preExecute final and provide a hook) or update all overriding preExecute implementations to call super.preExecute and build from its returned request/builder (several existing bucket/ACL requests currently don’t).
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3309448932
##########
hadoop-hdds/dev-support/checkstyle/checkstyle.xml:
##########
@@ -83,6 +83,12 @@
<property name="matchAcrossLines" value="true"/>
<property name="message" value="Use Objects.requireNonNull instead of Preconditions.checkNotNull"/>
</module>
+ <module name="RegexpMultiline">
+ <property name="format"
+ value="@Override\s+public\s+(?:(?:final|synchronized)\s+)*OMRequest\s+preExecute\s*\([^\)]*\)\s*(?:throws\s+[^{]+)?\s*\{(?!(?:(?!\/\*|\*\/)[\s\S]|\/\*(?:(?!\*\/)[\s\S])*\*\/){0,400}?(?:^|\r?\n|(?<=\{))[ \t]*(?!\*|\/)(?:return\s+|final\s+(?:[a-zA-Z0-9_]+\s+)*[a-zA-Z0-9_]+[ \t]*=[ \t]*)?(?:\([a-zA-Z0-9_]+\)\s*)?super\s*\.\s*preExecute\s*\()"/>
Review Comment:
This rule does not enforce the invariant described in its message. The `return/final ... =` group before `super.preExecute(` is optional, so a bare `super.preExecute(ozoneManager);` passes even if the returned request is discarded, and the pattern also misses overrides with another annotation between `@Override` and `public` (for example `@DisallowedUntilLayoutVersion`). Please tighten the regexp or add a more robust check so future `preExecute` overrides cannot bypass the resolved S3Authentication fields.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3278316896
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java:
##########
@@ -112,15 +114,50 @@ public OMClientRequest(OMRequest omRequest) {
*/
public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
- LayoutVersion layoutVersion = LayoutVersion.newBuilder()
+ final LayoutVersion layoutVersion = LayoutVersion.newBuilder()
.setVersion(ozoneManager.getVersionManager().getMetadataLayoutVersion())
.build();
- omRequest = getOmRequest().toBuilder()
+
+ final OMRequest.Builder requestBuilder = getOmRequest().toBuilder()
.setUserInfo(getUserIfNotExists(ozoneManager))
- .setLayoutVersion(layoutVersion).build();
+ .setLayoutVersion(layoutVersion);
+
+ if (requestBuilder.hasS3Authentication()) {
+ requestBuilder.setS3Authentication(
+ resolveS3Authentication(requestBuilder.getS3Authentication(), OzoneManager.getStsTokenIdentifier()));
+ }
+
Review Comment:
updated to fix all overriding preExecute implementations and to add a checkstyle rule for future ones - 6d43f3971493255c82538f7f413466a81380bfe0
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3271306126
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/acl/OMBucketSetAclRequest.java:
##########
@@ -54,14 +54,15 @@ public class OMBucketSetAclRequest extends OMBucketAclRequest {
@Override
public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
- long modificationTime = Time.now();
- OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
+ final long modificationTime = Time.now();
+ final OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
getOmRequest().getSetAclRequest().toBuilder()
.setModificationTime(modificationTime);
- return getOmRequest().toBuilder()
+ // super.preExecute resolves S3Authentication (STS) for Ratis apply. Merge SetAclRequest changes on top.
+ final OMRequest request = super.preExecute(ozoneManager);
Review Comment:
There are two other requests, OMBucketAddAclRequest, OMBucketRemoveAclRequest. So we should consider move this to OMBucketAclRequest.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3278312601
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java:
##########
@@ -662,7 +664,29 @@ public void close() {
*/
@VisibleForTesting
OMResponse runCommand(OMRequest request, TermIndex termIndex) {
+ boolean isStsThreadLocalSet = false;
try {
+ if (ozoneManager.isSecurityEnabled() && request.hasS3Authentication()) {
+ // STS token verification runs on the leader RPC path so we don't need to recheck here on the apply
+ // after the log is committed
+ STSSecurityUtil.ensureResolvedStsFieldsInvariants(request);
+
+ final OzoneManagerProtocolProtos.S3Authentication s3Auth = request.getS3Authentication();
+ if (s3Auth.hasSessionToken() && !s3Auth.getSessionToken().isEmpty()) {
+ // ThreadLocal carries session policy for OmMetadataReader
+ final STSTokenIdentifier rehydratedTokenIdentifier = new STSTokenIdentifier(
+ s3Auth.hasResolvedStsTempAccessKeyId() ? s3Auth.getResolvedStsTempAccessKeyId() : "",
+ s3Auth.hasResolvedStsOriginalAccessKeyId() ? s3Auth.getResolvedStsOriginalAccessKeyId() : "",
+ s3Auth.hasResolvedStsRoleArn() ? s3Auth.getResolvedStsRoleArn() : "",
+ java.time.Instant.MAX, // ensure it deterministically is not expired
+ "", // no secretAccessKey needed
+ s3Auth.hasResolvedStsSessionPolicy() ? s3Auth.getResolvedStsSessionPolicy() : "",
+ null // no encryption key needed
+ );
+ OzoneManager.setStsTokenIdentifier(rehydratedTokenIdentifier);
+ isStsThreadLocalSet = true;
+ }
Review Comment:
updated - c483af56f0ef4f0e45b7cbc935b63bc37424afb7
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10009:
URL: https://github.com/apache/ozone/pull/10009#issuecomment-4292665365
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3271288431
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java:
##########
@@ -112,15 +114,50 @@ public OMClientRequest(OMRequest omRequest) {
*/
public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
- LayoutVersion layoutVersion = LayoutVersion.newBuilder()
+ final LayoutVersion layoutVersion = LayoutVersion.newBuilder()
.setVersion(ozoneManager.getVersionManager().getMetadataLayoutVersion())
.build();
- omRequest = getOmRequest().toBuilder()
+
+ final OMRequest.Builder requestBuilder = getOmRequest().toBuilder()
.setUserInfo(getUserIfNotExists(ozoneManager))
- .setLayoutVersion(layoutVersion).build();
+ .setLayoutVersion(layoutVersion);
+
+ if (requestBuilder.hasS3Authentication()) {
+ requestBuilder.setS3Authentication(
+ resolveS3Authentication(requestBuilder.getS3Authentication(), OzoneManager.getStsTokenIdentifier()));
+ }
+
+ omRequest = requestBuilder.build();
return omRequest;
}
+ private static OzoneManagerProtocolProtos.S3Authentication resolveS3Authentication(
+ OzoneManagerProtocolProtos.S3Authentication s3Auth, STSTokenIdentifier stsTokenIdentifier) {
+ final OzoneManagerProtocolProtos.S3Authentication.Builder s3AuthBuilder = s3Auth.toBuilder();
+
+ if (s3Auth.hasSessionToken() && !s3Auth.getSessionToken().isEmpty() && stsTokenIdentifier != null) {
Review Comment:
Is "s3Auth.hasSessionToken() && !s3Auth.getSessionToken().isEmpty()" and null stsTokenIdentifier allowed?
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3271286756
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/acl/OMBucketSetAclRequest.java:
##########
@@ -54,14 +54,15 @@ public class OMBucketSetAclRequest extends OMBucketAclRequest {
@Override
public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
- long modificationTime = Time.now();
- OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
+ final long modificationTime = Time.now();
+ final OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
getOmRequest().getSetAclRequest().toBuilder()
.setModificationTime(modificationTime);
- return getOmRequest().toBuilder()
+ // super.preExecute resolves S3Authentication (STS) for Ratis apply. Merge SetAclRequest changes on top.
+ final OMRequest request = super.preExecute(ozoneManager);
Review Comment:
You mentioned OMBucketDeleteRequest in the JIRA description. Shall we call the super.preExecute in OMBucketDeleteRequest too?
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on PR #10009:
URL: https://github.com/apache/ozone/pull/10009#issuecomment-4556327482
Thanks all for the review and merge.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "Russole (via GitHub)" <gi...@apache.org>.
Russole commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3276138201
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/acl/OMBucketSetAclRequest.java:
##########
@@ -54,14 +54,15 @@ public class OMBucketSetAclRequest extends OMBucketAclRequest {
@Override
public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
- long modificationTime = Time.now();
- OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
+ final long modificationTime = Time.now();
+ final OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
getOmRequest().getSetAclRequest().toBuilder()
.setModificationTime(modificationTime);
- return getOmRequest().toBuilder()
+ // super.preExecute resolves S3Authentication (STS) for Ratis apply. Merge SetAclRequest changes on top.
+ final OMRequest request = super.preExecute(ozoneManager);
Review Comment:
Agreed, we should call `super.preExecute()` in `OMBucketDeleteRequest` as well.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3278321553
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java:
##########
@@ -112,15 +114,50 @@ public OMClientRequest(OMRequest omRequest) {
*/
public OMRequest preExecute(OzoneManager ozoneManager)
throws IOException {
- LayoutVersion layoutVersion = LayoutVersion.newBuilder()
+ final LayoutVersion layoutVersion = LayoutVersion.newBuilder()
.setVersion(ozoneManager.getVersionManager().getMetadataLayoutVersion())
.build();
- omRequest = getOmRequest().toBuilder()
+
+ final OMRequest.Builder requestBuilder = getOmRequest().toBuilder()
.setUserInfo(getUserIfNotExists(ozoneManager))
- .setLayoutVersion(layoutVersion).build();
+ .setLayoutVersion(layoutVersion);
+
+ if (requestBuilder.hasS3Authentication()) {
+ requestBuilder.setS3Authentication(
+ resolveS3Authentication(requestBuilder.getS3Authentication(), OzoneManager.getStsTokenIdentifier()));
+ }
+
+ omRequest = requestBuilder.build();
return omRequest;
}
+ private static OzoneManagerProtocolProtos.S3Authentication resolveS3Authentication(
+ OzoneManagerProtocolProtos.S3Authentication s3Auth, STSTokenIdentifier stsTokenIdentifier) {
+ final OzoneManagerProtocolProtos.S3Authentication.Builder s3AuthBuilder = s3Auth.toBuilder();
+
+ if (s3Auth.hasSessionToken() && !s3Auth.getSessionToken().isEmpty() && stsTokenIdentifier != null) {
Review Comment:
no this is not allowed. Updated to throw an error if this happens and a unit test coverage - b1ed2d2b455c1704d190bd59b66378d843423cb7
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on PR #10009:
URL: https://github.com/apache/ozone/pull/10009#issuecomment-4292715094
adding comment to remove stale label
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on PR #10009:
URL: https://github.com/apache/ozone/pull/10009#issuecomment-4479362966
hi @ChenSammi @sodonnel - just a quick reminder that this PR is ready to review. Thanks!
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "fmorg-git (via GitHub)" <gi...@apache.org>.
fmorg-git commented on code in PR #10009:
URL: https://github.com/apache/ozone/pull/10009#discussion_r3277927852
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/acl/OMBucketSetAclRequest.java:
##########
@@ -54,14 +54,15 @@ public class OMBucketSetAclRequest extends OMBucketAclRequest {
@Override
public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
- long modificationTime = Time.now();
- OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
+ final long modificationTime = Time.now();
+ final OzoneManagerProtocolProtos.SetAclRequest.Builder setAclRequestBuilder =
getOmRequest().getSetAclRequest().toBuilder()
.setModificationTime(modificationTime);
- return getOmRequest().toBuilder()
+ // super.preExecute resolves S3Authentication (STS) for Ratis apply. Merge SetAclRequest changes on top.
+ final OMRequest request = super.preExecute(ozoneManager);
Review Comment:
> You mentioned OMBucketDeleteRequest in the JIRA description. Shall we call the super.preExecute in OMBucketDeleteRequest too?
`OMBucketDeleteRequest` doesn't override `preExecute()` method, so it automatically gets the resolved sts fields behavior. The issue happens when a subclass overrides `preExecute()` but does *not* call `super.preExecute()`.
--
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
Re: [PR] HDDS-14935. [STS] Handle Latent Inconsistencies in S3 API Acl Checks [ozone]
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi merged PR #10009:
URL: https://github.com/apache/ozone/pull/10009
--
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