Skip to content

Commit d0bc6f3

Browse files
committed
fix parameter & change parameter naming
1 parent 552bcc7 commit d0bc6f3

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

awsiot/mqtt5_client_builder.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def _builder(
362362
return client
363363

364364

365-
def mtls_from_path(cert_filepath, pri_key_filepath, cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
365+
def mtls_from_path(cert_filepath, pri_key_filepath, cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
366366
**kwargs) -> awscrt.mqtt5.Client:
367367
"""
368368
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an mTLS MQTT5 Client to AWS IoT.
@@ -378,14 +378,14 @@ def mtls_from_path(cert_filepath, pri_key_filepath, cipher_suite=awscrt.io.TlsCi
378378
"""
379379
_check_required_kwargs(**kwargs)
380380
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls_from_path(cert_filepath, pri_key_filepath)
381-
tls_ctx_options.cipher_pref = cipher_suite
381+
tls_ctx_options.cipher_pref = cipher_pref
382382
return _builder(tls_ctx_options, **kwargs)
383383

384384

385385
def mtls_from_bytes(
386386
cert_bytes,
387387
pri_key_bytes,
388-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
388+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
389389
**kwargs) -> awscrt.mqtt5.Client:
390390
"""
391391
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an mTLS MQTT5 Client to AWS IoT.
@@ -401,7 +401,7 @@ def mtls_from_bytes(
401401
"""
402402
_check_required_kwargs(**kwargs)
403403
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls(cert_bytes, pri_key_bytes)
404-
tls_ctx_options.cipher_pref = cipher_suite
404+
tls_ctx_options.cipher_pref = cipher_pref
405405
return _builder(tls_ctx_options, **kwargs)
406406

407407

@@ -413,7 +413,7 @@ def mtls_with_pkcs11(*,
413413
private_key_label: str = None,
414414
cert_filepath: str = None,
415415
cert_bytes=None,
416-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
416+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
417417
**kwargs) -> awscrt.mqtt5.Client:
418418
"""
419419
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an mTLS MQTT connection to AWS IoT,
@@ -459,14 +459,14 @@ def mtls_with_pkcs11(*,
459459
private_key_label=private_key_label,
460460
cert_file_path=cert_filepath,
461461
cert_file_contents=cert_bytes)
462-
tls_ctx_options.cipher_pref = cipher_suite
462+
tls_ctx_options.cipher_pref = cipher_pref
463463
return _builder(tls_ctx_options, **kwargs)
464464

465465

466466
def mtls_with_pkcs12(*,
467467
pkcs12_filepath: str,
468468
pkcs12_password: str,
469-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
469+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
470470
**kwargs) -> awscrt.mqtt.Connection:
471471
"""
472472
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT,
@@ -487,13 +487,13 @@ def mtls_with_pkcs12(*,
487487
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls_pkcs12(
488488
pkcs12_filepath=pkcs12_filepath,
489489
pkcs12_password=pkcs12_password)
490-
tls_ctx_options.cipher_pref = cipher_suite
490+
tls_ctx_options.cipher_pref = cipher_pref
491491
return _builder(tls_ctx_options, **kwargs)
492492

493493

494494
def mtls_with_windows_cert_store_path(*,
495495
cert_store_path: str,
496-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
496+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
497497
**kwargs) -> awscrt.mqtt5.Client:
498498
"""
499499
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an mTLS MQTT5 Client to AWS IoT,
@@ -512,15 +512,15 @@ def mtls_with_windows_cert_store_path(*,
512512
_check_required_kwargs(**kwargs)
513513

514514
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(cert_store_path)
515-
tls_ctx_options.cipher_pref = cipher_suite
515+
tls_ctx_options.cipher_pref = cipher_pref
516516
return _builder(tls_ctx_options, **kwargs)
517517

518518

519519
def websockets_with_default_aws_signing(
520520
region,
521521
credentials_provider,
522522
websocket_proxy_options=None,
523-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
523+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
524524
**kwargs) -> awscrt.mqtt5.Client:
525525
"""
526526
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an MQTT5 Client over websockets to AWS IoT.
@@ -560,15 +560,15 @@ def _sign_websocket_handshake_request(transform_args, **kwargs):
560560

561561
return websockets_with_custom_handshake(
562562
_sign_websocket_handshake_request,
563-
websocket_proxy_options,
564-
cipher_suite,
563+
websocket_proxy_options = websocket_proxy_options,
564+
cipher_pref = cipher_pref,
565565
**kwargs)
566566

567567

568568
def websockets_with_custom_handshake(
569569
websocket_handshake_transform,
570570
websocket_proxy_options=None,
571-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
571+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
572572
**kwargs) -> awscrt.mqtt5.Client:
573573
"""
574574
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an MQTT5 Client over websockets,
@@ -596,7 +596,7 @@ def websockets_with_custom_handshake(
596596
"""
597597
_check_required_kwargs(**kwargs)
598598
tls_ctx_options = awscrt.io.TlsContextOptions()
599-
tls_ctx_options.cipher_pref = cipher_suite
599+
tls_ctx_options.cipher_pref = cipher_pref
600600
return _builder(tls_ctx_options=tls_ctx_options,
601601
use_websockets=True,
602602
websocket_handshake_transform=websocket_handshake_transform,
@@ -628,7 +628,7 @@ def direct_with_custom_authorizer(
628628
auth_password=None,
629629
auth_token_key_name=None,
630630
auth_token_value=None,
631-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
631+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
632632
**kwargs) -> awscrt.mqtt5.Client:
633633
"""
634634
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an MQTT5 Client using a custom
@@ -695,7 +695,7 @@ def direct_with_custom_authorizer(
695695

696696
tls_ctx_options = awscrt.io.TlsContextOptions()
697697
tls_ctx_options.alpn_list = ["mqtt"]
698-
tls_ctx_options.cipher_pref = cipher_suite
698+
tls_ctx_options.cipher_pref = cipher_pref
699699

700700
return _builder(tls_ctx_options=tls_ctx_options,
701701
use_websockets=False,
@@ -711,7 +711,7 @@ def websockets_with_custom_authorizer(
711711
websocket_proxy_options=None,
712712
auth_token_key_name=None,
713713
auth_token_value=None,
714-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
714+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
715715
**kwargs) -> awscrt.mqtt5.Client:
716716
"""
717717
This builder creates an :class:`awscrt.mqtt5.Client`, configured for an MQTT5 Client using a custom
@@ -781,7 +781,7 @@ def websockets_with_custom_authorizer(
781781
kwargs["password"] = auth_password
782782

783783
tls_ctx_options = awscrt.io.TlsContextOptions()
784-
tls_ctx_options.cipher_pref = cipher_suite
784+
tls_ctx_options.cipher_pref = cipher_pref
785785

786786
def _sign_websocket_handshake_request(transform_args, **kwargs):
787787
# transform_args need to know when transform is done
@@ -798,7 +798,7 @@ def _sign_websocket_handshake_request(transform_args, **kwargs):
798798
**kwargs)
799799

800800

801-
def new_default_builder(cipher_suite=awscrt.io.TlsCipherPref.DEFAULT, **kwargs) -> awscrt.mqtt5.Client:
801+
def new_default_builder(cipher_pref=awscrt.io.TlsCipherPref.DEFAULT, **kwargs) -> awscrt.mqtt5.Client:
802802
"""
803803
This builder creates an :class:`awscrt.mqtt5.Client`, without any configuration besides the default TLS context options.
804804
@@ -807,7 +807,7 @@ def new_default_builder(cipher_suite=awscrt.io.TlsCipherPref.DEFAULT, **kwargs)
807807
"""
808808
_check_required_kwargs(**kwargs)
809809
tls_ctx_options = awscrt.io.TlsContextOptions()
810-
tls_ctx_options.cipher_pref = cipher_suite
810+
tls_ctx_options.cipher_pref = cipher_pref
811811
return _builder(tls_ctx_options=tls_ctx_options,
812812
use_websockets=False,
813813
**kwargs)

awsiot/mqtt_connection_builder.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _builder(
261261
def mtls_from_path(
262262
cert_filepath,
263263
pri_key_filepath,
264-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
264+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
265265
**kwargs) -> awscrt.mqtt.Connection:
266266
"""
267267
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT.
@@ -277,14 +277,14 @@ def mtls_from_path(
277277
"""
278278
_check_required_kwargs(**kwargs)
279279
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls_from_path(cert_filepath, pri_key_filepath)
280-
tls_ctx_options.cipher_pref = cipher_suite
280+
tls_ctx_options.cipher_pref = cipher_pref
281281
return _builder(tls_ctx_options, **kwargs)
282282

283283

284284
def mtls_from_bytes(
285285
cert_bytes,
286286
pri_key_bytes,
287-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
287+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
288288
**kwargs) -> awscrt.mqtt.Connection:
289289
"""
290290
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT.
@@ -300,7 +300,7 @@ def mtls_from_bytes(
300300
"""
301301
_check_required_kwargs(**kwargs)
302302
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls(cert_bytes, pri_key_bytes)
303-
tls_ctx_options.cipher_pref = cipher_suite
303+
tls_ctx_options.cipher_pref = cipher_pref
304304
return _builder(tls_ctx_options, **kwargs)
305305

306306

@@ -312,7 +312,7 @@ def mtls_with_pkcs11(*,
312312
private_key_label: str = None,
313313
cert_filepath: str = None,
314314
cert_bytes=None,
315-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
315+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
316316
**kwargs) -> awscrt.mqtt.Connection:
317317
"""
318318
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT,
@@ -358,15 +358,15 @@ def mtls_with_pkcs11(*,
358358
private_key_label=private_key_label,
359359
cert_file_path=cert_filepath,
360360
cert_file_contents=cert_bytes)
361-
tls_ctx_options.cipher_pref = cipher_suite
361+
tls_ctx_options.cipher_pref = cipher_pref
362362

363363
return _builder(tls_ctx_options, **kwargs)
364364

365365

366366
def mtls_with_pkcs12(*,
367367
pkcs12_filepath: str,
368368
pkcs12_password: str,
369-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
369+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
370370
**kwargs) -> awscrt.mqtt.Connection:
371371
"""
372372
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT,
@@ -387,13 +387,13 @@ def mtls_with_pkcs12(*,
387387
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls_pkcs12(
388388
pkcs12_filepath=pkcs12_filepath,
389389
pkcs12_password=pkcs12_password)
390-
tls_ctx_options.cipher_suite = cipher_suite
390+
tls_ctx_options.cipher_pref = cipher_pref
391391
return _builder(tls_ctx_options, **kwargs)
392392

393393

394394
def mtls_with_windows_cert_store_path(*,
395395
cert_store_path: str,
396-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
396+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
397397
**kwargs) -> awscrt.mqtt.Connection:
398398
"""
399399
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an mTLS MQTT connection to AWS IoT,
@@ -412,7 +412,7 @@ def mtls_with_windows_cert_store_path(*,
412412
_check_required_kwargs(**kwargs)
413413

414414
tls_ctx_options = awscrt.io.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(cert_store_path)
415-
tls_ctx_options.cipher_pref = cipher_suite
415+
tls_ctx_options.cipher_pref = cipher_pref
416416

417417
return _builder(tls_ctx_options, **kwargs)
418418

@@ -421,7 +421,7 @@ def websockets_with_default_aws_signing(
421421
region,
422422
credentials_provider,
423423
websocket_proxy_options=None,
424-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
424+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
425425
**kwargs) -> awscrt.mqtt.Connection:
426426
"""
427427
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an MQTT connection over websockets to AWS IoT.
@@ -461,15 +461,15 @@ def _sign_websocket_handshake_request(transform_args, **kwargs):
461461

462462
return websockets_with_custom_handshake(
463463
_sign_websocket_handshake_request,
464-
cipher_suite,
465-
websocket_proxy_options,
464+
websocket_proxy_options = websocket_proxy_options,
465+
cipher_pref = cipher_pref,
466466
**kwargs)
467467

468468

469469
def websockets_with_custom_handshake(
470470
websocket_handshake_transform,
471471
websocket_proxy_options=None,
472-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
472+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
473473
**kwargs) -> awscrt.mqtt.Connection:
474474
"""
475475
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an MQTT connection over websockets,
@@ -497,7 +497,7 @@ def websockets_with_custom_handshake(
497497
"""
498498
_check_required_kwargs(**kwargs)
499499
tls_ctx_options = awscrt.io.TlsContextOptions()
500-
tls_ctx_options.cipher_pref = cipher_suite
500+
tls_ctx_options.cipher_pref = cipher_pref
501501
return _builder(tls_ctx_options=tls_ctx_options,
502502
use_websockets=True,
503503
websocket_handshake_transform=websocket_handshake_transform,
@@ -529,7 +529,7 @@ def direct_with_custom_authorizer(
529529
auth_password=None,
530530
auth_token_key_name=None,
531531
auth_token_value=None,
532-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
532+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
533533
**kwargs) -> awscrt.mqtt.Connection:
534534
"""
535535
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an MQTT connection using a custom
@@ -575,7 +575,7 @@ def direct_with_custom_authorizer(
575575
auth_token_key_name=auth_token_key_name,
576576
auth_token_value=auth_token_value,
577577
use_websockets=False,
578-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
578+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
579579
**kwargs)
580580

581581

@@ -588,7 +588,7 @@ def websockets_with_custom_authorizer(
588588
auth_password=None,
589589
auth_token_key_name=None,
590590
auth_token_value=None,
591-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
591+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
592592
**kwargs) -> awscrt.mqtt.Connection:
593593
"""
594594
This builder creates an :class:`awscrt.mqtt.Connection`, configured for an MQTT connection using a custom
@@ -640,7 +640,7 @@ def websockets_with_custom_authorizer(
640640
use_websockets=True,
641641
websockets_region=region,
642642
websockets_credentials_provider=credentials_provider,
643-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
643+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
644644
**kwargs)
645645

646646

@@ -653,7 +653,7 @@ def _with_custom_authorizer(auth_username=None,
653653
use_websockets=False,
654654
websockets_credentials_provider=None,
655655
websockets_region=None,
656-
cipher_suite=awscrt.io.TlsCipherPref.DEFAULT,
656+
cipher_pref=awscrt.io.TlsCipherPref.DEFAULT,
657657
**kwargs) -> awscrt.mqtt.Connection:
658658
"""
659659
Helper function that contains the setup needed for custom authorizers
@@ -687,7 +687,7 @@ def _with_custom_authorizer(auth_username=None,
687687
kwargs["password"] = auth_password
688688

689689
tls_ctx_options = awscrt.io.TlsContextOptions()
690-
tls_ctx_options.cipher_pref = cipher_suite
690+
tls_ctx_options.cipher_pref = cipher_pref
691691
if not use_websockets:
692692
kwargs["port"] = 443
693693
tls_ctx_options.alpn_list = ["mqtt"]

0 commit comments

Comments
 (0)