IoTReady / aws_iot_demo

Assert statement used outside of tests BAN-B101
Security
Major
a year agoa year old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
13    device_cert = os.path.join(certs_dir, "{}-certificate.pem.crt".format(device_id))
14    device_private_key = os.path.join(certs_dir, "{}-private.pem.key".format(device_id))
15    assert os.path.exists(root_ca_cert), "Root CA Certificate not found"
16    assert os.path.exists(device_cert), "Device Certificate not found"17    assert os.path.exists(device_private_key), "Device Private Key not found"
18    return root_ca_cert, device_cert, device_private_key
19
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
12    root_ca_cert = os.path.join(certs_dir, "AmazonRootCA1.pem") # Adjust per your Root CA settings
13    device_cert = os.path.join(certs_dir, "{}-certificate.pem.crt".format(device_id))
14    device_private_key = os.path.join(certs_dir, "{}-private.pem.key".format(device_id))
15    assert os.path.exists(root_ca_cert), "Root CA Certificate not found"16    assert os.path.exists(device_cert), "Device Certificate not found"
17    assert os.path.exists(device_private_key), "Device Private Key not found"
18    return root_ca_cert, device_cert, device_private_key
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
14    device_private_key = os.path.join(certs_dir, "{}-private.pem.key".format(device_id))
15    assert os.path.exists(root_ca_cert), "Root CA Certificate not found"
16    assert os.path.exists(device_cert), "Device Certificate not found"
17    assert os.path.exists(device_private_key), "Device Private Key not found"18    return root_ca_cert, device_cert, device_private_key
19
20def get_shadow_handler(device_id):