fix(objectstore): pass ExternalId when assuming the S3 export role - #2710
Open
AtMrun wants to merge 1 commit into
Open
fix(objectstore): pass ExternalId when assuming the S3 export role#2710AtMrun wants to merge 1 commit into
AtMrun wants to merge 1 commit into
Conversation
S3Sync assumes the target role via AssumeRoleRequest with only roleArn + roleSessionName. A role whose trust policy sets an sts:ExternalId condition rejects any assume that omits it, failing the upload/download with a generic AccessDenied that is indistinguishable from a missing trust-policy grant. Thread an optional aws_external_id from the S3 credential's `extra` through S3Credential -> S3Sync -> AssumeRoleRequest, mirroring the fix already shipped for the same gap in atlan-generic-miner-app (atlanhq/atlan-generic-miner-app#10, CONNECT-173). The ExternalId is only set on the request when non-blank, so roles without that trust condition are unaffected. Ref: CSA-526 ([bbva-pov] Asset Export — AssumeRole 403 missing ExternalId)
Author
|
@sdk-resolve please review this PR, handle any review nuances/fixes, and get CI green. This mirrors the already-merged Python fix in atlanhq/atlan-generic-miner-app#10 (CONNECT-173) for the same missing-ExternalId gap. Flagged in the PR description: the marketplace-packages UI-field gap (no aws_external_id form field on the S3/Asset-Export credential configmaps) is NOT covered here and needs separate follow-up. |
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.
Problem
S3Syncassumes the target role viaAssumeRoleRequestwith onlyroleArn+roleSessionName. A role whose trust policy sets ansts:ExternalIdcondition rejects any assume that omits it — the caller-side effect is a genericAccessDeniedon the S3 upload/download step that is indistinguishable from a missing trust-policy grant, which cost real triage time on CSA-526.This is the same code shape as CONNECT-173 (
atlan-generic-miner-app, fixed in #10) — BBVA POV hit it twice, once in each codebase's independentsts.assume_roleimplementation, because neither used a shared "assume role for S3" helper.Change
S3Credential.externalId: readsextra.aws_external_id, empty string if absent (mirrors the existingroleArnfield).S3Synctakes an optionalexternalIdconstructor param; setsAssumeRoleRequest.externalId(...)only when non-blank, so roles without ansts:ExternalIdtrust condition are unaffected (an emptyExternalIdwould trip AWS's min-length-2 validation).s3.externalIdthrough all fourS3Sync(...)call sites inUtils.kt.Not covered by this PR
csa-connectors-objectstore.yaml,csa-connectors-s3.yaml,packages/csa/s3/configmaps/default.yamlinmarketplace-packages) expose anaws_external_idfield today — same gap the generic-miner fix closed via its own configmap. Determining which of these three configmaps backscsa-asset-export-basicspecifically (and safely regenerating its rendered JSON) is amarketplace-packages-repo change outside this PR's scope; flagging for a human to pick up as a fast-follow so CSA-526's customer path can actually be unblocked end-to-end.S3Sync/S3Credentialhave no existing test harness (no mocks for the static AWS SDK v2 builders) to extend — adding one is a larger lift than this scoped parity fix; a human should decide whether to invest in that harness now or accept a manual-test callout on review.Testing
gradle :package-toolkit:runtime:compileKotlinfails on toolchain auto-provisioning), so I could not compile/run this locally. The diff is a small, mechanical mirror of the already-merged and tested Python fix; please run the module's build/tests in CI before merge.Ref: CSA-526 ([bbva-pov] Asset Export — AssumeRole 403 missing ExternalId), CONNECT-173
🤖 Generated with Claude Code