updated test to dynamically fetch credential - #140
Merged
Merged
Conversation
vijaypdwivedi
requested review from
kuldeepchobe,
twincitiesguy and
xiaoxin-ren
September 11, 2026 12:19
xiaoxin-ren
requested changes
Sep 11, 2026
xiaoxin-ren
self-requested a review
September 15, 2026 09:13
xiaoxin-ren
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OBS04O-77 | Enhance S3TempCredentialsTest to dynamically fetch temporary credentials via STS
##Summary
• Enhanced S3TempCredentialsTest to dynamically fetch temporary credentials at runtime using STS AssumeRole , eliminating the need for static, pre-
generated credentials that expire and require manual rotation
• Follows the same pattern used by ECS Sync's EcsS3Test for temporary credential handling on Dell ECS/OBS clusters
• Added aws-java-sdk-sts and aws-java-sdk-iam as testImplementation dependencies (no impact on production artifact or published POM)
• Added sts.endpoint and iam.endpoint properties to TestProperties.java and test.properties.template
##What changed
S3TempCredentialsTest.java
• @BeforeClass creates IAM user, IAM role (with AssumeRole trust policy), and STS client — runs once per test class
• createS3Config() calls stsClient.assumeRole() per test to get fresh temporary credentials
• Falls back to static credentials from properties if sts.endpoint / iam.endpoint not configured (backward compatible)
• createBucket() overridden to use owner credentials and set bucket policy granting the assumed role access
• cleanUpBucket() overridden to use owner credentials
• @afterclass cleans up IAM user (and access keys) and role
• Added @ignore for inherited tests that require account-level permissions not available with temporary credentials (e.g., listBuckets , createBucket, deleteBucket , setBucketPolicy )
build.gradle
• Added com.amazonaws:aws-java-sdk-sts:1.12.766 and com.amazonaws:aws-java-sdk-iam:1.12.766 as testImplementation — test-only, zero impact on production classpath or published POM
• Uses AWS SDK v1 (not v2) because Dell ECS IAM/STS endpoints return XML incompatible with SDK v2 parsers
TestProperties.java
• Added STS_ENDPOINT and IAM_ENDPOINT constants
test.properties.template
• Documented sts.endpoint and iam.endpoint properties
• Marked static temp credential properties as legacy fallback
With s3.iam_user=true | 116 test cases are now passing out of 141. Previously, all 141 test cases were failing.
