Skip to content

Commit bb96178

Browse files
committed
Update registry rest client to support bearer authentication
1 parent 5a87879 commit bb96178

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/confluent_kafka/schema_registry/schema_registry_client.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def __init__(self, conf):
111111
raise ValueError("basic.auth.user.info must be in the form"
112112
" of {username}:{password}")
113113

114-
self.session.auth = userinfo if userinfo != ('', '') else None
114+
self.session.auth = userinfo
115+
elif 'token' in conf_copy:
116+
token = conf_copy.pop('token')
117+
self.session.headers['Authorization'] = f'Bearer {token}'
115118

116119
# Any leftover keys are unknown to _RestClient
117120
if len(conf_copy) > 0:

0 commit comments

Comments
 (0)