Skip to content

Validate storage transfer job body after template rendering - #70529

Open
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:fix-storage-transfer-create-job
Open

Validate storage transfer job body after template rendering#70529
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:fix-storage-transfer-create-job

Conversation

@mitre88

@mitre88 mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Part of the template-field validation burn-down tracked in #70296.

CloudDataTransferServiceCreateJobOperator lists body in template_fields but deep-copies and validates it in __init__. With a fully templated body (a Jinja expression or XComArg), the validator ran against the un-rendered expression, so TransferJobValidator'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 of execute(), against the rendered value, right before TransferJobPreprocessor mutates the body.

Added a test constructing the operator with a templated body that 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 the validate-operators-init check 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?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:providers backport-to-v3-3-test Backport to v3-3-test provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant