From 0f9abb6530a488fa639d5bdfe6fd428a6a7e3fa2 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Thu, 24 Aug 2023 15:17:17 -0700 Subject: [PATCH 01/10] Use new version of CI-CD Actions --- .github/.cSpellWords.txt | 8 ++++ .github/workflows/ci.yml | 99 ++++++++++++++++++++++++++-------------- cspell.config.yaml | 22 +++++++++ 3 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 .github/.cSpellWords.txt create mode 100644 cspell.config.yaml diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt new file mode 100644 index 00000000..158bf07f --- /dev/null +++ b/.github/.cSpellWords.txt @@ -0,0 +1,8 @@ +CMOCK +CMock +Cmock +Coverity +MISRA +Misra +coverity +misra diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f703fef8..2594f362 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone This Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Build in Release Mode run: | cmake -S test -B build/ \ @@ -20,11 +21,13 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS='-Wall -Wextra -Werror' make -C build/ all + unittest: runs-on: ubuntu-latest steps: - name: Clone This Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Build run: | sudo apt-get install -y lcov @@ -34,26 +37,31 @@ jobs: -DBUILD_UNIT_TESTS=ON \ -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG -DLOGGING_LEVEL_DEBUG=1' make -C build/ all + - name: Test run: | cd build/ ctest -E system --output-on-failure cd .. + - name: Run Coverage run: | make -C build/ coverage declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*") echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info lcov --rc lcov_branch_coverage=1 --list build/coverage.info + - name: Check Coverage - uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main + uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@v2 with: - path: ./build/coverage.info + coverage-file: ./build/coverage.info + build-with-default-config: runs-on: ubuntu-latest steps: - name: Clone This Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Build run: | cmake -S test -B build/ \ @@ -61,94 +69,117 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS='-Wall -Wextra -Werror -DSIGV4_DO_NOT_USE_CUSTOM_CONFIG' make -C build/ all + complexity: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Check complexity - uses: FreeRTOS/CI-CD-Github-Actions/complexity@main + uses: FreeRTOS/CI-CD-Github-Actions/complexity@v2 with: path: ./ + doxygen: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Run doxygen build - uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main + uses: FreeRTOS/CI-CD-Github-Actions/doxygen@v2 with: path: ./ + spell-check: runs-on: ubuntu-latest steps: + - name: Clone This Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Run spellings check - uses: FreeRTOS/CI-CD-Github-Actions/spellings@main + uses: FreeRTOS/CI-CD-GitHub-Actions/rust-spell-check@v2 with: path: ./ + formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Check formatting - uses: FreeRTOS/CI-CD-Github-Actions/formatting@main + uses: FreeRTOS/CI-CD-Github-Actions/formatting@v2 with: path: ./ + git-secrets: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Checkout awslabs/git-secrets - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: awslabs/git-secrets ref: master path: git-secrets + - name: Install git-secrets run: cd git-secrets && sudo make install && cd .. + - name: Run git-secrets run: | git-secrets --register-aws git-secrets --scan + memory_statistics: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: - submodules: 'recursive' + submodules: "recursive" + - name: Install Python3 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.11.0' + python-version: "3.11.0" + - name: Measure sizes - uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main + uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@v2 with: - config: .github/memory_statistics_config.json - check_against: docs/doxygen/include/size_table.md + config: .github/memory_statistics_config.json + check_against: docs/doxygen/include/size_table.md + link-verifier: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Setup Python for link verifier action - uses: actions/setup-python@v2 - with: - python-version: '3.7.10' + - uses: actions/checkout@v3 - name: Check Links env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: FreeRTOS/CI-CD-GitHub-Actions/link-verifier@main + uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@v2 + + verify-manifest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Run manifest verifier + uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@v2 with: path: ./ - exclude-dirs: cmock,unity,cbmc - include-file-types: .c,.h,.dox - allowlist-file: ./.github/links_allowlist.txt + fail-on-incorrect-version: true + proof_ci: + if: ${{ github.event.pull_request }} runs-on: cbmc_ubuntu-latest_32-core steps: - name: Set up CBMC runner uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main + - name: Run CBMC uses: FreeRTOS/CI-CD-Github-Actions/run_cbmc@main with: diff --git a/cspell.config.yaml b/cspell.config.yaml new file mode 100644 index 00000000..e7d8a56f --- /dev/null +++ b/cspell.config.yaml @@ -0,0 +1,22 @@ +--- +$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json +version: '0.2' +# Allows things like stringLength +allowCompoundWords: true +useGitignore: true +# Could split this up? And do a dictionary for each repo? +# But feel like if this isn't super slow +# That having just one single dictionary might be nicer? +dictionaryDefinitions: + - name: freertos-words + path: '.github/.cSpellWords.txt' + addWords: true +dictionaries: + - freertos-words +ignorePaths: + - 'node_modules' + - '.cSpellWords.txt' + - 'dependency' + - 'docs' + - 'ThirdParty' + From e5a1960bfab1cbd020e4dee436b2e73c92c4548d Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Fri, 25 Aug 2023 03:54:22 -0700 Subject: [PATCH 02/10] Use cSpell spell check, and use ubuntu-20.04 for formatting check --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2594f362..c938d422 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,12 +98,12 @@ jobs: uses: actions/checkout@v3 - name: Run spellings check - uses: FreeRTOS/CI-CD-GitHub-Actions/rust-spell-check@v2 + uses: FreeRTOS/CI-CD-GitHub-Actions/spellings@v2 with: path: ./ formatting: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 From 0ff6cf69fda0c063f1da9044c5814b606f5199cf Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Fri, 25 Aug 2023 08:22:58 -0700 Subject: [PATCH 03/10] Fix incorrect spellings, add needed words to the word list --- .github/.cSpellWords.txt | 61 ++++ README.md | 4 +- lexicon.txt | 267 ------------------ .../SigV4_AwsIotDateToIso8601/README.md | 2 +- .../SigV4_GenerateHTTPAuthorization/README.md | 2 +- 5 files changed, 65 insertions(+), 271 deletions(-) delete mode 100644 lexicon.txt diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt index 158bf07f..b6dca4f0 100644 --- a/.github/.cSpellWords.txt +++ b/.github/.cSpellWords.txt @@ -1,8 +1,69 @@ +:72:6AKIAIOSFODNN +AKIAIOSFODNN +Aizca +Ayjrf +Bgza +CBMC +CBOR CMOCK CMock Cmock +Cnpb +Cnpbfi Coverity +Cuiz +DCMOCK +DDISABLE +DNDEBUG +DUNITY +EKHX +Ecjuve +GGHU +HMDL +Hpxdr +Kcdef +Kced +Lkec MISRA +MQTT Misra +NGYY +Ndzbbpmap +OPAD +Pjiyp +Pnpyim +Qvpwa +Qwxh +Rajbw +SIGV +Sutzy +Thwgv +Uijcfxv +Vajgc +Vwng +Wunused +XLFAUQG +YYYYMMDD'T'HHMMSS'Z' +Zapv +cbmc +cbor +chjdsvchjdvhjcdhjsckhdsvchdks +cmock coverity +ctest +gjfhjxgxghsgfdwfdfdfdffhfdhdhfhdfhd +lcov misra +mlkzxncvlknlkanlkqwlerknlasdflkzxcnvklnlksqwerasdfklqwenrklnfsad +opad +pasdfghwsshasdfghjk +reall +sdgfdfgdshfgsjdhfdhfkhdkfhjdgfgdfgdfg +sdvfdvfhdvfhvdhfvdsfdsgfgdsjfgjdsfqwertyuio +sfdghfdfahgsdhfgjsgfjkgfsdgkdgfdjkgdggdjfsjkgjksgkj +sigv +sinclude +utest +wnqj +xchjsd +ymxchykldfghiwbdcjhjdddkkgddsdhshdkshdhsskgfkjgfggc diff --git a/README.md b/README.md index 3737dd9c..9e0f40bb 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ a compile time preprocessor macro. **OR** * Defining the `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` preprocessor macro - for the library build. - + for the library build. + ## Building the SigV4 Library The [sigv4FilePaths.cmake](sigv4FilePaths.cmake) file contains information of all the source files and header include paths required to build the SigV4 library. diff --git a/lexicon.txt b/lexicon.txt deleted file mode 100644 index 55d8e62e..00000000 --- a/lexicon.txt +++ /dev/null @@ -1,267 +0,0 @@ -accesskeyid -accesskeyidlen -addtodate -addtogroup -aggregator -algorithmlen -amz -ansi -api -apr -ascii -auth -authbuflen -authorizaton -aws -br -bufferlen -bufremaining -bytesconsumed -canonicalrequest -canonicalurilen -cbmc -chunked -com -completehashandhexencode -config -configpagestyle -const -constness -copydoc -copyheaderstringtocanonicalbuffer -coverity -credentialscope -crypto -cryptointerface -css -ctype -currentparameter -datalen -datatracker -datelen -dd -deconstructed -defgroup -doesn -doubleencodeequals -doxygen -encodeslash -encodetwice -endcode -endif -enums -expirationlen -failable -feb -formatchar -formatlen -gcc -generatecanonicaluri -github -gmt -gr -hashblocklen -hashcontext -hashdigestlen -hashedcanonicalrequest -hashfinal -hashinit -hashpayloadlen -hashtofail -hashupdate -headercount -headerindex -headerlen -headersdatalen -headerslen -hexencoded -hexstring -hh -hhmmss -hmac -hmacaddkey -hmacdata -hmacfinal -hmacintermediate -hmackey -html -http -httpmethodlen -https -ietf -ifdef -ifndef -inc -ingroup -inputchar -inputlen -iot -ipad -iskeyprefix -iso -isspace -itemsize -jan -january -keylen -ksecret -leninput -lentoread -lf -linelen -linux -logdebug -logerror -loginfo -logwarn -longregionlen -lv -maclen -mainpage -md -memcpy -memmove -min -misra -mit -mmm -mon -monthsperday -noninfringement -nullterminate -numitems -oom -opad -openssl -ored -org -outputlen -paccesskeyid -palgorithm -param -parray -pathlen -pauthbuf -pauthprefixlen -payloadlen -pbufcur -pbuffer -pbufloc -pbufprocessing -pbufstart -pbytesremaining -pcanonicalcontext -pcanonicalrequest -pcanonicaluri -pcredentials -pcredscope -pcryptointerface -pdata -pdate -pdateelements -pexpiration -pfirstitem -pfirstval -pformat -phashcontext -phashpayloadloc -pheaders -pheadersloc -phexoutput -phmaccontext -phttpmethod -phttpparameters -pinput -pinputstr -pkey -pline -pmac -png -posix -poutput -poutputexpected -poutputleapexpected -poutputlen -pparams -ppath -ppayload -pquery -pqueryloc -pre -precanonical -precanonicalized -pregion -pregion -printf -pseconditem -psecondval -psecretaccesskey -psecuritytoken -pservice -psignature -psignedheaders -psignedheaderslen -psigningkey -ptestformatfailure -puri -pvalue -querylen -quicksort -rande -readloc -regionlen -requestdatetime -rfc -sdk -sec -secretaccesskey -secretaccesskeylen -secretkey -securitytoken -securitytokenlen -sep -servicelen -sha -signaturelen -signedheaders -signedheaderslen -signingkey -sizeneededforcredentialscope -sizeof -snprintf -spdx -ss -sscanf -standalone -strftime -stringtosign -strlen -struct -structs -sts -subarray -subfolder -sublicense -thu -tm -todo -trimmable -trimmedlen -trimmedlength -trimmedlength -tue -txt -un -uri -urilen -url -utc -vallen -valuelen -writecanonicalqueryparameters -writelinetocanonicalrequest -xor -xoring -xy -yyyy -yyyymmdd diff --git a/test/cbmc/proofs/SigV4_AwsIotDateToIso8601/README.md b/test/cbmc/proofs/SigV4_AwsIotDateToIso8601/README.md index eb5d7fd0..b4171fc3 100644 --- a/test/cbmc/proofs/SigV4_AwsIotDateToIso8601/README.md +++ b/test/cbmc/proofs/SigV4_AwsIotDateToIso8601/README.md @@ -11,7 +11,7 @@ To run the proof. * Run `make`. * Open html/index.html in a web browser. -To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles. +To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles. ------------- * Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof. diff --git a/test/cbmc/proofs/SigV4_GenerateHTTPAuthorization/README.md b/test/cbmc/proofs/SigV4_GenerateHTTPAuthorization/README.md index d3f4325c..ecf9b1c4 100644 --- a/test/cbmc/proofs/SigV4_GenerateHTTPAuthorization/README.md +++ b/test/cbmc/proofs/SigV4_GenerateHTTPAuthorization/README.md @@ -11,7 +11,7 @@ To run the proof. * Run `make`. * Open html/index.html in a web browser. -To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles. +To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles. ------------- * Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof. From af85254d7a88dc0fdd07f4510422429359eb3f5c Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Wed, 30 Aug 2023 15:29:06 -0700 Subject: [PATCH 04/10] Use the new version of the cspell.config.yaml --- .github/.cSpellWords.txt | 1 - cspell.config.yaml | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt index b6dca4f0..de018d66 100644 --- a/.github/.cSpellWords.txt +++ b/.github/.cSpellWords.txt @@ -1,4 +1,3 @@ -:72:6AKIAIOSFODNN AKIAIOSFODNN Aizca Ayjrf diff --git a/cspell.config.yaml b/cspell.config.yaml index e7d8a56f..331f137e 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -4,6 +4,12 @@ version: '0.2' # Allows things like stringLength allowCompoundWords: true useGitignore: true +languageSettings: + - allowCompoundWords: true + caseSensitive: false + enabled: true + languageId: c + locale: "*" # Could split this up? And do a dictionary for each repo? # But feel like if this isn't super slow # That having just one single dictionary might be nicer? @@ -14,9 +20,8 @@ dictionaryDefinitions: dictionaries: - freertos-words ignorePaths: - - 'node_modules' - '.cSpellWords.txt' - 'dependency' - 'docs' - 'ThirdParty' - + - 'History.txt' From 2f5e4a22c140992b7b2c78d30eb1927f4dd54140 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Thu, 31 Aug 2023 14:19:23 -0700 Subject: [PATCH 05/10] Update the cspell config file to clean it up a bit --- cspell.config.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cspell.config.yaml b/cspell.config.yaml index 331f137e..911ce1d8 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -3,24 +3,28 @@ $schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell version: '0.2' # Allows things like stringLength allowCompoundWords: true + +# Read files not to spell check from the git ignore useGitignore: true + +# Language settings for C languageSettings: - - allowCompoundWords: true - caseSensitive: false + - caseSensitive: false enabled: true languageId: c locale: "*" -# Could split this up? And do a dictionary for each repo? -# But feel like if this isn't super slow -# That having just one single dictionary might be nicer? + +# Add a dictionary, and the path to the word list dictionaryDefinitions: - name: freertos-words path: '.github/.cSpellWords.txt' addWords: true + dictionaries: - freertos-words + +# Paths and files to ignore ignorePaths: - - '.cSpellWords.txt' - 'dependency' - 'docs' - 'ThirdParty' From 1b56bc9cf21304701c4e579a0d88e22b65a8a997 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Fri, 1 Sep 2023 09:31:48 -0700 Subject: [PATCH 06/10] Use merged version of some actions --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c938d422..81deec3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: lcov --rc lcov_branch_coverage=1 --list build/coverage.info - name: Check Coverage - uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@v2 + uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main with: coverage-file: ./build/coverage.info @@ -76,7 +76,7 @@ jobs: - uses: actions/checkout@v3 - name: Check complexity - uses: FreeRTOS/CI-CD-Github-Actions/complexity@v2 + uses: FreeRTOS/CI-CD-Github-Actions/complexity@main with: path: ./ @@ -168,7 +168,7 @@ jobs: fetch-depth: 0 - name: Run manifest verifier - uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@v2 + uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main with: path: ./ fail-on-incorrect-version: true From faf243da6d736ebde8e3914aa3ed670b4800a445 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Fri, 1 Sep 2023 18:22:11 -0700 Subject: [PATCH 07/10] Use merged mainline version of formatting --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81deec3e..091b7509 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: - uses: actions/checkout@v3 - name: Check formatting - uses: FreeRTOS/CI-CD-Github-Actions/formatting@v2 + uses: FreeRTOS/CI-CD-Github-Actions/formatting@main with: path: ./ From 18d7f03b8326d15aeb27fa709d2f4946c8fa3645 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Sat, 2 Sep 2023 16:09:32 -0700 Subject: [PATCH 08/10] Update the README file --- README.md | 95 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 9e0f40bb..5bb1e192 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,91 @@ # AWS SigV4 Library -The AWS SigV4 Library is a standalone library for generating authorization headers and signatures according to the specifications of the [Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) signing process. Authorization headers are required for authentication when sending HTTP requests to AWS. This library can optionally be used by applications sending direct HTTP requests to AWS services requiring SigV4 authentication. This library has no dependencies on any additional libraries other than the standard C library. This library is distributed under the MIT Open Source License. - -This library has gone through code quality checks including verification that no function has a GNU Complexity score over 8, and checks against deviations from mandatory rules in the MISRA coding standard. Deviations from the MISRA C:2012 guidelines are documented under MISRA Deviations. This library has also undergone static code analysis using Coverity static analysis, and validation of memory safety through the CBMC automated reasoning tool. +**[API Documentation Pages for current and previous releases of this library can be found here](https://aws.github.io/SigV4-for-AWS-IoT-embedded-sdk/)** + +The AWS SigV4 Library is a standalone library for generating authorization +headers and signatures according to the specifications of the +[Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) +signing process. Authorization headers are required for authentication when +sending HTTP requests to AWS. This library can optionally be used by +applications sending direct HTTP requests to AWS services requiring SigV4 +authentication. This library has no dependencies on any additional libraries +other than the standard C library. This library is distributed under the MIT +Open Source License. + +This library has gone through code quality checks including verification that no +function has a GNU Complexity score over 8, and checks against deviations from +mandatory rules in the MISRA coding standard. Deviations from the MISRA C:2012 +guidelines are documented under MISRA Deviations. This library has also +undergone static code analysis using Coverity static analysis, and validation of +memory safety through the CBMC automated reasoning tool. See memory requirements for this library [here][memory_table]. [memory_table]: ./docs/doxygen/include/size_table.md -**AWS SigV4 v1.2.0 [source code](https://github.com/aws/Sigv4-for-AWS-IoT-embedded-sdk/tree/v1.2.0/source) is part of the [FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) release.** +**AWS SigV4 v1.2.0 +[source code](https://github.com/aws/Sigv4-for-AWS-IoT-embedded-sdk/tree/v1.2.0/source) +is part of the +[FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) +release.** ## AWS SigV4 Library Config File -The AWS SigV4 library exposes build configuration -macros that are required for building the library. A list of all the -configurations and their default values are defined in -[sigv4_config_defaults.h][default_config]. To provide custom values for the -configuration macros, a config file named `sigv4_config.h` can be + +The AWS SigV4 library exposes build configuration macros that are required for +building the library. A list of all the configurations and their default values +are defined in [sigv4_config_defaults.h][default_config]. To provide custom +values for the configuration macros, a config file named `sigv4_config.h` can be provided by the application to the library. [default_config]: source/include/sigv4_config_defaults.h -By default, a `sigv4_config.h` config file is required to build -the library. To disable this requirement and build the library with default -configuration values, provide `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` as -a compile time preprocessor macro. +By default, a `sigv4_config.h` config file is required to build the library. To +disable this requirement and build the library with default configuration +values, provide `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` as a compile time preprocessor +macro. **Thus, the SigV4 library can be built by either**: -* Defining a `sigv4_config.h` file in the application, and adding - it to the include directories list of the library. +- Defining a `sigv4_config.h` file in the application, and adding it to the + include directories list of the library. **OR** -* Defining the `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` preprocessor macro - for the library build. +- Defining the `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` preprocessor macro for the + library build. ## Building the SigV4 Library -The [sigv4FilePaths.cmake](sigv4FilePaths.cmake) file contains information of all the source files and header include paths required to build the SigV4 library. +The [sigv4FilePaths.cmake](sigv4FilePaths.cmake) file contains information of +all the source files and header include paths required to build the SigV4 +library. As mentioned in the previous section, either a custom config file (i.e. -`sigv4_config.h`) or `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` -macro needs to be provided to build the SigV4 library. +`sigv4_config.h`) or `SIGV4_DO_NOT_USE_CUSTOM_CONFIG` macro needs to be provided +to build the SigV4 library. -To use CMake, please refer to the [sigV4FilePaths.cmake](https://github.com/aws/SigV4-for-AWS-IoT-embedded-sdk/blob/main/sigv4FilePaths.cmake) file, which contains the relevant information regarding source files and header include paths required to build this library. +To use CMake, please refer to the +[sigV4FilePaths.cmake](https://github.com/aws/SigV4-for-AWS-IoT-embedded-sdk/blob/main/sigv4FilePaths.cmake) +file, which contains the relevant information regarding source files and header +include paths required to build this library. ## Building Unit Tests ### Platform Prerequisites - For running unit tests: - - **C90 compiler** like gcc. - - **CMake 3.13.0 or later**. - - **Ruby 2.0.0 or later** is additionally required for the CMock test framework (that we use). -- For running the coverage target, **gcov** and **lcov** are additionally required. + - **C90 compiler** like gcc. + - **CMake 3.13.0 or later**. + - **Ruby 2.0.0 or later** is additionally required for the CMock test + framework (that we use). +- For running the coverage target, **gcov** and **lcov** are additionally + required. ### Steps to build **Unit Tests** 1. Go to the root directory of this repository. -1. Run the *cmake* command: `cmake -S test -B build -DBUILD_UNIT_TESTS=ON`. +1. Run the _cmake_ command: `cmake -S test -B build -DBUILD_UNIT_TESTS=ON`. 1. Run this command to build the library and unit tests: `make -C build all`. @@ -69,25 +95,32 @@ To use CMake, please refer to the [sigV4FilePaths.cmake](https://github.com/aws/ ## CBMC -To learn more about CBMC and proofs specifically, review the training material [here](https://model-checking.github.io/cbmc-training). +To learn more about CBMC and proofs specifically, review the training material +[here](https://model-checking.github.io/cbmc-training). The `test/cbmc/proofs` directory contains CBMC proofs. -In order to run these proofs you will need to install CBMC and other tools by following the instructions [here](https://model-checking.github.io/cbmc-training/installation.html). +In order to run these proofs you will need to install CBMC and other tools by +following the instructions +[here](https://model-checking.github.io/cbmc-training/installation.html). ## Reference examples -The AWS IoT Embedded C-SDK repository contains [HTTP demos](https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/http) showing the use of the AWS SigV4 Library on a POSIX platform to authenticate HTTP requests to AWS S3 service. +The AWS IoT Embedded C-SDK repository contains +[HTTP demos](https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/http) +showing the use of the AWS SigV4 Library on a POSIX platform to authenticate +HTTP requests to AWS S3 service. ## Generating documentation The Doxygen references found in this repository were created using Doxygen -version 1.9.2. To generate these Doxygen pages, please run the following -command from the root of this repository: +version 1.9.2. To generate these Doxygen pages, please run the following command +from the root of this repository: ```shell doxygen docs/doxygen/config.doxyfile ``` + ## Contributing See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for information on contributing. From 7761ce7099bd5c0918e802efcfd595f051548ad5 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Tue, 5 Sep 2023 10:26:26 -0700 Subject: [PATCH 09/10] Add in bot formatting action --- .github/workflows/formatting.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/formatting.yml diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 00000000..f7141e74 --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,23 @@ +name: Format Pull Request Files + +on: + issue_comment: + types: [created] + +env: + bashPass: \033[32;1mPASSED - + bashInfo: \033[33;1mINFO - + bashFail: \033[31;1mFAILED - + bashEnd: \033[0m + +jobs: + Formatting: + name: Run Formatting Check + if: ${{ github.event.issue.pull_request }} && + ( ( github.event.comment.body == '/bot run uncrustify' ) || + ( github.event.comment.body == '/bot run formatting' ) ) + runs-on: ubuntu-20.04 + steps: + - name: Apply Formatting Fix + uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@v2 + id: check-formatting From 68c91a3b499ce4c191ee829c66c68d0de28ceffd Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Tue, 5 Sep 2023 13:55:41 -0700 Subject: [PATCH 10/10] Update to use merged mainline actions, use checkout@v3 instead of checkout@v2 on all jobs --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/formatting.yml | 2 +- .github/workflows/release.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 091b7509..2cb2bf64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: - uses: actions/checkout@v3 - name: Run doxygen build - uses: FreeRTOS/CI-CD-Github-Actions/doxygen@v2 + uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main with: path: ./ @@ -98,7 +98,7 @@ jobs: uses: actions/checkout@v3 - name: Run spellings check - uses: FreeRTOS/CI-CD-GitHub-Actions/spellings@v2 + uses: FreeRTOS/CI-CD-Github-Actions/spellings@main with: path: ./ @@ -145,7 +145,7 @@ jobs: python-version: "3.11.0" - name: Measure sizes - uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@v2 + uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main with: config: .github/memory_statistics_config.json check_against: docs/doxygen/include/size_table.md @@ -157,7 +157,7 @@ jobs: - name: Check Links env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@v2 + uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main verify-manifest: runs-on: ubuntu-latest diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index f7141e74..8257adda 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -19,5 +19,5 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Apply Formatting Fix - uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@v2 + uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main id: check-formatting diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9999db9c..97fa882f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.commit_id }} - name: Configure git identity @@ -53,7 +53,7 @@ jobs: - name: Install ZIP tools run: sudo apt-get install zip unzip - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.commit_id }} path: SigV4-for-AWS-IoT-embedded-sdk