From 89000cd57676a481f557be614e02cfee33810eaa Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 17 Oct 2024 07:04:35 +0000 Subject: [PATCH 1/6] Modified condition to create default sample shadow directory --- source/config/Config.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/config/Config.cpp b/source/config/Config.cpp index a053176a..33e45763 100644 --- a/source/config/Config.cpp +++ b/source/config/Config.cpp @@ -1773,12 +1773,13 @@ bool PlainConfig::SampleShadow::LoadFromCliArgs(const CliArgs &cliArgs) .c_str(); } - // setting `shadowOutputFile` value to default if no value was passed by user via CLI or JSON config. - if ((!shadowOutputFile.has_value() || shadowOutputFile->empty()) && !createShadowOutputFile()) + // setting `shadowOutputFile` value to default if no value was passed by user via CLI or JSON config, provided sample shadow feature is enabled. + if (enabled && ((!shadowOutputFile.has_value() || shadowOutputFile->empty()) && !createShadowOutputFile())) { return false; } + LOGM_INFO(Config::TAG, "Not creating directory %s since sample shadow is disabled", Config::DEFAULT_SAMPLE_SHADOW_OUTPUT_DIR); return true; } From bbeb3866b8b0f36910854627d3fc364c1569f233 Mon Sep 17 00:00:00 2001 From: Ishan Gupta-AWS <74676865+ig15@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:53:06 +0530 Subject: [PATCH 2/6] Updated versions in build.yml for aws credential fetch --- .github/workflows/build.yml | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afcac72e..30544d88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -37,7 +37,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE - name: Archive ubuntu Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -45,7 +45,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -58,7 +58,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -77,7 +77,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE - name: Archive amazonlinux Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -85,7 +85,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -98,7 +98,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -117,7 +117,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE - name: Archive rhel-ubi8 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -125,7 +125,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -141,7 +141,7 @@ jobs: version: [ 5, 6, 7, 8, 11 ] steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -168,7 +168,7 @@ jobs: version: [ 5.0, 6.0, 7, 8, 9, 11 ] steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -192,7 +192,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -211,7 +211,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=armhf_cross_mode - name: Archive armhf32 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -219,7 +219,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -232,7 +232,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -251,7 +251,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=mips_cross_mode - name: Archive mips32 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -259,7 +259,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -272,7 +272,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -291,7 +291,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=aarch64_cross_mode - name: Archive aarch64 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -299,7 +299,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -312,7 +312,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -331,7 +331,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=ppc64_cross_mode - name: Archive aarch64 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -339,7 +339,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -352,7 +352,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -371,7 +371,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=ppc64le_cross_mode - name: Archive aarch64 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -379,7 +379,7 @@ jobs: path: | ./build/${{ env.PACKAGE_NAME }} - name: Archive setup files - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -392,7 +392,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -411,7 +411,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=st_component_mode - name: Archive ST Ubuntu aarch64 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -424,7 +424,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -443,7 +443,7 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=st_aarch64_cross_mode - name: Archive ST Ubuntu aarch64 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: @@ -456,7 +456,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -475,10 +475,10 @@ jobs: docker pull $DOCKER_IMAGE docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --compile-mode=st_armhf_cross_mode - name: Archive st armhf32 Build Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # Run for main branch only if: github.ref == 'refs/heads/main' with: name: "ST.linux.armhf.${{ env.PACKAGE_NAME }}" path: | - ./build/${{ env.PACKAGE_NAME }} \ No newline at end of file + ./build/${{ env.PACKAGE_NAME }} From 219900d6372b149d9eccf325590f6b26647a82c4 Mon Sep 17 00:00:00 2001 From: Ishan Gupta-AWS <74676865+ig15@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:31:03 +0530 Subject: [PATCH 3/6] Updated build.yml to revert version of configure-aws-credentials to v1 --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30544d88..59ad1e41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -58,7 +58,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -98,7 +98,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -141,7 +141,7 @@ jobs: version: [ 5, 6, 7, 8, 11 ] steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -168,7 +168,7 @@ jobs: version: [ 5.0, 6.0, 7, 8, 9, 11 ] steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -192,7 +192,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -232,7 +232,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -272,7 +272,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -312,7 +312,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -352,7 +352,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -392,7 +392,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -424,7 +424,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -456,7 +456,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} From 01630a758e92cdf954c723da2d31fe0af5eefde5 Mon Sep 17 00:00:00 2001 From: Ishan Gupta-AWS <74676865+ig15@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:55:34 +0530 Subject: [PATCH 4/6] Updated aws-credentials fetching mechanism version in build.yml --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59ad1e41..30544d88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -58,7 +58,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -98,7 +98,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -141,7 +141,7 @@ jobs: version: [ 5, 6, 7, 8, 11 ] steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -168,7 +168,7 @@ jobs: version: [ 5.0, 6.0, 7, 8, 9, 11 ] steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -192,7 +192,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -232,7 +232,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -272,7 +272,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -312,7 +312,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -352,7 +352,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -392,7 +392,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -424,7 +424,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} @@ -456,7 +456,7 @@ jobs: if: (github.event_name == 'push') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)) steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ECR_USER_AWS_KEY_ID }} aws-secret-access-key: ${{ secrets.ECR_USER_AWS_KEY_SECRET }} From ddc87c6b44e819e2caad6b4ac9d04820799f1b87 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 11 Nov 2024 07:04:10 +0000 Subject: [PATCH 5/6] Add job document comparator to ignore pre-signed difference in s3 url --- source/jobs/JobsFeature.cpp | 91 +++++++++++++++++++++++++++++++++-- source/jobs/JobsFeature.h | 15 ++++++ test/jobs/TestJobsFeature.cpp | 56 +++++++++++++++++++++ 3 files changed, 158 insertions(+), 4 deletions(-) diff --git a/source/jobs/JobsFeature.cpp b/source/jobs/JobsFeature.cpp index f3b26af1..a9a4b063 100644 --- a/source/jobs/JobsFeature.cpp +++ b/source/jobs/JobsFeature.cpp @@ -527,9 +527,87 @@ void JobsFeature::copyJobsNotification(Iotjobs::JobExecutionData job) latestJobsNotification.ExecutionNumber = job.ExecutionNumber.value(); } + +bool JobsFeature::compareJobDocuments(const Aws::Crt::JsonObject& job1, const Aws::Crt::JsonObject& job2) { + std::string str1 = job1.View().WriteCompact().c_str(); + std::string str2 = job2.View().WriteCompact().c_str(); + + // Regular expression to match S3 URLs and capture the non-presigned parts + std::regex s3UrlRegex(R"((https://[^.\s"]+\.s3[.-](?:[^.\s"]+\.)?amazonaws\.com/[^?\s"]+)(\?[^"\s]+)?)"); + + // Function to replace only the pre-signed portion of S3 URLs + auto processPresignedUrls = [&s3UrlRegex](std::string& s) -> int { + int count = 0; + std::string result; + std::sregex_iterator it(s.begin(), s.end(), s3UrlRegex); + std::sregex_iterator end; + + size_t lastPos = 0; + for (; it != end; ++it) { + count++; + result += s.substr(lastPos, it->position() - lastPos); + result += it->str(1); + // Add the non-presigned part of the URL + result += "?aws:iot:s3-presigned-suffix:PLACEHOLDER"; + // Replace only the presigned portion + lastPos = it->position() + it->length(); + } + result += s.substr(lastPos); + + s = result; + return count; + }; + + int count1 = processPresignedUrls(str1); + int count2 = processPresignedUrls(str2); + + // If the number of pre-signed URLs differs, the documents are different + if (count1 != count2) { + return false; + } + + std::cout << "Processed str1: " << str1 << std::endl; + std::cout << "Processed str2: " << str2 << std::endl; + + return str1 == str2; +} bool JobsFeature::isDuplicateNotification(JobExecutionData job) { unique_lock readLatestNotificationLock(latestJobsNotificationLock); + + // Basic logging at the start of the function + std::cout << "DEBUG: Entering isDuplicateNotification function" << std::endl; + + + + // Log Job IDs being compared + std::cout << "INFO: Comparing Job IDs - New: " << (job.JobId.has_value() ? job.JobId.value().c_str() : "NULL") + << ", Latest: " << (latestJobsNotification.JobId.has_value() ? latestJobsNotification.JobId.value().c_str() : "NULL") << std::endl; + + + + + + // Log Job Documents being compared + std::cout << "INFO: Comparing Job Documents - New: " + << (job.JobDocument.has_value() ? job.JobDocument.value().View().WriteCompact().c_str() : "NULL") + << ", Latest: " + << (latestJobsNotification.JobDocument.has_value() ? latestJobsNotification.JobDocument.value().View().WriteCompact().c_str() : "NULL") + << std::endl; + + + + + + // Log Execution Numbers being compared + std::cout << "INFO: Comparing Execution Numbers - New: " + << (job.ExecutionNumber.has_value() ? std::to_string(job.ExecutionNumber.value()) : "NULL") + << ", Latest: " + << (latestJobsNotification.ExecutionNumber.has_value() ? std::to_string(latestJobsNotification.ExecutionNumber.value()) : "NULL") + << std::endl; + + + if (!latestJobsNotification.JobId.has_value()) { // We have not seen a job yet @@ -543,14 +621,19 @@ bool JobsFeature::isDuplicateNotification(JobExecutionData job) return false; } - if (strcmp( - job.JobDocument.value().View().WriteCompact().c_str(), - latestJobsNotification.JobDocument.value().View().WriteCompact().c_str()) != 0) - { + if (!compareJobDocuments( + job.JobDocument.value(), + latestJobsNotification.JobDocument.value())) { LOG_DEBUG(TAG, "Job document differs"); return false; } + std::cout << "INFO: Comparing Job Documents after replacement - New: " + << (job.JobDocument.has_value() ? job.JobDocument.value().View().WriteCompact().c_str() : "NULL") + << ", Latest: " + << (latestJobsNotification.JobDocument.has_value() ? latestJobsNotification.JobDocument.value().View().WriteCompact().c_str() : "NULL") + << std::endl; + if (job.ExecutionNumber.value() != latestJobsNotification.ExecutionNumber.value()) { LOG_DEBUG(TAG, "Execution number differs"); diff --git a/source/jobs/JobsFeature.h b/source/jobs/JobsFeature.h index ba6e93c6..93d9c795 100644 --- a/source/jobs/JobsFeature.h +++ b/source/jobs/JobsFeature.h @@ -15,6 +15,7 @@ #include "IotJobsClientWrapper.h" #include "JobDocument.h" #include "JobEngine.h" +#include namespace Aws { @@ -77,6 +78,9 @@ namespace Aws virtual int stop() override; protected: + + bool compareJobDocuments(const Aws::Crt::JsonObject& job1, const Aws::Crt::JsonObject& job2); + /** * \brief Begins running the Jobs feature */ @@ -313,6 +317,17 @@ namespace Aws */ bool isDuplicateNotification(Iotjobs::JobExecutionData job); + /** + * \brief Compares two job documents, ignoring differences in pre-signed URLs. + * + * @param job1 The first job document as a JsonObject + * @param job2 The second job document as a JsonObject + * @return true if the documents are equivalent (ignoring pre-signed URLs), false otherwise + */ + + // Add this line to declare the test class as a friend + friend class TestJobsFeaturePrivate; + /** * \brief Stores information about a job notification * diff --git a/test/jobs/TestJobsFeature.cpp b/test/jobs/TestJobsFeature.cpp index 38bdc95e..bbc900da 100644 --- a/test/jobs/TestJobsFeature.cpp +++ b/test/jobs/TestJobsFeature.cpp @@ -15,6 +15,7 @@ #include #include #include +#include using namespace std; using namespace testing; @@ -280,6 +281,25 @@ class TestJobsFeature : public ::testing::Test shared_ptr mockEngine; }; +class TestJobsFeaturePrivate : public ::testing::Test, public JobsFeature +{ +protected: + Aws::Crt::ApiHandle apiHandle; + std::unique_ptr jobsFeature; + + void SetUp() override + { + // The ApiHandle constructor initializes the AWS CRT library + jobsFeature.reset(new JobsFeature()); + } + + void TearDown() override + { + jobsFeature.reset(); + // The ApiHandle destructor cleans up the AWS CRT library + } +}; + MATCHER_P(ThingNameEq, ThingName, "Matcher ThingName for all Aws request Objects using Aws::Crt::String") { return arg.ThingName.value() == ThingName; @@ -710,3 +730,39 @@ TEST_F(TestJobsFeature, InvalidJobDocument) jobsMock->init(std::shared_ptr(), notifier, config); jobsMock->invokeRunJobs(); } + + TEST_F(TestJobsFeaturePrivate, CompareJobDocuments) +{ + // Test case 1: Identical documents + Aws::Crt::JsonObject doc1("{\"key\": \"value\"}"); + Aws::Crt::JsonObject doc2("{\"key\": \"value\"}"); + EXPECT_TRUE(compareJobDocuments(doc1, doc2)); + + // Test case 2: Different documents + Aws::Crt::JsonObject doc3("{\"key\": \"different_value\"}"); + EXPECT_FALSE(compareJobDocuments(doc1, doc3)); + + // Test case 3: Documents with pre-signed URLs + Aws::Crt::JsonObject doc4("{\"url\": \"https://bucket.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"); + Aws::Crt::JsonObject doc5("{\"url\": \"https://bucket.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYY\"}"); + EXPECT_TRUE(compareJobDocuments(doc4, doc5)); + + // Test case 4: Documents with multiple pre-signed URLs + Aws::Crt::JsonObject doc6("{\"url1\": \"https://bucket1.s3.amazonaws.com/file1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\", \"url2\": \"https://bucket2.s3.amazonaws.com/file2?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=ZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"}"); + Aws::Crt::JsonObject doc7("{\"url1\": \"https://bucket1.s3.amazonaws.com/file1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYY\", \"url2\": \"https://bucket2.s3.amazonaws.com/file2?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=WWWWWWWWWWWWWWWWWWWWWWWWWWW\"}"); + EXPECT_TRUE(compareJobDocuments(doc6, doc7)); + + // Test case 6: Documents with multiple pre-signed URLs in one doc and single url in the other + Aws::Crt::JsonObject doc8("{\"url1\": \"https://bucket1.s3.amazonaws.com/file1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYY\"}"); + EXPECT_FALSE(compareJobDocuments(doc6, doc8)); + + // Test case 7: Documents with different structure + Aws::Crt::JsonObject doc9("{\"key1\": \"value1\", \"key2\": \"value2\"}"); + Aws::Crt::JsonObject doc10("{\"key1\": \"value1\", \"key3\": \"value3\"}"); + EXPECT_FALSE(compareJobDocuments(doc9, doc10)); + + // Test case 8: Documents with same pre-signed URLs but different buckets + Aws::Crt::JsonObject doc11("{\"url\": \"https://bucket1.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"); + Aws::Crt::JsonObject doc12("{\"url\": \"https://bucket2.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"); + EXPECT_FALSE(compareJobDocuments(doc11, doc12)); +} \ No newline at end of file From 8fad21a871a371661df934923d1239b78827303d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 12 Nov 2024 07:01:37 +0000 Subject: [PATCH 6/6] Remove unit test for the compareJobsDocument and make it private --- source/jobs/JobsFeature.cpp | 43 --------------------------- source/jobs/JobsFeature.h | 9 ++---- test/jobs/TestJobsFeature.cpp | 55 ----------------------------------- 3 files changed, 3 insertions(+), 104 deletions(-) diff --git a/source/jobs/JobsFeature.cpp b/source/jobs/JobsFeature.cpp index a9a4b063..82748919 100644 --- a/source/jobs/JobsFeature.cpp +++ b/source/jobs/JobsFeature.cpp @@ -565,48 +565,11 @@ bool JobsFeature::compareJobDocuments(const Aws::Crt::JsonObject& job1, const Aw if (count1 != count2) { return false; } - - std::cout << "Processed str1: " << str1 << std::endl; - std::cout << "Processed str2: " << str2 << std::endl; - return str1 == str2; } bool JobsFeature::isDuplicateNotification(JobExecutionData job) { unique_lock readLatestNotificationLock(latestJobsNotificationLock); - - // Basic logging at the start of the function - std::cout << "DEBUG: Entering isDuplicateNotification function" << std::endl; - - - - // Log Job IDs being compared - std::cout << "INFO: Comparing Job IDs - New: " << (job.JobId.has_value() ? job.JobId.value().c_str() : "NULL") - << ", Latest: " << (latestJobsNotification.JobId.has_value() ? latestJobsNotification.JobId.value().c_str() : "NULL") << std::endl; - - - - - - // Log Job Documents being compared - std::cout << "INFO: Comparing Job Documents - New: " - << (job.JobDocument.has_value() ? job.JobDocument.value().View().WriteCompact().c_str() : "NULL") - << ", Latest: " - << (latestJobsNotification.JobDocument.has_value() ? latestJobsNotification.JobDocument.value().View().WriteCompact().c_str() : "NULL") - << std::endl; - - - - - - // Log Execution Numbers being compared - std::cout << "INFO: Comparing Execution Numbers - New: " - << (job.ExecutionNumber.has_value() ? std::to_string(job.ExecutionNumber.value()) : "NULL") - << ", Latest: " - << (latestJobsNotification.ExecutionNumber.has_value() ? std::to_string(latestJobsNotification.ExecutionNumber.value()) : "NULL") - << std::endl; - - if (!latestJobsNotification.JobId.has_value()) { @@ -628,12 +591,6 @@ bool JobsFeature::isDuplicateNotification(JobExecutionData job) return false; } - std::cout << "INFO: Comparing Job Documents after replacement - New: " - << (job.JobDocument.has_value() ? job.JobDocument.value().View().WriteCompact().c_str() : "NULL") - << ", Latest: " - << (latestJobsNotification.JobDocument.has_value() ? latestJobsNotification.JobDocument.value().View().WriteCompact().c_str() : "NULL") - << std::endl; - if (job.ExecutionNumber.value() != latestJobsNotification.ExecutionNumber.value()) { LOG_DEBUG(TAG, "Execution number differs"); diff --git a/source/jobs/JobsFeature.h b/source/jobs/JobsFeature.h index 93d9c795..91f44868 100644 --- a/source/jobs/JobsFeature.h +++ b/source/jobs/JobsFeature.h @@ -78,9 +78,6 @@ namespace Aws virtual int stop() override; protected: - - bool compareJobDocuments(const Aws::Crt::JsonObject& job1, const Aws::Crt::JsonObject& job2); - /** * \brief Begins running the Jobs feature */ @@ -324,9 +321,9 @@ namespace Aws * @param job2 The second job document as a JsonObject * @return true if the documents are equivalent (ignoring pre-signed URLs), false otherwise */ - - // Add this line to declare the test class as a friend - friend class TestJobsFeaturePrivate; + + bool compareJobDocuments(const Aws::Crt::JsonObject& job1, const Aws::Crt::JsonObject& job2); + /** * \brief Stores information about a job notification diff --git a/test/jobs/TestJobsFeature.cpp b/test/jobs/TestJobsFeature.cpp index bbc900da..d3b859bc 100644 --- a/test/jobs/TestJobsFeature.cpp +++ b/test/jobs/TestJobsFeature.cpp @@ -281,25 +281,6 @@ class TestJobsFeature : public ::testing::Test shared_ptr mockEngine; }; -class TestJobsFeaturePrivate : public ::testing::Test, public JobsFeature -{ -protected: - Aws::Crt::ApiHandle apiHandle; - std::unique_ptr jobsFeature; - - void SetUp() override - { - // The ApiHandle constructor initializes the AWS CRT library - jobsFeature.reset(new JobsFeature()); - } - - void TearDown() override - { - jobsFeature.reset(); - // The ApiHandle destructor cleans up the AWS CRT library - } -}; - MATCHER_P(ThingNameEq, ThingName, "Matcher ThingName for all Aws request Objects using Aws::Crt::String") { return arg.ThingName.value() == ThingName; @@ -729,40 +710,4 @@ TEST_F(TestJobsFeature, InvalidJobDocument) jobsMock->init(std::shared_ptr(), notifier, config); jobsMock->invokeRunJobs(); -} - - TEST_F(TestJobsFeaturePrivate, CompareJobDocuments) -{ - // Test case 1: Identical documents - Aws::Crt::JsonObject doc1("{\"key\": \"value\"}"); - Aws::Crt::JsonObject doc2("{\"key\": \"value\"}"); - EXPECT_TRUE(compareJobDocuments(doc1, doc2)); - - // Test case 2: Different documents - Aws::Crt::JsonObject doc3("{\"key\": \"different_value\"}"); - EXPECT_FALSE(compareJobDocuments(doc1, doc3)); - - // Test case 3: Documents with pre-signed URLs - Aws::Crt::JsonObject doc4("{\"url\": \"https://bucket.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"); - Aws::Crt::JsonObject doc5("{\"url\": \"https://bucket.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYY\"}"); - EXPECT_TRUE(compareJobDocuments(doc4, doc5)); - - // Test case 4: Documents with multiple pre-signed URLs - Aws::Crt::JsonObject doc6("{\"url1\": \"https://bucket1.s3.amazonaws.com/file1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\", \"url2\": \"https://bucket2.s3.amazonaws.com/file2?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=ZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"}"); - Aws::Crt::JsonObject doc7("{\"url1\": \"https://bucket1.s3.amazonaws.com/file1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYY\", \"url2\": \"https://bucket2.s3.amazonaws.com/file2?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=WWWWWWWWWWWWWWWWWWWWWWWWWWW\"}"); - EXPECT_TRUE(compareJobDocuments(doc6, doc7)); - - // Test case 6: Documents with multiple pre-signed URLs in one doc and single url in the other - Aws::Crt::JsonObject doc8("{\"url1\": \"https://bucket1.s3.amazonaws.com/file1?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=9876543210&Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYY\"}"); - EXPECT_FALSE(compareJobDocuments(doc6, doc8)); - - // Test case 7: Documents with different structure - Aws::Crt::JsonObject doc9("{\"key1\": \"value1\", \"key2\": \"value2\"}"); - Aws::Crt::JsonObject doc10("{\"key1\": \"value1\", \"key3\": \"value3\"}"); - EXPECT_FALSE(compareJobDocuments(doc9, doc10)); - - // Test case 8: Documents with same pre-signed URLs but different buckets - Aws::Crt::JsonObject doc11("{\"url\": \"https://bucket1.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"); - Aws::Crt::JsonObject doc12("{\"url\": \"https://bucket2.s3.amazonaws.com/file?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1234567890&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX\"}"); - EXPECT_FALSE(compareJobDocuments(doc11, doc12)); } \ No newline at end of file