Skip to content

Mqtt5 Support #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 63 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8ee74da
Mqtt5 sync (#11)
sbSteveK Nov 1, 2022
338a20e
Merge branch 'main_sync_current' into main_sync
sbSteveK Nov 3, 2022
5f4f2db
sample instructions for mqtt5-pubsub (#15)
sbSteveK Nov 3, 2022
fb665ff
error_code fix in mqtt5_pubsub sample
sbSteveK Nov 3, 2022
f566ea0
wording change in sample log
sbSteveK Nov 3, 2022
a16b920
first draft MQTT5 usage guide
sbSteveK Nov 8, 2022
b6688e4
changed awscrt version to 0.16.0
sbSteveK Nov 30, 2022
9e6c280
merge with main
sbSteveK Nov 30, 2022
67ad576
MQTT5 document moved
sbSteveK Nov 30, 2022
cc038f7
Added mqtt5 pubsub sample to codebuild
sbSteveK Dec 1, 2022
8a3ff0e
test
sbSteveK Dec 1, 2022
c8313a3
chmod on pubsub script
sbSteveK Dec 1, 2022
2d71cb6
ack_timeout_sec
sbSteveK Dec 1, 2022
8eeb965
publish_packet_data
sbSteveK Dec 1, 2022
00ea8a3
run mqtt5 sample in all ci jobs
sbSteveK Dec 1, 2022
f1daf3c
comment out properly
sbSteveK Dec 1, 2022
a344550
fix ci.yml
sbSteveK Dec 1, 2022
444bf90
add mqtt5_pubsub sample to all jobs
sbSteveK Dec 1, 2022
9ab83d3
Add 'is_ci' related command to sample
sbSteveK Dec 1, 2022
ea3eb95
mqtt5 builder basic test
sbSteveK Dec 1, 2022
203315b
added mqtt5 env setup to ci
sbSteveK Dec 1, 2022
ed99b82
re-order mqtt5 env setup
sbSteveK Dec 1, 2022
a6e4b8e
remove execute of mqtt5 env variables setup
sbSteveK Dec 1, 2022
b8bb10d
remove mqtt5 env var setup
sbSteveK Dec 1, 2022
44143ce
access keys
sbSteveK Dec 1, 2022
0f446d2
remove commented line from ci.yml
sbSteveK Dec 1, 2022
1ccd19e
removed CI_MQTT5_ROLE
sbSteveK Dec 1, 2022
1f8681c
updated env variable to show ROLE
sbSteveK Dec 1, 2022
890654f
changed variable name
sbSteveK Dec 1, 2022
1bcc38b
remove mqtt5 sample from linux job
sbSteveK Dec 1, 2022
2bd54d8
re-added mqtt5 sample test to linux
sbSteveK Dec 1, 2022
739838b
changed from boto3 to boto in linux ci
sbSteveK Dec 1, 2022
61586e9
reverted to boto3
sbSteveK Dec 1, 2022
5356272
fix secrets access
sbSteveK Dec 1, 2022
0f78782
attempt to use mqtt5 script
sbSteveK Dec 1, 2022
e3c76eb
test print to check env variable
sbSteveK Dec 1, 2022
9d49a6c
test print environ
sbSteveK Dec 1, 2022
0df2fc9
fix ci.yml
sbSteveK Dec 1, 2022
3bbbfb5
env test
sbSteveK Dec 1, 2022
f12ef5b
added -e to mqtt5 test setup
sbSteveK Dec 1, 2022
a3c2a20
removed mqtt5 script
sbSteveK Dec 1, 2022
a0bd7d7
config test
sbSteveK Dec 1, 2022
b901449
correct arguments
sbSteveK Dec 1, 2022
91b2336
updated test
sbSteveK Dec 2, 2022
5091656
fixed future check
sbSteveK Dec 2, 2022
2d4b4a4
added remaining builder tests
sbSteveK Dec 2, 2022
1ec6f6f
mqtt5 pkcs11 sample and test
sbSteveK Dec 2, 2022
dfd510f
changed softhsm2 conf file name
sbSteveK Dec 2, 2022
6a55aef
don't regen tokens
sbSteveK Dec 2, 2022
24e176c
fix sample
sbSteveK Dec 2, 2022
675964c
restore pkcs11 generation
sbSteveK Dec 2, 2022
bc1ee1e
reversed pkcs11 test order
sbSteveK Dec 2, 2022
5c4714d
tmp2 for all second pkcs11 tests
sbSteveK Dec 2, 2022
bad3550
dif conf file
sbSteveK Dec 2, 2022
5fc5e74
removed token steps
sbSteveK Dec 2, 2022
1977d07
pkcs11
sbSteveK Dec 2, 2022
196fd76
run both samples together
sbSteveK Dec 2, 2022
2c9bac8
changed labels
sbSteveK Dec 2, 2022
d950846
changed pkcs11 token tmp folder
sbSteveK Dec 2, 2022
604bc2d
remove mqtt5 specific job
sbSteveK Dec 2, 2022
1bad3f5
custom authorizer test/sample added
sbSteveK Dec 2, 2022
5ac1957
update MQTT5 Guide
sbSteveK Dec 2, 2022
177526d
updated guides and pr fixes
sbSteveK Dec 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
DA_SHADOW_VALUE_DEFAULT: OFF
CI_UTILS_FOLDER: "./aws-iot-device-sdk-python-v2/utils"
CI_SAMPLES_FOLDER: "./aws-iot-device-sdk-python-v2/samples"
CI_IOT_CONTAINERS: ${{ secrets.AWS_CI_IOT_CONTAINERS }}
CI_IOT_CONTAINERS_ROLE: ${{ secrets.AWS_CI_IOT_CONTAINERS }}
CI_PUBSUB_ROLE: ${{ secrets.AWS_CI_PUBSUB_ROLE }}
CI_CUSTOM_AUTHORIZER_ROLE: ${{ secrets.AWS_CI_CUSTOM_AUTHORIZER_ROLE }}
CI_SHADOW_ROLE: ${{ secrets.AWS_CI_SHADOW_ROLE }}
Expand All @@ -34,18 +34,17 @@ jobs:
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DA_ROLE_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DA_ROLE_PRIVATE_KEY }}
# There's hackery in builder.json so that when we run on manylinux
# we build and test using every version of python that we support.
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-manylinux2014-x64 build -p ${{ env.PACKAGE_NAME }}


al2:
runs-on: ubuntu-latest
permissions:
Expand All @@ -54,7 +53,7 @@ jobs:
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
role-to-assume: ${{ env.CI_IOT_CONTAINERS_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
- name: Build ${{ env.PACKAGE_NAME }}
Expand All @@ -76,7 +75,7 @@ jobs:
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
role-to-assume: ${{ env.CI_IOT_CONTAINERS_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
# set arm arch
- name: Install qemu/docker
Expand Down Expand Up @@ -107,6 +106,9 @@ jobs:
- name: run PubSub sample
run: |
python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: run MQTT5 PubSub sample
run: |
python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt5_pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: run Windows Certificate Connect sample
run: |
python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/windows_cert_connect.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true
Expand Down Expand Up @@ -141,6 +143,9 @@ jobs:
- name: run PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: run MQTT5 PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt5_pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: configure AWS credentials (Device Advisor)
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down Expand Up @@ -172,6 +177,9 @@ jobs:
- name: run PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: run MQTT5 PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt5_pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: configure AWS credentials (Device Advisor)
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down Expand Up @@ -213,6 +221,15 @@ jobs:
- name: run PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: run MQTT5 PubSub sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt5_pubsub.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key'
- name: run MQTT5 PKCS11 Connect sample
run: |
mkdir -p /tmp/mqtt5/tokens
export SOFTHSM2_CONF=/tmp/softhsm2.conf
echo "directories.tokendir = /tmp/mqtt5/tokens" > /tmp/softhsm2.conf
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt5_pkcs11_connect.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/keyp8' --sample_run_softhsm 'true' --sample_arguments '--pkcs11_lib /usr/lib/softhsm/libsofthsm2.so --pin 0000 --token_label my-token --key_label my-key'
- name: run PKCS11 Connect sample
run: |
mkdir -p /tmp/tokens
Expand All @@ -227,6 +244,9 @@ jobs:
- name: run CustomAuthorizerConnect sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/custom_authorizer_connect.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_custom_authorizer_name 'ci/CustomAuthorizer/name' --sample_secret_custom_authorizer_password 'ci/CustomAuthorizer/password'
- name: run MQTT5 CustomAuthorizerConnect sample
run: |
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language Python --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt5_custom_authorizer_connect.py" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_custom_authorizer_name 'ci/CustomAuthorizer/name' --sample_secret_custom_authorizer_password 'ci/CustomAuthorizer/password'
- name: configure AWS credentials (Shadow)
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
1 change: 1 addition & 0 deletions awsiot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'iotshadow',
'greengrass_discovery',
'mqtt_connection_builder',
'mqtt5_client_builder',
]

from awscrt import mqtt
Expand Down
Loading