@@ -199,6 +199,9 @@ def _builder(
199
199
if _get (kwargs , 'enable_metrics_collection' , True ):
200
200
username += _get_metrics_str (username )
201
201
202
+ if username == "" :
203
+ username = None
204
+
202
205
client_bootstrap = _get (kwargs , 'client_bootstrap' )
203
206
if client_bootstrap is None :
204
207
client_bootstrap = awscrt .io .ClientBootstrap .get_or_create_static_default ()
@@ -427,6 +430,7 @@ def websockets_with_custom_handshake(
427
430
websocket_proxy_options = websocket_proxy_options ,
428
431
** kwargs )
429
432
433
+
430
434
def _add_to_username_parameter (input_string , parameter_value , parameter_pretext ):
431
435
"""
432
436
Helper function to add parameters to the username in the direct_with_custom_authorizer function
@@ -443,6 +447,7 @@ def _add_to_username_parameter(input_string, parameter_value, parameter_pretext)
443
447
else :
444
448
return return_string + parameter_pretext + parameter_value
445
449
450
+
446
451
def direct_with_custom_authorizer (
447
452
auth_username = None ,
448
453
auth_authorizer_name = None ,
@@ -482,10 +487,10 @@ def direct_with_custom_authorizer(
482
487
else :
483
488
username_string += auth_username
484
489
485
- if not auth_authorizer_name is None :
490
+ if auth_authorizer_name is not None :
486
491
username_string = _add_to_username_parameter (
487
492
username_string , auth_authorizer_name , "x-amz-customauthorizer-name=" )
488
- if not auth_authorizer_signature is None :
493
+ if auth_authorizer_signature is not None :
489
494
username_string = _add_to_username_parameter (
490
495
username_string , auth_authorizer_signature , "x-amz-customauthorizer-signature=" )
491
496
0 commit comments