Skip to content

Mask provider-declared sensitive connection extras on every connection type - #73794

Merged
potiuk merged 7 commits into
apache:mainfrom
potiuk:mask-provider-sensitive-connection-extras
Oct 19, 2026
Merged

potiuk merged 7 commits into
apache:mainfrom
potiuk:mask-provider-sensitive-connection-extras

Conversation

@potiuk

@potiuk potiuk commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

The connections API masks extra values by field name only, so a field a provider declares as a secret (format: password in its conn-fields) is returned in cleartext when its name is too generic to be on the global list; config is a secret for apprise, for example. After the name-based masking, this also masks every field that any installed provider declares sensitive, read from provider metadata without importing hooks. The check does not depend on the connection's current type, so a secret left in extra after a connection type change stays masked.

When a client sends a masked value back (as the UI does when another extra field is edited), the stored value is kept, but only while the connection type is unchanged, so a stored secret is never handed to a different connection type. This applies to PATCH, bulk update and the test-connection endpoint.

🤖 Generated with Claude Code

The connections API masks ``extra`` values by field name only, so a
field a provider declares as a secret (``format: password`` in its
``conn-fields``) is returned in cleartext when its name is too generic
to be on the global list -- ``config`` is a secret for apprise and
harmless for other connection types. After the name-based masking, also
mask the fields the connection type's own provider declares sensitive,
read from provider metadata without importing hooks.

Generated-by: Claude Opus 5
Generated-by: Claude Opus 5

@fat-catTW fat-catTW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@potiuk
potiuk requested a review from ashb October 13, 2026 14:27
@potiuk potiuk added the backport-to-v3-4-test Backport to v3-4-test label Oct 16, 2026
@potiuk potiuk added this to the Airflow 3.4.0 milestone Oct 16, 2026
@potiuk

potiuk commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@ashb @pierrejeambrun Could you take a look at this when you have a moment? It's targeted at 3.4.0 and needs a review to make the cut on 2026-10-19. CI is green.

@potiuk potiuk changed the title Mask provider-declared sensitive connection extras by connection type Mask provider-declared sensitive connection extras on every connection type Oct 17, 2026

@vatsrahul1001 vatsrahul1001 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Provider-declared secrets are masked on every connection type, the stored value is only restored when the connection type is unchanged, and the tests cover PATCH and test-connection. Could use reviews from @ashb @pierrejeambrun before merging.

Checking each key against every connection type's declared fields did the same work on every key of every response; building the plain and prefixed names once keeps the lookup a single membership test.

Generated-by: Claude Opus 5
@potiuk
potiuk merged commit a1109f8 into apache:main Oct 19, 2026
67 checks passed
@potiuk
potiuk deleted the mask-provider-sensitive-connection-extras branch October 19, 2026 14:32
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-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-4-test PR Link

potiuk added a commit that referenced this pull request Oct 19, 2026
…ry connection type (#73794) (#75106)

* Mask provider-declared sensitive connection extras by connection type

The connections API masks ``extra`` values by field name only, so a
field a provider declares as a secret (``format: password`` in its
``conn-fields``) is returned in cleartext when its name is too generic
to be on the global list -- ``config`` is a secret for apprise and
harmless for other connection types. After the name-based masking, also
mask the fields the connection type's own provider declares sensitive,
read from provider metadata without importing hooks.

Generated-by: Claude Opus 5

* Add newsfragment

Generated-by: Claude Opus 5

* Restore provider-declared sensitive extras when saving a masked connection

Generated-by: Claude Opus 5

* Restore provider-sensitive extras only when the connection type is unchanged

Generated-by: Claude Opus 5

* Keep provider-declared sensitive extras masked after a connection type change

Generated-by: Claude Opus 5

* Describe masking of provider-declared sensitive extras across connection types

Generated-by: Claude Opus 5

* Look up provider-declared sensitive extra keys in one set

Checking each key against every connection type's declared fields did the same work on every key of every response; building the plain and prefixed names once keeps the lookup a single membership test.
(cherry picked from commit a1109f8)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <[email protected]>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…ry connection type (#73794) (#75106)

* Mask provider-declared sensitive connection extras by connection type

The connections API masks ``extra`` values by field name only, so a
field a provider declares as a secret (``format: password`` in its
``conn-fields``) is returned in cleartext when its name is too generic
to be on the global list -- ``config`` is a secret for apprise and
harmless for other connection types. After the name-based masking, also
mask the fields the connection type's own provider declares sensitive,
read from provider metadata without importing hooks.

Generated-by: Claude Opus 5

* Add newsfragment

Generated-by: Claude Opus 5

* Restore provider-declared sensitive extras when saving a masked connection

Generated-by: Claude Opus 5

* Restore provider-sensitive extras only when the connection type is unchanged

Generated-by: Claude Opus 5

* Keep provider-declared sensitive extras masked after a connection type change

Generated-by: Claude Opus 5

* Describe masking of provider-declared sensitive extras across connection types

Generated-by: Claude Opus 5

* Look up provider-declared sensitive extra keys in one set

Checking each key against every connection type's declared fields did the same work on every key of every response; building the plain and prefixed names once keeps the lookup a single membership test.
(cherry picked from commit a1109f8)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <[email protected]>
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-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants