Skip to content

Commit 3bf56ea

Browse files
committed
Moving mtls to secure and normal presets
1 parent 9fe53a8 commit 3bf56ea

5 files changed

Lines changed: 78 additions & 3 deletions

File tree

parameter-sets/credential/parameter-set.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@
119119
"label": "User key/values",
120120
"description": "User defined keys/values that can be used later in url, query string...",
121121
"type": "KEY_VALUE_LIST"
122+
},
123+
{
124+
"name": "use_mtls",
125+
"label": " ",
126+
"description": "Use mTLS",
127+
"type": "BOOLEAN",
128+
"defaultValue": false
129+
},
130+
{
131+
"name": "mtls_certificate_path",
132+
"label": "Path to certificate",
133+
"description": "",
134+
"type": "STRING",
135+
"visibilityCondition": "model.use_mtls==true"
136+
},
137+
{
138+
"name": "mtls_key_path",
139+
"label": "Path to key",
140+
"description": "",
141+
"type": "STRING",
142+
"visibilityCondition": "model.use_mtls==true"
122143
}
123144
]
124145
}

parameter-sets/secure-basic/parameter-set.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,27 @@
3838
"label": "NTLM"
3939
}
4040
]
41+
},
42+
{
43+
"name": "use_mtls",
44+
"label": " ",
45+
"description": "Use mTLS",
46+
"type": "BOOLEAN",
47+
"defaultValue": false
48+
},
49+
{
50+
"name": "mtls_certificate_path",
51+
"label": "Path to certificate",
52+
"description": "",
53+
"type": "STRING",
54+
"visibilityCondition": "model.use_mtls==true"
55+
},
56+
{
57+
"name": "mtls_key_path",
58+
"label": "Path to key",
59+
"description": "",
60+
"type": "STRING",
61+
"visibilityCondition": "model.use_mtls==true"
4162
}
4263
]
4364
}

parameter-sets/secure-oauth/parameter-set.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@
4747
"label": "Domain",
4848
"description": "",
4949
"type": "STRING"
50+
},
51+
{
52+
"name": "use_mtls",
53+
"label": " ",
54+
"description": "Use mTLS",
55+
"type": "BOOLEAN",
56+
"defaultValue": false
57+
},
58+
{
59+
"name": "mtls_certificate_path",
60+
"label": "Path to certificate",
61+
"description": "",
62+
"type": "STRING",
63+
"visibilityCondition": "model.use_mtls==true"
64+
},
65+
{
66+
"name": "mtls_key_path",
67+
"label": "Path to key",
68+
"description": "",
69+
"type": "STRING",
70+
"visibilityCondition": "model.use_mtls==true"
5071
}
5172
]
5273
}

python-lib/rest_api_client.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,17 @@ 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")
62+
if credential.get("use_mtls", False):
63+
mtls_certificate_path = credential.get("mtls_certificate_path")
64+
mtls_key_path = credential.get("mtls_key_path")
65+
self.requests_kwargs.update(
66+
{
67+
"cert": (mtls_certificate_path, mtls_key_path)
68+
}
69+
)
70+
if secure_credentials.get("use_mtls", False):
71+
mtls_certificate_path = secure_credentials.get("mtls_certificate_path")
72+
mtls_key_path = secure_credentials.get("mtls_key_path")
6573
self.requests_kwargs.update(
6674
{
6775
"cert": (mtls_certificate_path, mtls_key_path)

tests/python/integration/test_scenario.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ def test_run_api_connect_xml_handling(user_dss_clients):
5757

5858
def test_run_api_connect_parameters_renaming(user_dss_clients):
5959
dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="COLUMNPARAMETERRENAMING")
60+
61+
62+
def test_run_api_connect_mtls(user_dss_clients):
63+
dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="MTLS")

0 commit comments

Comments
 (0)