@@ -85,7 +85,7 @@ def __init__(self, url, max_schemas_per_subject=1000, ca_location=None, cert_loc
85
85
"""Construct a Schema Registry client"""
86
86
87
87
# Ensure URL valid scheme is included; http[s]
88
- url = conf .get ('url' , '' )
88
+ url = conf .pop ('url' , '' )
89
89
if not isinstance (url , string_type ):
90
90
raise TypeError ("URL must be of type str" )
91
91
@@ -106,9 +106,8 @@ def __init__(self, url, max_schemas_per_subject=1000, ca_location=None, cert_loc
106
106
if ca_path is not None :
107
107
s .verify = ca_path
108
108
s .cert = self ._configure_client_tls (conf )
109
- s .auth = self ._configure_basic_auth (conf )
110
-
111
- self .url = conf .pop ('url' )
109
+ s .auth = self ._configure_basic_auth (self .url , conf )
110
+ self .url = utils .urldefragauth (self .url )
112
111
113
112
self ._session = s
114
113
@@ -128,8 +127,7 @@ def close(self):
128
127
self ._session .close ()
129
128
130
129
@staticmethod
131
- def _configure_basic_auth (conf ):
132
- url = conf ['url' ]
130
+ def _configure_basic_auth (url , conf ):
133
131
auth_provider = conf .pop ('basic.auth.credentials.source' , 'URL' ).upper ()
134
132
if auth_provider not in VALID_AUTH_PROVIDERS :
135
133
raise ValueError ("schema.registry.basic.auth.credentials.source must be one of {}"
@@ -142,7 +140,6 @@ def _configure_basic_auth(conf):
142
140
auth = tuple (conf .pop ('basic.auth.user.info' , '' ).split (':' ))
143
141
else :
144
142
auth = utils .get_auth_from_url (url )
145
- conf ['url' ] = utils .urldefragauth (url )
146
143
return auth
147
144
148
145
@staticmethod
0 commit comments