[Opensearch] : Fix the service validation in http_auth (#8609)

### Description
OpenSearch supports validation using both Master Credentials (Username
and password) and IAM. For Master Credentials users will not pass the
argument `service` in `http_auth` and the existing code will break. To
fix this, I have updated the condition to check if service attribute is
present in http_auth before accessing it.

### Maintainers
@baskaryan @navneet1v

Signed-off-by: Naveen Tatikonda <navtat@amazon.com>
pull/8632/head
Naveen Tatikonda 1 year ago committed by GitHub
parent 7c5c0557cb
commit d2adec3818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -85,7 +85,7 @@ def _is_aoss_enabled(http_auth: Any) -> bool:
"""Check if the service is http_auth is set as `aoss`."""
if (
http_auth is not None
and http_auth.service is not None
and hasattr(http_auth, "service")
and http_auth.service == "aoss"
):
return True

Loading…
Cancel
Save