Skip to content

Skip stored credentials when a connection test overrides host or port - #69957

Merged
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:connection-test-host-secrets
Jul 16, 2026
Merged

Skip stored credentials when a connection test overrides host or port#69957
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:connection-test-host-secrets

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

When POST /connections/test references an existing connection_id, it restores that connection's stored credentials (password/extra) so a saved connection can be tested without re-typing secrets.

Connection configuration users have write-only access to those credentials and are not meant to view them (Airflow 3 masks them at the API level). Reusing the stored credentials while the request points at a caller-supplied host or port applies them against a destination the caller chose rather than the connection's own — outside the intent of the retype-free test flow.

This scopes the credential reuse to requests that keep the stored connection's host and port; if either is overridden, the test uses exactly what the caller supplied. Follows the same hardening as #67620.


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

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

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Jul 16, 2026
@pierrejeambrun
pierrejeambrun marked this pull request as ready for review July 16, 2026 08:42
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.1 milestone Jul 16, 2026
@pierrejeambrun pierrejeambrun added the backport-to-v3-3-test Backport to v3-3-test label Jul 16, 2026
@pierrejeambrun
pierrejeambrun force-pushed the connection-test-host-secrets branch from ddb5db6 to 6b64ef2 Compare July 16, 2026 09:28
@pierrejeambrun
pierrejeambrun force-pushed the connection-test-host-secrets branch 3 times, most recently from 72515aa to 334d65b Compare July 16, 2026 13:08
The POST /connections/test endpoint restores an existing connection's stored
credentials (password/extra) when the request sends the masked sentinel, so a
saved connection can be tested without re-typing secrets. Connection
configuration users have write-only access to those credentials and are not
meant to view them; reusing them while the request points at a caller-supplied
host or port applies them against a destination the caller chose rather than
the connection's own, which is outside the intent of the retype-free test flow.

Scope the credential reuse to requests that keep the stored connection's host
and port. Follows the same hardening as apache#67620.
@pierrejeambrun
pierrejeambrun force-pushed the connection-test-host-secrets branch from 334d65b to fa4cc7e Compare July 16, 2026 13:22
@pierrejeambrun
pierrejeambrun merged commit a6d87ba into apache:main Jul 16, 2026
79 checks passed
@pierrejeambrun
pierrejeambrun deleted the connection-test-host-secrets branch July 16, 2026 14:06
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

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 Commit Link

You can attempt to backport this manually by running:

cherry_picker a6d87ba v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

pierrejeambrun added a commit that referenced this pull request Jul 17, 2026
…#69957) (#70010)

The POST /connections/test endpoint restores an existing connection's stored
credentials (password/extra) when the request sends the masked sentinel, so a
saved connection can be tested without re-typing secrets. Connection
configuration users have write-only access to those credentials and are not
meant to view them; reusing them while the request points at a caller-supplied
host or port applies them against a destination the caller chose rather than
the connection's own, which is outside the intent of the retype-free test flow.

Scope the credential reuse to requests that keep the stored connection's host
and port. Follows the same hardening as #67620.

(cherry picked from commit a6d87ba)
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
…#69957) (#70010)

The POST /connections/test endpoint restores an existing connection's stored
credentials (password/extra) when the request sends the masked sentinel, so a
saved connection can be tested without re-typing secrets. Connection
configuration users have write-only access to those credentials and are not
meant to view them; reusing them while the request points at a caller-supplied
host or port applies them against a destination the caller chose rather than
the connection's own, which is outside the intent of the retype-free test flow.

Scope the credential reuse to requests that keep the stored connection's host
and port. Follows the same hardening as #67620.

(cherry picked from commit a6d87ba)
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 backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants