3838 is_retriable ,
3939 _BearerFieldProvider ,
4040 full_jitter ,
41- _SchemaCache ,
41+ _SchemaCache ,
4242 Schema ,
43+ _StaticFieldProvider ,
4344)
4445
46+ __all__ = [
47+ '_urlencode' ,
48+ '_AsyncCustomOAuthClient' ,
49+ '_AsyncOAuthClient' ,
50+ '_AsyncBaseRestClient' ,
51+ '_AsyncRestClient' ,
52+ 'AsyncSchemaRegistryClient' ,
53+ ]
54+
4555# TODO: consider adding `six` dependency or employing a compat file
4656# Python 2.7 is officially EOL so compatibility issue will be come more the norm.
4757# We need a better way to handle these issues.
@@ -64,17 +74,6 @@ def _urlencode(value: str) -> str:
6474log = logging .getLogger (__name__ )
6575
6676
67- class _AsyncStaticFieldProvider (_BearerFieldProvider ):
68- def __init__ (self , token : str , logical_cluster : str , identity_pool : str ):
69- self .token = token
70- self .logical_cluster = logical_cluster
71- self .identity_pool = identity_pool
72-
73- async def get_bearer_fields (self ) -> dict :
74- return {'bearer.auth.token' : self .token , 'bearer.auth.logical.cluster' : self .logical_cluster ,
75- 'bearer.auth.identity.pool.id' : self .identity_pool }
76-
77-
7877class _AsyncCustomOAuthClient (_BearerFieldProvider ):
7978 def __init__ (self , custom_function : Callable [[Dict ], Dict ], custom_config : dict ):
8079 self .custom_function = custom_function
@@ -292,7 +291,7 @@ def __init__(self, conf: dict):
292291 if 'bearer.auth.token' not in conf_copy :
293292 raise ValueError ("Missing bearer.auth.token" )
294293 static_token = conf_copy .pop ('bearer.auth.token' )
295- self .bearer_field_provider = _AsyncStaticFieldProvider (static_token , logical_cluster , identity_pool )
294+ self .bearer_field_provider = _StaticFieldProvider (static_token , logical_cluster , identity_pool )
296295 if not isinstance (static_token , string_type ):
297296 raise TypeError ("bearer.auth.token must be a str, not " + str (type (static_token )))
298297 elif self .bearer_auth_credentials_source == 'CUSTOM' :
0 commit comments