Skip to content

Allow OpensearchTaskHandler and OpensearchRemoteLogIO to take empty username and password - #71692

Open
topherinternational wants to merge 8 commits into
apache:mainfrom
topherinternational:os-task-handler-no-auth-client
Open

Allow OpensearchTaskHandler and OpensearchRemoteLogIO to take empty username and password#71692
topherinternational wants to merge 8 commits into
apache:mainfrom
topherinternational:os-task-handler-no-auth-client

Conversation

@topherinternational

Copy link
Copy Markdown
Contributor

This change allows OpensearchTaskHandler and OpensearchRemoteLogIO to utilize Opensearch connections without user/password authentication.

Current Behavior
These classes pass their username and password attributes to the OpenSearch client constructor. In the event these attributes are empty or null, the client attempts to connect to the host using an auth string of ":" or "None:None".

Proposed Behavior
os_task_handler._create_opensearch_client() passes the http_auth tuple to the OpenSearch() client constructor only if both username and password are truthy (i.e., they are non-empty strings).

Rationale
Several use cases take advantage of a non-authenticated endpoint. Opensearch instances are sometimes deployed without authentication for testing purposes, and production instances can be operated inside of a VPC where networking rules rather than credentials control access from other services in the cluster.

Additionally, this non-authenticated capability is already in place in the OpenSearchHook.


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

Comment thread providers/opensearch/src/airflow/providers/opensearch/log/os_task_handler.py Outdated
Comment thread providers/opensearch/tests/unit/opensearch/log/test_os_task_handler.py Outdated
@topherinternational
topherinternational force-pushed the os-task-handler-no-auth-client branch from 5ae8aa0 to 0887e75 Compare August 21, 2026 21:16
@topherinternational
topherinternational force-pushed the os-task-handler-no-auth-client branch from 344b59e to 5be6917 Compare August 21, 2026 21:39
Comment thread providers/opensearch/tests/unit/opensearch/log/test_os_task_handler.py Outdated
@topherinternational
topherinternational force-pushed the os-task-handler-no-auth-client branch from 5be6917 to 709b9c0 Compare August 22, 2026 12:50
@topherinternational
topherinternational force-pushed the os-task-handler-no-auth-client branch from 51ff3dd to 0f48dd7 Compare August 22, 2026 21:18
@topherinternational
topherinternational force-pushed the os-task-handler-no-auth-client branch from 0f48dd7 to 174bc2a Compare August 23, 2026 18:06

@Owen-CH-Leung Owen-CH-Leung 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.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants