Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0ec68c5
regenerate identity client w/deprecation
sbSteveK Aug 13, 2025
b6c699b
Merge branch 'main' into soft-deprecation
sbSteveK Aug 13, 2025
9316188
point crt to the soft-deprecation branch
sbSteveK Aug 13, 2025
c274beb
set fail-fast to false and begin adding --cmake-extra=-DAWS_CRT_DISAB…
sbSteveK Aug 13, 2025
45c547b
try adding the AWS_CRT_SOFT_DEPRECATED header to identity
sbSteveK Aug 13, 2025
54ff899
forgot to close the parenthesis
sbSteveK Aug 13, 2025
264eb85
add the deprecation option to identity CMakeLists.txt
sbSteveK Aug 13, 2025
f4a5252
add deprecation warning option to sdk CMakeLists.txt
sbSteveK Aug 13, 2025
5d21c35
add deprecation warning option to commands-sandbox
sbSteveK Aug 13, 2025
ae82e3b
remove mqtt311 and v1 service client samples
sbSteveK Aug 13, 2025
e4459de
remove samples from .builder action
sbSteveK Aug 13, 2025
6223fa8
add deprecation warning setting to more samples
sbSteveK Aug 13, 2025
c346981
commandlineutils uses deprecated mqtt for some reason...
sbSteveK Aug 13, 2025
88aeb82
all other samples using command line utils
sbSteveK Aug 13, 2025
8eb389b
jobs and shadow apparently
sbSteveK Aug 13, 2025
88f0687
tests need definition too
sbSteveK Aug 13, 2025
23b7aa4
handle the option instead
sbSteveK Aug 13, 2025
da04237
losing my mind. more cmake lists
sbSteveK Aug 13, 2025
84a3126
add more deprecation warning options to ci.yml
sbSteveK Aug 13, 2025
d3b2307
add deprecation suppression to windows ci
sbSteveK Aug 13, 2025
c7565d2
omg more cmake lists
sbSteveK Aug 13, 2025
a6a9f84
device defender sample...
sbSteveK Aug 13, 2025
90888a7
remove mqtt3 sample runs from ci
sbSteveK Aug 13, 2025
75ab3f6
remove mqtt3 related smoke tests and files
sbSteveK Aug 13, 2025
9e08fd5
try to add the deprecation option to macos in ci
sbSteveK Aug 13, 2025
94e8d5f
try to add deprecation option to linux-smoke-tests
sbSteveK Aug 13, 2025
4d6394b
sanatizers and git actions deprecation option
sbSteveK Aug 13, 2025
ed6fe6a
remove windows-app-verifier job
sbSteveK Aug 14, 2025
4c9cf84
clang
sbSteveK Aug 14, 2025
e68724f
clang
sbSteveK Aug 14, 2025
06ed104
remove samples used as tests from codebuild job
sbSteveK Aug 14, 2025
6c6a2a7
remove appverifier unused files
sbSteveK Aug 14, 2025
ba001db
doxygen settings updated to handle deprecation
sbSteveK Aug 14, 2025
5d15262
get the deprecation warning off for codebuild
sbSteveK Aug 14, 2025
f1471cc
updated jobs client
sbSteveK Aug 14, 2025
1064e26
generated shadow update
sbSteveK Aug 14, 2025
32e456c
cmake lists update
sbSteveK Aug 14, 2025
1518b40
regen jobs/shadow headers
sbSteveK Aug 14, 2025
ee2f1e9
first main merge attempt
sbSteveK Sep 29, 2025
95d2ecf
remove dupe fail-fast and get output in text for secrets in codebuild…
sbSteveK Sep 29, 2025
ccd49db
manually point to crt branch for now
sbSteveK Sep 29, 2025
5dff558
disable deprecation warnings on macos ci job
sbSteveK Sep 29, 2025
98c0177
restore cmake list files
sbSteveK Sep 29, 2025
af0a3c9
more cmake fixes
sbSteveK Sep 29, 2025
f064adc
re-remove app-verifier
sbSteveK Sep 29, 2025
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
75 changes: 26 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@ env:
CI_SAMPLES_CFG_FOLDER: "./aws-iot-device-sdk-cpp-v2/.github/workflows"
CI_SERVICE_TESTS_CFG_FOLDER: "./test_cases"
CI_IOT_CONTAINERS: arn:aws:iam::123124136734:role/CRT_IoT_Containers
CI_PUBSUB_ROLE: arn:aws:iam::180635532705:role/CI_PubSub_Role
CI_CYCLEPUBSUB_ROLE: arn:aws:iam::180635532705:role/CI_CyclePubSub_Role
CI_CUSTOM_AUTHORIZER_ROLE: arn:aws:iam::180635532705:role/CI_CustomAuthorizer_Role
CI_COGNITO_ROLE: arn:aws:iam::180635532705:role/CI_Cognito_Role
CI_SHADOW_ROLE: arn:aws:iam::180635532705:role/CI_Shadow_Role
CI_JOBS_ROLE: arn:aws:iam::180635532705:role/CI_Jobs_Role
CI_FLEET_PROVISIONING_ROLE: arn:aws:iam::180635532705:role/service-role/CI_FleetProvisioning_Role
CI_DEVICE_DEFENDER: arn:aws:iam::180635532705:role/CI_DeviceDefender_Role
CI_SECURE_TUNNEL: arn:aws:iam::180635532705:role/CI_SecureTunnel_Role
CI_X509_ROLE: arn:aws:iam::180635532705:role/CI_X509_Role
CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role
CI_JOBS_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_JobsServiceClient_Role
CI_SHADOW_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_ShadowServiceClient_Role
Expand Down Expand Up @@ -68,7 +62,8 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
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-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} \
--cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON

raspberry:
runs-on: ubuntu-24.04 # latest
Expand All @@ -91,8 +86,8 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
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-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}

./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} \
--cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON
linux-compiler-compat:
runs-on: ubuntu-22.04
strategy:
Expand Down Expand Up @@ -121,8 +116,8 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
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-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}

./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} \
--cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON
byo-crypto:
runs-on: ubuntu-latest
permissions:
Expand All @@ -137,8 +132,9 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
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-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON --variant=skip_sample

./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --variant=skip_sample \
--cmake-extra=-DBYO_CRYPTO=ON \
--cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON
linux-no-cpu-extensions:
runs-on: ubuntu-latest
permissions:
Expand All @@ -153,8 +149,9 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }}
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-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF

./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} \
--cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON \
--cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
windows:
runs-on: windows-latest
permissions:
Expand All @@ -166,6 +163,8 @@ jobs:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
env:
CL: "/DAWS_CRT_DISABLE_DEPRECATION_WARNINGS /EHsc"
run: |
md ${{ env.CI_FOLDER }}
cd ${{ env.CI_FOLDER }}
Expand All @@ -187,6 +186,8 @@ jobs:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
env:
CL: "/DAWS_CRT_DISABLE_DEPRECATION_WARNINGS /EHsc"
# The "--cmake-extra=-Tv143" explicitly sets VS 17 2022 to be used for compilation.
# See https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html#toolset-selection
run: |
Expand All @@ -206,42 +207,14 @@ jobs:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
env:
CL: "/DAWS_CRT_DISABLE_DEPRECATION_WARNINGS /EHsc"
run: |
md ${{ env.CI_FOLDER }}
cd ${{ env.CI_FOLDER }}
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF

windows-app-verifier:
runs-on: windows-2025
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
md ${{ env.CI_FOLDER }}
cd ${{ env.CI_FOLDER }}
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
- name: Running samples in CI setup
run: |
python -m pip install boto3
- name: configure AWS credentials (MQTT5)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Run and check AppVerifier
run: |
cd ${{ env.CI_FOLDER }}
echo "Starting to run AppVerifier with mqtt5 pub-sub sample"
python ${{ env.CI_UTILS_FOLDER }}/appverifier_launch_sample.py --sample_file ".\aws-iot-device-sdk-cpp-v2\build\samples\mqtt\mqtt5_x509\RelWithDebInfo\mqtt5_x509.exe" --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key'

windows-shared-lib:
runs-on: windows-latest
permissions:
Expand All @@ -253,6 +226,8 @@ jobs:
role-to-assume: ${{ env.CI_IOT_CONTAINERS }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
env:
CL: "/DAWS_CRT_DISABLE_DEPRECATION_WARNINGS /EHsc"
run: |
md ${{ env.CI_FOLDER }}
cd ${{ env.CI_FOLDER }}
Expand Down Expand Up @@ -280,7 +255,8 @@ jobs:
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream \
--cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON

linux-github-actions:
runs-on: ubuntu-latest
Expand All @@ -297,7 +273,7 @@ jobs:
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }}
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON
- name: Device Defender setup
run: |
python3 -m pip install boto3
Expand Down Expand Up @@ -340,7 +316,7 @@ jobs:
git clone --recursive https://github.com/aws/aws-iot-device-sdk-cpp-v2.git --branch ${{ env.HEAD_REF || github.ref_name }}
echo "Running builder"
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }}
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON
- name: Running samples in CI setup
run: |
python3 -m pip install boto3
Expand Down Expand Up @@ -460,6 +436,7 @@ jobs:
clang-sanitizers:
runs-on: ubuntu-24.04 # latest
strategy:
fail-fast: false
matrix:
sanitizer-variants: ["tsan", "asan"]
permissions:
Expand All @@ -476,7 +453,7 @@ jobs:
git clone --recursive https://github.com/aws/aws-iot-device-sdk-cpp-v2.git --branch ${{ env.HEAD_REF || github.ref_name }}
echo "Running builder"
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --variant ${{ matrix.sanitizer-variants }}
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --variant ${{ matrix.sanitizer-variants }} --cmake-extra=-DAWS_CRT_DISABLE_DEPRECATION_WARNINGS=ON
- name: Running samples in CI setup
run: |
python3 -m pip install boto3
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ include(CTest)
option(BUILD_DEPS "Builds aws common runtime dependencies as part of build. Turn off if you want to control your dependency chain." ON)
option(USE_EXTERNAL_DEPS_SOURCES "Use dependencies provided by add_subdirectory command" OFF)
option(BUILD_SAMPLES "(DEPRECATED) Build samples as part of the build" OFF)
option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the deprecation note affect current V1 service client user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will notify anyone using the MQTT3 client and connections that it's deprecated. Toggling this to ON should turn those warnings off even for V1 service client users.

if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
Expand Down
6 changes: 3 additions & 3 deletions codebuild/setup-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ make install

cd ..

cert=$(aws secretsmanager get-secret-value --secret-id "ci/CodeBuild/cert" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem
key=$(aws secretsmanager get-secret-value --secret-id "ci/CodeBuild/key" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem
key_p8=$(aws secretsmanager get-secret-value --secret-id "ci/CodeBuild/keyp8" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key_p8" > /tmp/privatekey_p8.pem
cert=$(aws secretsmanager get-secret-value --secret-id "ci/CodeBuild/cert" --query "SecretString" --output text) && echo -e "$cert" > /tmp/certificate.pem
key=$(aws secretsmanager get-secret-value --secret-id "ci/CodeBuild/key" --query "SecretString" --output text) && echo -e "$key" > /tmp/privatekey.pem
key_p8=$(aws secretsmanager get-secret-value --secret-id "ci/CodeBuild/keyp8" --query "SecretString" --output text) && echo -e "$key_p8" > /tmp/privatekey_p8.pem
5 changes: 5 additions & 0 deletions commands/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ include(AwsTestHarness)
enable_testing()
include(CTest)

option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

file(GLOB TEST_SRC "*.cpp")
file(GLOB TEST_HDRS "*.h")
file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})
Expand Down
5 changes: 5 additions & 0 deletions devicedefender/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include")
set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotdevicedefender/Config.h")
configure_file(include/aws/iotdevicedefender/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY)

option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
Expand Down
5 changes: 5 additions & 0 deletions devicedefender/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ include(AwsTestHarness)
enable_testing()
include(CTest)

option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

file(GLOB TEST_SRC "*.cpp")
file(GLOB TEST_HDRS "*.h")
file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})
Expand Down
7 changes: 4 additions & 3 deletions docsrc/doxygen.config
Original file line number Diff line number Diff line change
Expand Up @@ -2219,15 +2219,15 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

MACRO_EXPANSION = NO
MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES

# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
Expand Down Expand Up @@ -2259,7 +2259,8 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED += AWS_CRT_SOFT_DEPRECATED(x)=
PREDEFINED += AWS_CRT_CPP_API=

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
5 changes: 5 additions & 0 deletions eventstream_rpc/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ include(AwsTestHarness)
enable_testing()
include(CTest)

option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

file(GLOB AWS_ECHOTESTRPC_HEADERS
"include/awstest/*.h"
)
Expand Down
5 changes: 5 additions & 0 deletions identity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

cmake_minimum_required(VERSION 3.9...3.31)

option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

project(IotIdentity-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION})

set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
Expand Down
8 changes: 7 additions & 1 deletion identity/include/aws/iotidentity/IotIdentityClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ namespace Aws
std::function<void(Aws::Iotidentity::ErrorResponse *, int ioErr)>;

/**
* @deprecated We strongly recommend using IotIdentityClientV2. There are no current plans to
* fully deprecate IotIdentityClient but it is highly recommended customers migrate to IotIdentityClientV2
* More details can be found in the GitHub Repo FAQ
* An AWS IoT service that assists with provisioning a device and installing unique client certificates on it
*
* https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html
*
*/
class AWS_IOTIDENTITY_API IotIdentityClient final
class AWS_IOTIDENTITY_API AWS_CRT_SOFT_DEPRECATED(
"We strongly recommend using IotIdentityClientV2. There are no current plans to fully "
"deprecate IotIdentityClient but it is highly recommended customers migrate to "
"IotIdentityClientV2 More details can be found in the GitHub Repo FAQ") IotIdentityClient final
{
public:
IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt::MqttConnection> &connection);
Expand Down
50 changes: 50 additions & 0 deletions identity/source/IotIdentityClientV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,56 @@ namespace Aws
return submitResult == AWS_OP_SUCCESS;
}

template <typename T> class ServiceStreamingOperation : public Aws::Iot::RequestResponse::IStreamingOperation
{
public:
explicit ServiceStreamingOperation(std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> stream)
: m_stream(std::move(stream))
{
}

static std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> Create(
Aws::Crt::Allocator *allocator,
const std::shared_ptr<Aws::Iot::RequestResponse::IMqttRequestResponseClient> &bindingClient,
const Aws::Crt::String &subscriptionTopicFilter,
const Aws::Iot::RequestResponse::StreamingOperationOptions<T> &options)
{

std::function<void(Aws::Iot::RequestResponse::IncomingPublishEvent &&)> unmodeledHandler =
[options](Aws::Iot::RequestResponse::IncomingPublishEvent &&event)
{
const auto &payload = event.GetPayload();
Aws::Crt::String objectStr(reinterpret_cast<char *>(payload.ptr), payload.len);
Aws::Crt::JsonObject jsonObject(objectStr);
if (!jsonObject.WasParseSuccessful())
{
return;
}

T modeledEvent(jsonObject);
options.GetStreamHandler()(std::move(modeledEvent));
};

Aws::Iot::RequestResponse::StreamingOperationOptionsInternal internalOptions;
internalOptions.subscriptionTopicFilter = Aws::Crt::ByteCursorFromString(subscriptionTopicFilter);
internalOptions.subscriptionStatusEventHandler = options.GetSubscriptionStatusEventHandler();
internalOptions.incomingPublishEventHandler = unmodeledHandler;

auto unmodeledStream = bindingClient->CreateStream(internalOptions);
if (!unmodeledStream)
{
return nullptr;
}

return Aws::Crt::MakeShared<ServiceStreamingOperation<T>>(allocator, unmodeledStream);
}

void Open() override { m_stream->Open(); }

private:
std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> m_stream;
};

std::shared_ptr<IClientV2> NewClientFrom5(
const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient,
const Aws::Iot::RequestResponse::RequestResponseClientOptions &options,
Expand Down
5 changes: 5 additions & 0 deletions identity/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ include(AwsTestHarness)
enable_testing()
include(CTest)

option(AWS_CRT_DISABLE_DEPRECATION_WARNINGS "Set this to silence [[deprecated]] warnings coming from aws-crt-cpp headers" OFF)
if(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
add_compile_definitions(AWS_CRT_DISABLE_DEPRECATION_WARNINGS)
endif()

file(GLOB TEST_SRC "*.cpp")
file(GLOB TEST_HDRS "*.h")
file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})
Expand Down
Loading
Loading