Skip to content

Commit 7ecb1c9

Browse files
committed
adding mTLS
1 parent 1a4d9fc commit 7ecb1c9

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

python-lib/dku_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def get_endpoint_parameters(configuration):
3939
"requests_per_minute",
4040
"pagination_type",
4141
"next_page_url_key", "is_next_page_url_relative", "next_page_url_base",
42-
"top_key", "skip_key", "maximum_number_rows"
42+
"top_key", "skip_key", "maximum_number_rows",
43+
"use_mtls", "mtls_certificate_path", "mtls_key_path",
4344
]
4445
parameters = {
4546
endpoint_parameter: configuration.get(endpoint_parameter) for endpoint_parameter in endpoint_parameters if configuration.get(endpoint_parameter) is not None

python-lib/rest_api_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def __init__(self, credential, secure_credentials, endpoint, custom_key_values={
5959
self.requests_kwargs.update({"verify": False})
6060
else:
6161
self.requests_kwargs.update({"verify": True})
62+
if endpoint.get("use_mtls", False):
63+
mtls_certificate_path = endpoint.get("mtls_certificate_path")
64+
mtls_key_path = endpoint.get("mtls_key_path")
65+
self.requests_kwargs.update(
66+
{
67+
"cert": (mtls_certificate_path, mtls_key_path)
68+
}
69+
)
6270
self.redirect_auth_header = endpoint.get("redirect_auth_header", False)
6371
self.timeout = endpoint.get("timeout", -1)
6472
if self.timeout > 0:

0 commit comments

Comments
 (0)