Skip to content

Add regression test for Connection extra redact safeguard - #71439

Merged
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:test-connection-extra-redact-safeguard
Aug 12, 2026
Merged

bbovenzi merged 1 commit into
apache:mainfrom
astronomer:test-connection-extra-redact-safeguard

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

#63883 added a fail-closed safeguard on ConnectionResponse.redact_extra: if extra ever slips past Connection._validate_extra and reaches the response serializer as a non-JSON string (direct SQL, buggy migration, legacy data), the validator raises rather than returning the raw value — closing the leak described in #63160.

Through the normal ORM path that safeguard is unreachable because Connection.get_extra already fails on read, so the model-level guard is defense in depth. It had no test until now — this feeds the Pydantic model directly to exercise the JSONDecodeError branch and pin the fail-closed behavior against future refactors.

closes: #63160

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

apache#63883 added a fail-closed safeguard on ``ConnectionResponse.redact_extra``:
if the ``extra`` column ever slips past ``Connection._validate_extra`` (direct
SQL, buggy migration, legacy data) and reaches the response serializer as a
non-JSON string, the validator raises rather than returning the raw value.
The path is unreachable through normal ORM access because ``Connection.get_extra``
already fails on read, so the model-level guard is defense in depth. It had
no test until now — this feeds the Pydantic model directly to exercise the
branch and pin the fail-closed behavior.

closes: apache#63160
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Aug 11, 2026
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.2 milestone Aug 11, 2026
@pierrejeambrun
pierrejeambrun marked this pull request as ready for review August 11, 2026 14:11
@bbovenzi
bbovenzi merged commit 9ced296 into apache:main Aug 12, 2026
122 of 145 checks passed
@bbovenzi
bbovenzi deleted the test-connection-extra-redact-safeguard branch August 12, 2026 16:57
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-3-test PR Link

pierrejeambrun added a commit that referenced this pull request Aug 13, 2026
…71537)

#63883 added a fail-closed safeguard on ``ConnectionResponse.redact_extra``:
if the ``extra`` column ever slips past ``Connection._validate_extra`` (direct
SQL, buggy migration, legacy data) and reaches the response serializer as a
non-JSON string, the validator raises rather than returning the raw value.
The path is unreachable through normal ORM access because ``Connection.get_extra``
already fails on read, so the model-level guard is defense in depth. It had
no test until now — this feeds the Pydantic model directly to exercise the
branch and pin the fail-closed behavior.

closes: #63160
(cherry picked from commit 9ced296)
vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
…71537)

#63883 added a fail-closed safeguard on ``ConnectionResponse.redact_extra``:
if the ``extra`` column ever slips past ``Connection._validate_extra`` (direct
SQL, buggy migration, legacy data) and reaches the response serializer as a
non-JSON string, the validator raises rather than returning the raw value.
The path is unreachable through normal ORM access because ``Connection.get_extra``
already fails on read, so the model-level guard is defense in depth. It had
no test until now — this feeds the Pydantic model directly to exercise the
branch and pin the fail-closed behavior.

closes: #63160
(cherry picked from commit 9ced296)
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redact Connection strings with "unstructured" extra

2 participants