Skip to content

Commit 8f61d2e

Browse files
author
andresdec
committed
simplified interface to only support passing proxy_headers
1 parent 0f06e74 commit 8f61d2e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

sdk/python/kfp/_client.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ class Client(object):
131131
LOCAL_KFP_CONTEXT = os.path.expanduser('~/.config/kfp/context.json')
132132

133133
# TODO: Wrap the configurations for different authentication methods.
134-
def __init__(self, host=None, client_id=None, namespace='kubeflow', other_client_id=None, other_client_secret=None, existing_token=None, cookies=None, proxy=None, ssl_ca_cert=None, kube_context=None, credentials=None, proxy_username=None, proxy_password=None, proxy_headers=None):
134+
def __init__(self, host=None, client_id=None, namespace='kubeflow', other_client_id=None, other_client_secret=None, existing_token=None, cookies=None, proxy=None, ssl_ca_cert=None, kube_context=None, credentials=None, proxy_headers=None):
135135
"""Create a new instance of kfp client.
136136
"""
137137
host = host or os.environ.get(KF_PIPELINES_ENDPOINT_ENV)
138138
self._uihost = os.environ.get(KF_PIPELINES_UI_ENDPOINT_ENV, host)
139139
client_id = client_id or os.environ.get(KF_PIPELINES_IAP_OAUTH2_CLIENT_ID_ENV)
140140
other_client_id = other_client_id or os.environ.get(KF_PIPELINES_APP_OAUTH2_CLIENT_ID_ENV)
141141
other_client_secret = other_client_secret or os.environ.get(KF_PIPELINES_APP_OAUTH2_CLIENT_SECRET_ENV)
142-
config = self._load_config(host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, kube_context, credentials, proxy_username=proxy_username, proxy_password=proxy_password, proxy_headers=proxy_headers)
142+
config = self._load_config(host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, kube_context, credentials, proxy_headers=proxy_headers)
143143
# Save the loaded API client configuration, as a reference if update is
144144
# needed.
145145
self._load_context_setting_or_default()
@@ -164,18 +164,14 @@ def __init__(self, host=None, client_id=None, namespace='kubeflow', other_client
164164
except FileNotFoundError:
165165
logging.info('Failed to automatically set namespace.', exc_info=True)
166166

167-
def _load_config(self, host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, kube_context, credentials, proxy_username=None, proxy_password=None, proxy_headers=None):
167+
def _load_config(self, host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, kube_context, credentials, proxy_headers=None):
168168
config = kfp_server_api.configuration.Configuration()
169169

170170
if proxy:
171171
# https://github.com/kubeflow/pipelines/blob/c6ac5e0b1fd991e19e96419f0f508ec0a4217c29/backend/api/python_http_client/kfp_server_api/rest.py#L100
172172
config.proxy = proxy
173173

174-
# for use with a reverse proxy with basic auth.
175-
if proxy_username and proxy_password:
176-
config.proxy_headers = make_headers(basic_auth=f"{proxy_username}:{proxy_password}")
177-
178-
# for use with kerberos
174+
# for use with kerberos or basic auth reverse proxies
179175
if proxy_headers:
180176
config.proxy_headers = proxy_headers
181177

0 commit comments

Comments
 (0)