Skip to content

Reject connection secrets without a connection type#69780

Open
henry3260 wants to merge 1 commit into
apache:mainfrom
henry3260:fix-connection-secret-validation
Open

Reject connection secrets without a connection type#69780
henry3260 wants to merge 1 commit into
apache:mainfrom
henry3260:fix-connection-secret-validation

Conversation

@henry3260

Copy link
Copy Markdown
Contributor

Why

Connection secrets in JSON format could omit conn_type. Although the secrets backend deserialized those values, the Execution API requires a connection type and the task could ultimately receive a misleading “connection not found” error.

This addresses the conn_type portion of related: #57864.

What

  • Reject JSON connection secrets whose conn_type is missing, null, empty, or whitespace-only.
  • Raise a clear ValueError before constructing an incomplete Connection.
  • Add regression coverage for each invalid conn_type value.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Prevent malformed JSON secrets from being reported as missing connections at runtime.
@henry3260 henry3260 force-pushed the fix-connection-secret-validation branch from 18b8ad7 to 647958e Compare July 13, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant