Skip to content

Commit 30f3ab2

Browse files
committed
fix format
1 parent 96677e5 commit 30f3ab2

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

awsiot/mqtt5_client_builder.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ def _builder(
366366
return client
367367

368368

369-
def mtls_from_path(cert_filepath, pri_key_filepath,
370-
**kwargs) -> awscrt.mqtt5.Client:
369+
def mtls_from_path(cert_filepath, pri_key_filepath, **kwargs) -> awscrt.mqtt5.Client:
371370
"""
372371
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an mTLS MQTT5 Client to AWS IoT.
373372
TLS arguments are passed as filepaths.
@@ -385,10 +384,7 @@ def mtls_from_path(cert_filepath, pri_key_filepath,
385384
return _builder(tls_ctx_options, **kwargs)
386385

387386

388-
def mtls_from_bytes(
389-
cert_bytes,
390-
pri_key_bytes,
391-
**kwargs) -> awscrt.mqtt5.Client:
387+
def mtls_from_bytes(cert_bytes, pri_key_bytes, **kwargs) -> awscrt.mqtt5.Client:
392388
"""
393389
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an mTLS MQTT5 Client to AWS IoT.
394390
TLS arguments are passed as in-memory bytes.

awsiot/mqtt_connection_builder.py

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,7 @@ def _builder(
262262
)
263263

264264

265-
def mtls_from_path(
266-
cert_filepath,
267-
pri_key_filepath,
268-
**kwargs) -> awscrt.mqtt.Connection:
265+
def mtls_from_path(cert_filepath, pri_key_filepath, **kwargs) -> awscrt.mqtt.Connection:
269266
"""
270267
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT.
271268
TLS arguments are passed as filepaths.
@@ -283,10 +280,7 @@ def mtls_from_path(
283280
return _builder(tls_ctx_options, **kwargs)
284281

285282

286-
def mtls_from_bytes(
287-
cert_bytes,
288-
pri_key_bytes,
289-
**kwargs) -> awscrt.mqtt.Connection:
283+
def mtls_from_bytes(cert_bytes, pri_key_bytes, **kwargs) -> awscrt.mqtt.Connection:
290284
"""
291285
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT.
292286
TLS arguments are passed as in-memory bytes.
@@ -452,10 +446,7 @@ def _sign_websocket_handshake_request(transform_args, **kwargs):
452446
except Exception as e:
453447
transform_args.set_done(e)
454448

455-
return websockets_with_custom_handshake(
456-
_sign_websocket_handshake_request,
457-
websocket_proxy_options=websocket_proxy_options,
458-
**kwargs)
449+
return websockets_with_custom_handshake(_sign_websocket_handshake_request, websocket_proxy_options, **kwargs)
459450

460451

461452
def websockets_with_custom_handshake(
@@ -566,7 +557,6 @@ def direct_with_custom_authorizer(
566557
use_websockets=False,
567558
**kwargs)
568559

569-
570560
def websockets_with_custom_authorizer(
571561
region=None,
572562
credentials_provider=None,
@@ -605,7 +595,7 @@ def websockets_with_custom_authorizer(
605595
auth_authorizer_signature (`str`): The digital signature of the token value in the `auth_token_value`
606596
parameter. The signature must be based on the private key associated with the custom authorizer. The
607597
signature must be base64 encoded.
608-
Required if the custom authorizer has signing enabled.
598+
Required if the custom authorizer has signing enabled.
609599
610600
auth_token_key_name (`str`): Key used to extract the custom authorizer token from MQTT username query-string
611601
properties.
@@ -631,15 +621,15 @@ def websockets_with_custom_authorizer(
631621

632622

633623
def _with_custom_authorizer(auth_username=None,
634-
auth_authorizer_name=None,
635-
auth_authorizer_signature=None,
636-
auth_password=None,
637-
auth_token_key_name=None,
638-
auth_token_value=None,
639-
use_websockets=False,
640-
websockets_credentials_provider=None,
641-
websockets_region=None,
642-
**kwargs) -> awscrt.mqtt.Connection:
624+
auth_authorizer_name=None,
625+
auth_authorizer_signature=None,
626+
auth_password=None,
627+
auth_token_key_name=None,
628+
auth_token_value=None,
629+
use_websockets=False,
630+
websockets_credentials_provider=None,
631+
websockets_region=None,
632+
**kwargs) -> awscrt.mqtt.Connection:
643633
"""
644634
Helper function that contains the setup needed for custom authorizers
645635
"""
@@ -672,7 +662,7 @@ def _with_custom_authorizer(auth_username=None,
672662
kwargs["password"] = auth_password
673663

674664
tls_ctx_options = awscrt.io.TlsContextOptions()
675-
if not use_websockets:
665+
if use_websockets == False:
676666
kwargs["port"] = 443
677667
tls_ctx_options.alpn_list = ["mqtt"]
678668

0 commit comments

Comments
 (0)