Validate storage transfer job body after template rendering - #70529
Open
mitre88 wants to merge 1 commit into
Open
Validate storage transfer job body after template rendering#70529mitre88 wants to merge 1 commit into
mitre88 wants to merge 1 commit into
Conversation
The operator's body is a template field, but it was deep-copied and validated in __init__, so a fully templated body skipped validation entirely — the checks ran against the Jinja expression instead of the rendered dict, silently bypassing the AWS-credential restriction. Part of the burn-down tracked in apache#70296.
mitre88
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl,
potiuk and
shahar1
as code owners
July 27, 2026 15:31
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.
Part of the template-field validation burn-down tracked in #70296.
CloudDataTransferServiceCreateJobOperatorlistsbodyintemplate_fieldsbut deep-copies and validates it in__init__. With a fully templatedbody(a Jinja expression or XComArg), the validator ran against the un-rendered expression, soTransferJobValidator's checks — the AWS-credential restriction and the single-data-source rule — were silently bypassed. The deep copy and validation now run at the start ofexecute(), against the rendered value, right beforeTransferJobPreprocessormutates the body.Added a test constructing the operator with a templated
bodythat renders to a body embedding AWS credentials — with the previous implementation the credential check never fires and the job is created; now it raises before calling the hook. The class is removed from the exemption list and thevalidate-operators-initcheck passes locally.Per the discussion in #70505 this is a genuine value read (validation of the rendered dict), not an argument-provision check.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines