Skip to content

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

Open
topherinternational wants to merge 1 commit 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 1 commit 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)

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.

1 participant