Skip to content

Commit 3337213

Browse files
adolfo-abdbasunag
authored andcommitted
feat: add certs when sending requests to TrustyAIService (opendatahub-io#266)
1 parent bd83f3f commit 3337213

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/model_explainability/trustyai_service/trustyai_service_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from simple_logger.logger import get_logger
1313
from timeout_sampler import TimeoutSampler
1414

15-
15+
from utilities.certificates_utils import create_ca_bundle_file
1616
from utilities.constants import Protocols, Timeout
1717
from utilities.exceptions import MetricValidationError
1818
from utilities.general import create_isvc_label_selector_str
@@ -58,6 +58,7 @@ def __init__(self, token: str, service: TrustyAIService, client: DynamicClient):
5858
self.service_route = Route(
5959
client=client, namespace=service.namespace, name=TRUSTYAI_SERVICE_NAME, ensure_exists=True
6060
)
61+
self.cert_path = create_ca_bundle_file(client=client, ca_type="openshift")
6162

6263
def _get_metric_base_url(self, metric_name: str) -> str:
6364
"""Gets base URL for a given metric type (fairness or drift).
@@ -103,7 +104,7 @@ def _send_request(
103104
"""
104105

105106
url = f"https://{self.service_route.host}/{endpoint}"
106-
base_kwargs = {"url": url, "headers": self.headers, "verify": False}
107+
base_kwargs = {"url": url, "headers": self.headers, "verify": self.cert_path}
107108

108109
method = method.upper()
109110
if method not in ("GET", "POST", "DELETE"):

0 commit comments

Comments
 (0)