Skip to content

Commit

Permalink
Back to user/pass
Browse files Browse the repository at this point in the history
  • Loading branch information
chouinar committed Oct 11, 2024
1 parent 7c2970b commit 8b81deb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/src/adapters/search/opensearch_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,11 @@ def _get_connection_parameters(opensearch_config: OpensearchConfig) -> dict[str,

# We'll assume if the aws_region is set, we're running in AWS
# and should connect using the session credentials
if opensearch_config.aws_region is not None:
if opensearch_config.search_username and opensearch_config.search_password:
# Get credentials and authorize with AWS Opensearch Serverless (es)
credentials = boto3.Session().get_credentials()
auth = opensearchpy.AWSV4SignerAuth(credentials, opensearch_config.aws_region, "es")
#credentials = boto3.Session().get_credentials()
#auth = opensearchpy.AWSV4SignerAuth(credentials, opensearch_config.aws_region, "es")
auth = (opensearch_config.search_username, opensearch_config.search_password)
params["http_auth"] = auth

return params

0 comments on commit 8b81deb

Please sign in to comment.