Skip to content

Commit

Permalink
fix http authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblack committed Dec 15, 2023
1 parent 0f44b19 commit 8e5ab14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arcaflow_plugin_opensearch/opensearch_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ def store(
if params.username:
opensearch = OpenSearch(
hosts=params.url,
basic_auth=[params.username, params.password],
http_auth=(params.username, params.password),
verify_certs=params.tls_verify,
)
# Support for servers that don't require authentication
else:
opensearch = OpenSearch(hosts=params.url)
opensearch = OpenSearch(
hosts=params.url,
verify_certs=params.tls_verify,
)
resp = opensearch.index(index=params.index, body=params.data)
if resp["result"] != "created":
raise Exception(f"Document status: {resp['_shards']}")
Expand Down

0 comments on commit 8e5ab14

Please sign in to comment.