@@ -569,6 +569,8 @@ def direct_with_custom_authorizer(
569
569
auth_authorizer_name = None ,
570
570
auth_authorizer_signature = None ,
571
571
auth_password = None ,
572
+ auth_token_key_name = None ,
573
+ auth_token_value = None ,
572
574
** kwargs ) -> awscrt .mqtt5 .Client :
573
575
"""
574
576
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an MQTT5 Client using a custom
@@ -581,17 +583,30 @@ def direct_with_custom_authorizer(
581
583
auth_username (`str`): The username to use with the custom authorizer.
582
584
If provided, the username given will be passed when connecting to the custom authorizer.
583
585
If not provided, it will check to see if a username has already been set (via username="example")
584
- and will use that instead.
585
- If no username has been set then no username will be sent with the MQTT connection.
586
-
587
- auth_authorizer_name (`str`): The name of the custom authorizer.
588
- If not provided, then "x-amz-customauthorizer-name" will not be added with the MQTT connection.
589
-
590
- auth_authorizer_signature (`str`): The signature of the custom authorizer.
591
- If not provided, then "x-amz-customauthorizer-name" will not be added with the MQTT connection.
586
+ and will use that instead. Custom authentication parameters will be appended as appropriate
587
+ to any supplied username value.
592
588
593
589
auth_password (`str`): The password to use with the custom authorizer.
594
- If not provided, then no passord will be set.
590
+ If not provided, then no password will be sent in the initial CONNECT packet.
591
+
592
+ auth_authorizer_name (`str`): Name of the custom authorizer to use.
593
+ Required if the endpoint does not have a default custom authorizer associated with it. It is strongly
594
+ suggested to URL-encode this value; the SDK will not do so for you.
595
+
596
+ auth_authorizer_signature (`str`): The digital signature of the token value in the `auth_token_value`
597
+ parameter. The signature must be based on the private key associated with the custom authorizer. The
598
+ signature must be base64 encoded.
599
+ Required if the custom authorizer has signing enabled. It is strongly suggested to URL-encode this value;
600
+ the SDK will not do so for you.
601
+
602
+ auth_token_key_name (`str`): Key used to extract the custom authorizer token from MQTT username query-string
603
+ properties.
604
+ Required if the custom authorizer has signing enabled. It is strongly suggested to URL-encode
605
+ this value; the SDK will not do so for you.
606
+
607
+ auth_token_value (`str`): An opaque token value. This value must be signed by the private key associated with
608
+ the custom authorizer and the result passed in via the `auth_authorizer_signature` parameter.
609
+ Required if the custom authorizer has signing enabled.
595
610
"""
596
611
597
612
_check_required_kwargs (** kwargs )
@@ -606,10 +621,14 @@ def direct_with_custom_authorizer(
606
621
if auth_authorizer_name is not None :
607
622
username_string = _add_to_username_parameter (
608
623
username_string , auth_authorizer_name , "x-amz-customauthorizer-name=" )
624
+
609
625
if auth_authorizer_signature is not None :
610
626
username_string = _add_to_username_parameter (
611
627
username_string , auth_authorizer_signature , "x-amz-customauthorizer-signature=" )
612
628
629
+ if auth_token_key_name is not None and auth_token_value is not None :
630
+ username_string = _add_to_username_parameter (username_string , auth_token_value , auth_token_key_name + "=" )
631
+
613
632
kwargs ["username" ] = username_string
614
633
kwargs ["password" ] = auth_password
615
634
@@ -628,6 +647,8 @@ def websockets_with_custom_authorizer(
628
647
auth_authorizer_signature = None ,
629
648
auth_password = None ,
630
649
websocket_proxy_options = None ,
650
+ auth_token_key_name = None ,
651
+ auth_token_value = None ,
631
652
** kwargs ) -> awscrt .mqtt5 .Client :
632
653
"""
633
654
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an MQTT5 Client using a custom
@@ -640,17 +661,30 @@ def websockets_with_custom_authorizer(
640
661
auth_username (`str`): The username to use with the custom authorizer.
641
662
If provided, the username given will be passed when connecting to the custom authorizer.
642
663
If not provided, it will check to see if a username has already been set (via username="example")
643
- and will use that instead.
644
- If no username has been set then no username will be sent with the MQTT connection.
664
+ and will use that instead. Custom authentication parameters will be appended as appropriate
665
+ to any supplied username value.
666
+
667
+ auth_password (`str`): The password to use with the custom authorizer.
668
+ If not provided, then no password will be sent in the initial CONNECT packet.
645
669
646
- auth_authorizer_name (`str`): The name of the custom authorizer.
647
- If not provided, then "x-amz-customauthorizer-name" will not be added with the MQTT connection.
670
+ auth_authorizer_name (`str`): Name of the custom authorizer to use.
671
+ Required if the endpoint does not have a default custom authorizer associated with it. It is strongly
672
+ suggested to URL-encode this value; the SDK will not do so for you.
648
673
649
- auth_authorizer_signature (`str`): The signature of the custom authorizer.
650
- If not provided, then "x-amz-customauthorizer-name" will not be added with the MQTT connection.
674
+ auth_authorizer_signature (`str`): The digital signature of the token value in the `auth_token_value`
675
+ parameter. The signature must be based on the private key associated with the custom authorizer. The
676
+ signature must be base64 encoded.
677
+ Required if the custom authorizer has signing enabled. It is strongly suggested to URL-encode this value;
678
+ the SDK will not do so for you.
651
679
652
- auth_password (`str`): The password to use with the custom authorizer.
653
- If not provided, then no passord will be set.
680
+ auth_token_key_name (`str`): Key used to extract the custom authorizer token from MQTT username query-string
681
+ properties.
682
+ Required if the custom authorizer has signing enabled. It is strongly suggested to URL-encode
683
+ this value; the SDK will not do so for you.
684
+
685
+ auth_token_value (`str`): An opaque token value. This value must be signed by the private key associated with
686
+ the custom authorizer and the result passed in via the `auth_authorizer_signature` parameter.
687
+ Required if the custom authorizer has signing enabled.
654
688
655
689
websocket_proxy_options (awscrt.http.HttpProxyOptions): Deprecated,
656
690
for proxy settings use `http_proxy_options` (described in
@@ -669,10 +703,14 @@ def websockets_with_custom_authorizer(
669
703
if auth_authorizer_name is not None :
670
704
username_string = _add_to_username_parameter (
671
705
username_string , auth_authorizer_name , "x-amz-customauthorizer-name=" )
706
+
672
707
if auth_authorizer_signature is not None :
673
708
username_string = _add_to_username_parameter (
674
709
username_string , auth_authorizer_signature , "x-amz-customauthorizer-signature=" )
675
710
711
+ if auth_token_key_name is not None and auth_token_value is not None :
712
+ username_string = _add_to_username_parameter (username_string , auth_token_value , auth_token_key_name + "=" )
713
+
676
714
kwargs ["username" ] = username_string
677
715
kwargs ["password" ] = auth_password
678
716
0 commit comments