diff --git a/samples/utils/command_line_utils.py b/samples/utils/command_line_utils.py index 81f9925e..908b97c2 100644 --- a/samples/utils/command_line_utils.py +++ b/samples/utils/command_line_utils.py @@ -436,16 +436,20 @@ def parse_sample_input_static_credentials_connect(): cmdUtils.register_command(CommandLineUtils.m_cmd_client_id, "", "Client ID to use for MQTT connection (optional, default='test-*').", default="test-" + str(uuid4())) + cmdUtils.register_command(CommandLineUtils.m_cmd_signing_region, "", + "The signing region used for the websocket signer", + False, str) cmdUtils.register_command(CommandLineUtils.m_cmd_session_token, "", "", default="test-" + str(uuid4())) - cmdUtils.register_command(CommandLineUtils.m_cmd_access_key_id, "", "", type=int) + cmdUtils.register_command(CommandLineUtils.m_cmd_access_key_id, "", "") cmdUtils.register_command(CommandLineUtils.m_cmd_secret_access_key, "", "") cmdUtils.get_args() cmdData = CommandLineUtils.CmdData() cmdData.input_endpoint = cmdUtils.get_command_required(CommandLineUtils.m_cmd_endpoint) cmdData.input_session_token = cmdUtils.get_command(CommandLineUtils.m_cmd_session_token) + cmdData.input_signing_region = cmdUtils.get_command_required(CommandLineUtils.m_cmd_signing_region, CommandLineUtils.m_cmd_region) cmdData.input_access_key_id = cmdUtils.get_command(CommandLineUtils.m_cmd_access_key_id) - cmdData.input_secret_access_key = cmdUtils.get_command(CommandLineUtils.m_secret_access_key) + cmdData.input_secret_access_key = cmdUtils.get_command(CommandLineUtils.m_cmd_secret_access_key) cmdData.input_clientId = cmdUtils.get_command(CommandLineUtils.m_cmd_client_id, "test-" + str(uuid4())) cmdData.input_is_ci = cmdUtils.get_command(CommandLineUtils.m_cmd_is_ci, None) != None return cmdData diff --git a/samples/websocket_connect.md b/samples/websocket_connect.md index 8d249061..ab655d91 100644 --- a/samples/websocket_connect.md +++ b/samples/websocket_connect.md @@ -5,7 +5,7 @@ If you want to use custom auth (or static creds, or basic auth, etc) instead, then you will need to replace part of the sample (connection\_setup function) with a code snippet we provided in its corresponding readme. * [Websocket Connection Using Custom Authentication](#websocket-connection-using-custom-authentication) -* [Websocket Connection Using Static Credentials](#websocket-connection-using-custom-authentication) +* [Websocket Connection Using Static Credentials](#websocket-connection-using-static-credentials) This sample makes an MQTT connection via Websockets and then disconnects. On startup, the device connects to the server via Websockets and then disconnects right after. @@ -157,7 +157,7 @@ def connection_setup(): # See the Utils/CommandLineUtils for more information. cmdData = CommandLineUtils.parse_sample_input_static_credentials_connect() - cred_provider = AwsCredentialsProvider.new_static( + cred_provider = auth.AwsCredentialsProvider.new_static( access_key_id=cmdData.input_access_key_id, secret_access_key=cmdData.input_secret_access_key, session_token=cmdData.input_session_token)