Skip to content

Conversation

@fmorg-git
Copy link
Contributor

Please describe your PR in detail:

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14514

How was this patch tested?

unit tests and smoke tests

@fmorg-git fmorg-git marked this pull request as ready for review January 27, 2026 23:18
public class OSTSException extends OS3Exception {
private static final Logger LOG = LoggerFactory.getLogger(OSTSException.class);
private static final ObjectMapper MAPPER;
private static final String AWS_FAULT_NS = "http://webservices.amazon.com/AWSFault/2005-15-09";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make AWS_FAULT_NS and STS_NS public, so that other places(tests) can refer to this directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've read and past experience, it might not be a good idea to refer to the constants from the main logic in the tests. For example, suppose someone in future accidentally changes the value of OSTSException.AWS_FAULT_NS to some incorrect value, then if the tests refer to this constant, the tests will still pass, although the code in the main logic is incorrect. Having separate constants in the main logic and the tests gives a little more safety, because someone would have to change it incorrectly in multiple places for the tests to still pass.

if (version == null || !version.equals("2011-06-15")) {
throw new OSTSException(
"InvalidAction", "Could not find operation " + action + " for version " +
(version == null ? "NO_VERSION_SPECIFIED" : version), BAD_REQUEST.getStatusCode());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the expected version number to the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@ChenSammi
Copy link
Contributor

Thanks @fmorg-git , left two minor comments, overall it looks good to me.

@ChenSammi ChenSammi added the sts Changes for Ozone's S3 Security Token Service label Jan 28, 2026
@fmorg-git fmorg-git requested a review from ChenSammi January 28, 2026 11:35
@ChenSammi
Copy link
Contributor

Thanks @fmorg-git for updating the patch. Wait for the CI to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sts Changes for Ozone's S3 Security Token Service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants