Skip to content

[v3-2-test] Apply reserved-key check to XCom update payload (#65915)#66913

Merged
bbovenzi merged 1 commit into
v3-2-testfrom
backport-322-65915
May 15, 2026
Merged

[v3-2-test] Apply reserved-key check to XCom update payload (#65915)#66913
bbovenzi merged 1 commit into
v3-2-testfrom
backport-322-65915

Conversation

@vatsrahul1001
Copy link
Copy Markdown
Contributor

@vatsrahul1001 vatsrahul1001 commented May 14, 2026

Cherry-pick of #65915

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

XComCreateBody (POST /xcomEntries) rejects payloads containing
reserved serialization keys (__classname__, __type, __var,
__data__, …) via a field_validator that walks the value
recursively. XComUpdateBody (PATCH /xcomEntries/{key}) was
missing the same validator, so a payload that POST correctly
rejects with 422 was accepted on PATCH and stored as-is.

Extracts the recursive walker to a module-level
_check_forbidden_xcom_keys helper and has both XComCreateBody
and XComUpdateBody delegate to it, so create and update apply
the same payload-key check from a single source. A parametrized
test mirroring the existing
test_create_xcom_entry_blocks_forbidden_keys covers the PATCH
path.

(cherry picked from commit c173489)
@vatsrahul1001 vatsrahul1001 requested review from bbovenzi and potiuk May 15, 2026 04:39
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 15, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label May 15, 2026
@bbovenzi bbovenzi merged commit 48d53b6 into v3-2-test May 15, 2026
110 checks passed
@bbovenzi bbovenzi deleted the backport-322-65915 branch May 15, 2026 20:31
vatsrahul1001 added a commit that referenced this pull request May 20, 2026
XComCreateBody (POST /xcomEntries) rejects payloads containing
reserved serialization keys (__classname__, __type, __var,
__data__, …) via a field_validator that walks the value
recursively. XComUpdateBody (PATCH /xcomEntries/{key}) was
missing the same validator, so a payload that POST correctly
rejects with 422 was accepted on PATCH and stored as-is.

Extracts the recursive walker to a module-level
_check_forbidden_xcom_keys helper and has both XComCreateBody
and XComUpdateBody delegate to it, so create and update apply
the same payload-key check from a single source. A parametrized
test mirroring the existing
test_create_xcom_entry_blocks_forbidden_keys covers the PATCH
path.

(cherry picked from commit c173489)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001 added a commit that referenced this pull request May 20, 2026
XComCreateBody (POST /xcomEntries) rejects payloads containing
reserved serialization keys (__classname__, __type, __var,
__data__, …) via a field_validator that walks the value
recursively. XComUpdateBody (PATCH /xcomEntries/{key}) was
missing the same validator, so a payload that POST correctly
rejects with 422 was accepted on PATCH and stored as-is.

Extracts the recursive walker to a module-level
_check_forbidden_xcom_keys helper and has both XComCreateBody
and XComUpdateBody delegate to it, so create and update apply
the same payload-key check from a single source. A parametrized
test mirroring the existing
test_create_xcom_entry_blocks_forbidden_keys covers the PATCH
path.

(cherry picked from commit c173489)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001 added a commit that referenced this pull request May 21, 2026
XComCreateBody (POST /xcomEntries) rejects payloads containing
reserved serialization keys (__classname__, __type, __var,
__data__, …) via a field_validator that walks the value
recursively. XComUpdateBody (PATCH /xcomEntries/{key}) was
missing the same validator, so a payload that POST correctly
rejects with 422 was accepted on PATCH and stored as-is.

Extracts the recursive walker to a module-level
_check_forbidden_xcom_keys helper and has both XComCreateBody
and XComUpdateBody delegate to it, so create and update apply
the same payload-key check from a single source. A parametrized
test mirroring the existing
test_create_xcom_entry_blocks_forbidden_keys covers the PATCH
path.

(cherry picked from commit c173489)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

3 participants