From 3208da23f72a9dda96b639e5738b875c7e92d961 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 28 Dec 2023 23:11:27 -0500 Subject: [PATCH 01/60] upload tar.gz for new releases --- .github/workflows/{nuget.yml => release.yml} | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) rename .github/workflows/{nuget.yml => release.yml} (60%) diff --git a/.github/workflows/nuget.yml b/.github/workflows/release.yml similarity index 60% rename from .github/workflows/nuget.yml rename to .github/workflows/release.yml index 03d57762c..16f380fba 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Nuget CD +name: Release CD on: # Allows you to run this workflow manually from the Actions tab @@ -8,10 +8,10 @@ on: types: [published] jobs: - build: + nuget: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup NuGet uses: NuGet/setup-nuget@v1 with: @@ -24,4 +24,18 @@ jobs: - name: Publish NuGet pkg working-directory: ./nuget run: nuget push *.nupkg -Source 'https://api.nuget.org/v3/index.json' + + release-asset: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # steps for building assets + - run: tar -czf jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . + + + - uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: assets.txt From 7bc6f0b3124aff514eaf2fca5eabde156ba859a5 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 3 Jan 2024 14:02:23 -0500 Subject: [PATCH 02/60] revert name to manually trigger it --- .github/workflows/{release.yml => nuget.yml} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename .github/workflows/{release.yml => nuget.yml} (97%) diff --git a/.github/workflows/release.yml b/.github/workflows/nuget.yml similarity index 97% rename from .github/workflows/release.yml rename to .github/workflows/nuget.yml index 16f380fba..23701ede8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/nuget.yml @@ -1,4 +1,4 @@ -name: Release CD +name: Nuget CD on: # Allows you to run this workflow manually from the Actions tab @@ -9,6 +9,7 @@ on: jobs: nuget: + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 42c3206db21f1c56bfe89e8c32bd400bc26da4cc Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 3 Jan 2024 14:07:20 -0500 Subject: [PATCH 03/60] write to separate path --- .github/workflows/nuget.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 23701ede8..9f0d164a6 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -32,11 +32,10 @@ jobs: - uses: actions/checkout@v4 # steps for building assets - - run: tar -czf jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . - + - run: tar -czf /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} - asset_path: assets.txt + asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz From 5400dfbe2dd85de253718fd6b37645ccccca84db Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 3 Jan 2024 14:12:21 -0500 Subject: [PATCH 04/60] Update and rename nuget.yml to release.yml --- .github/workflows/{nuget.yml => release.yml} | 1 - 1 file changed, 1 deletion(-) rename .github/workflows/{nuget.yml => release.yml} (98%) diff --git a/.github/workflows/nuget.yml b/.github/workflows/release.yml similarity index 98% rename from .github/workflows/nuget.yml rename to .github/workflows/release.yml index 9f0d164a6..94448e484 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,6 @@ on: jobs: nuget: - if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From fdebd7dd8e83d0228257579652fcaa77cc96e2ba Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Wed, 3 Jan 2024 17:05:10 -0500 Subject: [PATCH 05/60] bump tested ssl libraries --- .github/actions/install/libressl/action.yml | 2 +- .github/actions/install/openssl/action.yml | 2 +- .github/actions/install/wolfssl/action.yml | 2 +- .github/workflows/jwt.yml | 4 ++-- .github/workflows/ssl.yml | 15 +++++++------ README.md | 24 ++++++++++----------- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/actions/install/libressl/action.yml b/.github/actions/install/libressl/action.yml index 709ad7010..7bd5679c6 100644 --- a/.github/actions/install/libressl/action.yml +++ b/.github/actions/install/libressl/action.yml @@ -4,7 +4,7 @@ inputs: version: description: The desired LibreSSL version to install required: false - default: "3.3.0" + default: "3.5.4" runs: using: composite steps: diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 83c03a29e..1f94304f4 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -4,7 +4,7 @@ inputs: version: description: The desired OpenSSL version to install required: false - default: "openssl-3.0.0" + default: "openssl-3.2.0" runs: using: composite steps: diff --git a/.github/actions/install/wolfssl/action.yml b/.github/actions/install/wolfssl/action.yml index bced14743..dc9237016 100644 --- a/.github/actions/install/wolfssl/action.yml +++ b/.github/actions/install/wolfssl/action.yml @@ -4,7 +4,7 @@ inputs: version: description: The desired stable wolfSSL version to install required: false - default: "v4.8.1-stable" + default: "v5.6.6-stable" runs: using: composite steps: diff --git a/.github/workflows/jwt.yml b/.github/workflows/jwt.yml index 07d2d69e1..718d3bfa4 100644 --- a/.github/workflows/jwt.yml +++ b/.github/workflows/jwt.yml @@ -59,8 +59,8 @@ jobs: fail-fast: false matrix: openssl: - - { tag: "openssl-3.0.5", name: "3.0.5" } - - { tag: "OpenSSL_1_1_1q", name: "1.1.1q" } + - { tag: "openssl-3.2.0", name: "3.2.0" } + - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } steps: - uses: actions/checkout@v3 - uses: lukka/get-cmake@latest diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index fd9115d0c..4f33658b4 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -12,8 +12,9 @@ jobs: strategy: matrix: openssl: - - { tag: "openssl-3.0.5", name: "3.0.5" } - - { tag: "OpenSSL_1_1_1q", name: "1.1.1q" } + - { tag: "openssl-3.2.0", name: "3.2.0" } + - { tag: "openssl-3.1.4", name: "3.1.4" } + - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } @@ -47,7 +48,7 @@ jobs: - uses: ./.github/actions/install/gtest - uses: ./.github/actions/install/openssl with: - version: "openssl-3.0.5" + version: "openssl-3.2.0" - name: configure run: cmake . -DJWT_BUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" @@ -58,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - libressl: ["3.5.3", "3.4.3", "3.3.6"] + libressl: ["3.8.2", "3.7.2", "3.6.2"] name: LibreSSL ${{ matrix.libressl }} steps: - uses: actions/checkout@v3 @@ -85,9 +86,9 @@ jobs: strategy: matrix: wolfssl: - - { ref: "v5.1.1-stable", name: "5.1.1"} - - { ref: "v5.2.0-stable", name: "5.2.0" } - - { ref: "v5.3.0-stable", name: "5.3.0"} + - { ref: "v5.6.6-stable", name: "5.6.6"} + - { ref: "v5.5.4-stable", name: "5.5.4" } + - { ref: "v5.4.0-stable", name: "5.4.0"} name: wolfSSL ${{ matrix.wolfssl.name }} steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 9aea7c85e..86121ef41 100644 --- a/README.md +++ b/README.md @@ -40,23 +40,23 @@ In the name of flexibility and extensibility, jwt-cpp supports [OpenSSL](https:/ | OpenSSL | LibreSSL | wolfSSL | |-------------------|----------------|----------------| -| ![1.0.2u][o1.0.2] | ![3.3.6][l3.3] | ![5.1.1][w5.1] | -| ![1.1.0i][o1.1.0] | ![3.4.3][l3.4] | ![5.2.0][w5.2] | -| ![1.1.1q][o1.1.1] | ![3.5.3][l3.5] | ![5.3.0][w5.3] | -| ![3.0.5][o3.0] | | | +| ![1.0.2u][o1.0.2] | ![3.6.2][l3.6] | ![5.4.0][w5.4] | +| ![1.1.0i][o1.1.0] | ![3.7.2][l3.7] | ![5.5.4][w5.5] | +| ![1.1.1w][o1.1.1] | ![3.8.2][l3.8] | ![5.6.6][w5.6] | +| ![3.2.0][o3.2] | | | > ℹ️ Note: A complete list of versions tested in the past can be found [here](https://github.com/Thalhammer/jwt-cpp/tree/badges). [o1.0.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.0.2u/shields.json [o1.1.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.0i/shields.json -[o1.1.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.1q/shields.json -[o3.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.0.5/shields.json -[l3.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.3.6/shields.json -[l3.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.4.3/shields.json -[l3.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.5.3/shields.json -[w5.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.1.1/shields.json -[w5.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.2.0/shields.json -[w5.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.3.0/shields.json +[o1.1.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.1w/shields.json +[o3.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.2.0/shields.json +[l3.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.6.2/shields.json +[l3.7]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.7.2/shields.json +[l3.8]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.8.2/shields.json +[w5.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.6.6/shields.json +[w5.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.5.4/shields.json +[w5.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.4.0/shields.json ## Overview From 1e12d2411334e991745c7fe00e276328b9a3f362 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 11 Jan 2024 11:24:53 -0500 Subject: [PATCH 06/60] disable nuget for testing --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94448e484..9f0d164a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ on: jobs: nuget: + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 1ea489f211d2d4ccc5943c8ec737446dacf34ea9 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 11 Jan 2024 11:40:02 -0500 Subject: [PATCH 07/60] add a zip as well --- .github/workflows/release.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f0d164a6..437a7812e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,14 +28,19 @@ jobs: release-asset: runs-on: ubuntu-latest + env: + NAME: jwt-cpp-${{ github.event.release.tag_name }} steps: - uses: actions/checkout@v4 - # steps for building assets - - run: tar -czf /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . - + - run: tar -czf /tmp/$NAME.tar.gz . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} - asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz + asset_path: /tmp/$NAME.tar.gz + - run: zip -r /tmp/$NAME.zip . + - uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: /tmp/$NAME.zip From 2a9d6d4a2b657ac80a6252793c9f51ac024f6232 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 10 Jan 2024 09:29:46 -0500 Subject: [PATCH 08/60] Documentation Refresh (#323) * Create getting-started.md * Update getting-started.md * Create header-only.yml * Create package-managers.yml * Update package-managers.yml * Update getting-started.md * Update getting-started.md * Update header-only.yml * Update header-only.yml * Update header-only.yml * Update header-only.yml * use `jwt::algorithm::hs256` to link against openssl * add crypto * switch to ssl * Update header-only.yml * tidy * lets install conan * tidying * Adding a CMake target to make the docs * cleaning up repo root folder * fix typo * set docs flag as on * update awesome doxy theme to latest * Updated overrides for new version * output folder and target name are changed * add a few more docs * white space * cmake format * playing with settings * move algorithms - magically fixed missing structs * playing with the idea of more refactoring * more testing * moved evp_handle def to special namespace for doxygen * split evp class by it's self * fix doc links * playing with evp class to fix error -- no luck * revert testing changes * clang format * cache should be container specific * clean up includes * combined class definition * split algos but running in ci with older version * trying slightly newer version of doxygen * doxygen 196 * doxygen 197 * doxygen 198 * avoid regression in 198 * more docs * playing with adding examples * playing around with example support to see if I like * docs include all the example files to be referenced in the code * bump version to 0.7.0 * missing header * devcontainer for testing openssl 3 * add test explorer * add clang helpers * there's a lot of package managers in 2023 * fixup colors with doxygen 1.10 * bump doxygen version since my bug has been fixed * move everything to one file (too many changes) * update doxyfile to 1.10 * minimize diff * fix extra line * fix whitespace * clean up dev container * min changes * cleanup * better checking + warnings for doxygen * whitespace * adding in more docs * fix spelling * make sure traits appear * trying to add snippets from examples cant figure it out https://github.com/doxygen/doxygen/issues/10517 * Update faqs.md * Delete .github/workflows/header-only.yml * Delete .github/workflows/package-managers.yml * Delete example/conan/CMakeLists.txt * Delete example/conan/conanfile.txt * Delete example/conan/main.cpp * Delete example/conan/README.md * Update nlohmann-json.cpp * add updated getting started docs first pass towards https://github.com/Thalhammer/jwt-cpp/issues/319 * touch ups * linking deprecated messages * improve cmake with find_package examples * fix code link color * be more clear about turning off examples good suggestion https://github.com/Thalhammer/jwt-cpp/pull/321#issuecomment-1870488941 * clarify openssl install and fixup fetch tag * apply workaround from https://github.com/doxygen/doxygen/issues/10517#issuecomment-1870509240 * fix renamed types * linting * cross reference new docs * trying new alert syntax https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts * move sections out of readme trying to make it shorter and more approachable * improve "getting started" readme section with a more through example * sort out doubled "getting started" second one in docs/ is just installation * linter * fixup english * formatting * whitespace * tie in more examples with snippets * minor touch ups * Update signing.md * JWT_BUILD_DOCS * better cache string for new option * word crafting * word crafting * add missing open-source-parsers/jsoncpp to traits list * better github alert * fixup new shields io start style * improve docs cmake target name * linter --------- Co-authored-by: Christopher McArthur --- .github/actions/install/cmake/action.yml | 3 +- .github/overrides.css | 19 - .github/workflows/documentation.yml | 14 +- .gitignore | 3 - CMakeLists.txt | 5 + README.md | 124 +- docs/.gitignore | 1 + docs/CMakeLists.txt | 23 + Doxyfile => docs/Doxyfile | 1011 +++++++++++------ docs/faqs.md | 18 +- docs/install.md | 72 ++ docs/overrides.css | 26 + docs/signing.md | 21 +- docs/ssl.md | 28 +- docs/traits.md | 49 +- example/conan/CMakeLists.txt | 8 - example/conan/README.md | 24 - example/conan/conanfile.txt | 6 - example/conan/main.cpp | 17 - example/es256k.cpp | 1 + example/jwks-verify.cpp | 6 + example/partial-claim-verifier.cpp | 4 + example/print-claims.cpp | 5 +- example/private-claims.cpp | 5 +- example/rsa-create.cpp | 1 + example/rsa-verify.cpp | 9 +- include/jwt-cpp/base.h | 43 +- include/jwt-cpp/jwt.h | 228 +++- include/jwt-cpp/traits/boost-json/defaults.h | 2 +- include/jwt-cpp/traits/boost-json/traits.h | 4 + .../traits/danielaparker-jsoncons/defaults.h | 2 +- .../traits/danielaparker-jsoncons/traits.h | 4 + include/jwt-cpp/traits/defaults.h.mustache | 2 +- .../jwt-cpp/traits/kazuho-picojson/defaults.h | 2 +- .../jwt-cpp/traits/kazuho-picojson/traits.h | 4 + .../jwt-cpp/traits/nlohmann-json/defaults.h | 2 +- include/jwt-cpp/traits/nlohmann-json/traits.h | 4 + .../open-source-parsers-jsoncpp/defaults.h | 2 +- .../open-source-parsers-jsoncpp/traits.h | 4 + 39 files changed, 1238 insertions(+), 568 deletions(-) delete mode 100644 .github/overrides.css create mode 100644 docs/.gitignore create mode 100644 docs/CMakeLists.txt rename Doxyfile => docs/Doxyfile (72%) create mode 100644 docs/install.md create mode 100644 docs/overrides.css delete mode 100644 example/conan/CMakeLists.txt delete mode 100644 example/conan/README.md delete mode 100644 example/conan/conanfile.txt delete mode 100644 example/conan/main.cpp diff --git a/.github/actions/install/cmake/action.yml b/.github/actions/install/cmake/action.yml index ac0a0234d..a018583ff 100644 --- a/.github/actions/install/cmake/action.yml +++ b/.github/actions/install/cmake/action.yml @@ -14,7 +14,8 @@ runs: id: cache-cmake uses: actions/cache@v3 with: - path: cmake-${{ inputs.version }}${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }} + path: cmake-${{ inputs.version }} + key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }} - name: Build cmake if: steps.cache-cmake.outputs.cache-hit != 'true' run: | diff --git a/.github/overrides.css b/.github/overrides.css deleted file mode 100644 index 42d2421ff..000000000 --- a/.github/overrides.css +++ /dev/null @@ -1,19 +0,0 @@ -@media (prefers-color-scheme: dark) { - table.markdownTable, table.fieldtable { - width: auto; - } - - html:not(.light-mode) { - /* define dark-mode variable overrides here if you DON'T use doxygen-awesome-darkmode-toggle.js */ - } - - html:not(.light-mode) div.contents table img { - filter: none; - } - - html:not(.light-mode) div.qindex, - html:not(.light-mode) div.navtab { - background-color: var(--side-nav-background); - border: 1px solid var(--separator-color); - } -} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index da6844100..da10cb768 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -9,13 +9,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: ssciwr/doxygen-install@v1 + with: + version: "1.10.0" - run: sudo apt install graphviz - - run: wget https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v1.6.1/doxygen-awesome.css - - run: wget https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v1.6.1/doxygen-awesome-sidebar-only.css - - uses: mattnotmitt/doxygen-action@v1 - - name: deploy + - run: | + cmake . -DJWT_BUILD_DOCS=ON + cmake --build . --target jwt-docs + - if: github.event_name == 'push' + name: deploy uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./doxy/html + publish_dir: ./build/html force_orphan: true diff --git a/.gitignore b/.gitignore index 751d5958c..dc994bd2c 100644 --- a/.gitignore +++ b/.gitignore @@ -310,8 +310,5 @@ test # ClangD cache files .cache -doxy/ -doxygen-awesome*.css - build/* package-lock.json diff --git a/CMakeLists.txt b/CMakeLists.txt index badf330e2..870a3634f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ project(jwt-cpp) option(JWT_BUILD_EXAMPLES "Configure CMake to build examples (or not)" ON) option(JWT_BUILD_TESTS "Configure CMake to build tests (or not)" OFF) +option(JWT_BUILD_DOCS "Adds a target for building the doxygen documentation" OFF) option(JWT_ENABLE_COVERAGE "Enable code coverage testing" OFF) option(JWT_ENABLE_FUZZING "Enable fuzz testing" OFF) @@ -153,3 +154,7 @@ endif() if(JWT_ENABLE_FUZZING) add_subdirectory(tests/fuzz) endif() + +if(JWT_BUILD_DOCS) + add_subdirectory(docs) +endif() diff --git a/README.md b/README.md index 86121ef41..803bbae8b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Documentation Badge](https://img.shields.io/badge/Documentation-master-blue)](https://thalhammer.github.io/jwt-cpp/) -[![Stars Badge](https://img.shields.io/github/stars/Thalhammer/jwt-cpp)](https://github.com/Thalhammer/jwt-cpp/stargazers) +[![Stars Badge](https://img.shields.io/github/stars/Thalhammer/jwt-cpp?style=flat)](https://github.com/Thalhammer/jwt-cpp/stargazers) [![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/Thalhammer/jwt-cpp?include_prereleases)](https://github.com/Thalhammer/jwt-cpp/releases) [![ConanCenter package](https://repology.org/badge/version-for-repo/conancenter/jwt-cpp.svg)](https://repology.org/project/jwt-cpp/versions) [![Vcpkg package](https://repology.org/badge/version-for-repo/vcpkg/jwt-cpp.svg)](https://repology.org/project/jwt-cpp/versions) @@ -19,81 +19,37 @@ [Windows]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/cross-platform/windows-latest/shields.json [Cross-Platform]: https://github.com/Thalhammer/jwt-cpp/actions?query=workflow%3A%22Cross-Platform+CI%22 +## Overview + A header only library for creating and validating [JSON Web Tokens](https://tools.ietf.org/html/rfc7519) in C++11. For a great introduction, [read this](https://jwt.io/introduction/). +The objective is to deliver a versatile and universally applicable collection of algorithms, classes, and data structures, fostering adaptability and seamless integration with other libraries that you may already be employing. + ## Signature algorithms -jwt-cpp supports all the algorithms defined by the specifications. The modular design allows to easily add additional algorithms without any problems. If you need any feel free to create a pull request or [open an issue](https://github.com/Thalhammer/jwt-cpp/issues/new). +jwt-cpp comprehensively supports all algorithms specified in the standard. Its modular design facilitates the seamless [inclusion of additional algorithms](docs/signing.md#custom-signature-algorithms) without encountering any complications. Should you wish to contribute new algorithms, feel free to initiate a pull request or [open an issue](https://github.com/Thalhammer/jwt-cpp/issues/new). For completeness, here is a list of all supported algorithms: | HMSC | RSA | ECDSA | PSS | EdDSA | -|-------|-------|--------|-------|---------| +| ----- | ----- | ------ | ----- | ------- | | HS256 | RS256 | ES256 | PS256 | Ed25519 | | HS384 | RS384 | ES384 | PS384 | Ed448 | | HS512 | RS512 | ES512 | PS512 | | | | | ES256K | | | -## SSL Compatibility - -In the name of flexibility and extensibility, jwt-cpp supports [OpenSSL](https://github.com/openssl/openssl), [LibreSSL](https://github.com/libressl-portable/portable), and [wolfSSL](https://github.com/wolfSSL/wolfssl). Read [this page](docs/ssl.md) for more details. These are the version which are currently being tested: - -| OpenSSL | LibreSSL | wolfSSL | -|-------------------|----------------|----------------| -| ![1.0.2u][o1.0.2] | ![3.6.2][l3.6] | ![5.4.0][w5.4] | -| ![1.1.0i][o1.1.0] | ![3.7.2][l3.7] | ![5.5.4][w5.5] | -| ![1.1.1w][o1.1.1] | ![3.8.2][l3.8] | ![5.6.6][w5.6] | -| ![3.2.0][o3.2] | | | - -> ℹ️ Note: A complete list of versions tested in the past can be found [here](https://github.com/Thalhammer/jwt-cpp/tree/badges). - -[o1.0.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.0.2u/shields.json -[o1.1.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.0i/shields.json -[o1.1.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.1w/shields.json -[o3.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.2.0/shields.json -[l3.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.6.2/shields.json -[l3.7]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.7.2/shields.json -[l3.8]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.8.2/shields.json -[w5.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.6.6/shields.json -[w5.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.5.4/shields.json -[w5.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.4.0/shields.json - -## Overview - -There is no hard dependency on a JSON library. Instead, there's a generic `jwt::basic_claim` which is templated around type traits, which described the semantic [JSON types](https://json-schema.org/understanding-json-schema/reference/type.html) for a value, object, array, string, number, integer and boolean, as well as methods to translate between them. - -```cpp -jwt::basic_claim claim(json::object({{"json", true},{"example", 0}})); -``` - -This allows for complete freedom when picking which libraries you want to use. For more information, [read this page](docs/traits.md)). - -For your convenience there are serval traits implementation which provide some popular JSON libraries. They are: - -[![picojson][picojson]](https://github.com/kazuho/picojson) -[![nlohmann][nlohmann]](https://github.com/nlohmann/json) -[![jsoncons][jsoncons]](https://github.com/danielaparker/jsoncons) -[![boostjson][boostjson]](https://github.com/boostorg/json) - -[picojson]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/kazuho-picojson/shields.json -[nlohmann]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/nlohmann-json/shields.json -[jsoncons]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/danielaparker-jsoncons/shields.json -[boostjson]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/boost-json/shields.json - -In order to maintain compatibility, [picojson](https://github.com/kazuho/picojson) is still used to provide a specialized `jwt::claim` along with all helpers. Defining `JWT_DISABLE_PICOJSON` will remove this optional dependency. It's possible to directly include the traits defaults for the other JSON libraries. See the [traits examples](https://github.com/Thalhammer/jwt-cpp/tree/master/example/traits) for details. - -As for the base64 requirements of JWTs, this library provides `base.h` with all the required implementation; However base64 implementations are very common, with varying degrees of performance. When providing your own base64 implementation, you can define `JWT_DISABLE_BASE64` to remove the jwt-cpp implementation. +## Getting Started -### Getting Started +Installation instructions can be found [here](docs/install.md). -Simple example of decoding a token and printing all [claims](https://tools.ietf.org/html/rfc7519#section-4) ([try it out](https://github.com/Thalhammer/jwt-cpp/tree/master/example/print-claims.cpp)): +A simple example is decoding a token and printing all of its [claims](https://tools.ietf.org/html/rfc7519#section-4) let's ([try it out](https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-1L-FsOjtR6uE-L4E9zJutMWKIe1v1M)): ```cpp #include #include int main() { - std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.AbIJTDMFc7yUa5MhvcP03nJPyCPzZtQcGEp-zWfOkEE"; + std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-1L-FsOjtR6uE-L4E9zJutMWKIe1v1M"; auto decoded = jwt::decode(token); for(auto& e : decoded.get_payload_json()) @@ -101,39 +57,76 @@ int main() { } ``` +You can build and run [this example](example/print-claims.cpp) locally after cloning the repository. +Running some commands, we can see the contents of the [JWT payload](https://datatracker.ietf.org/doc/html/rfc7519#section-3) + +```sh +cmake . +cmake --build . --target print-claims +./print-claims +# iss = "auth0" +# sample = "test" +``` + +You'll very quickly notice JWT are not encrypted but rather cryptographically signed to +provide [non-repudiation](https://csrc.nist.gov/glossary/term/non_repudiation). + In order to verify a token you first build a verifier and use it to verify a decoded token. ```cpp auto verifier = jwt::verify() - .allow_algorithm(jwt::algorithm::hs256{ "secret" }) - .with_issuer("auth0"); + .with_issuer("auth0") + .with_claim("sample", jwt::claim(std::string("test"))); + .allow_algorithm(jwt::algorithm::hs256{"secret"}) verifier.verify(decoded_token); ``` -The created verifier is stateless so you can reuse it for different tokens. +The verifier is stateless so you can reuse it for different tokens. -Creating a token (and signing) is equally as easy. +Creating the token above (and signing it) is equally as easy. ```cpp auto token = jwt::create() - .set_issuer("auth0") .set_type("JWS") + .set_issuer("auth0") .set_payload_claim("sample", jwt::claim(std::string("test"))) .sign(jwt::algorithm::hs256{"secret"}); ``` -> To see more examples working with RSA public and private keys, visit our [examples](https://github.com/Thalhammer/jwt-cpp/tree/master/example)! +If you are looking to issue or verify more unique tokens, checkout out the [examples](https://github.com/Thalhammer/jwt-cpp/tree/master/example) working with RSA public and private keys, elliptic curve tokens, and much more! + +### Configuration Options + +Building on the goal of providing flexibility. + +#### SSL Compatibility + +jwt-cpp supports [OpenSSL](https://github.com/openssl/openssl), [LibreSSL](https://github.com/libressl-portable/portable), and [wolfSSL](https://github.com/wolfSSL/wolfssl). For a listed of tested versions, check [this page](docs/ssl.md) for more details. + +#### JSON Implementation + +There is no strict reliance on a specific JSON library in this context. Instead, the jwt-cpp utilizes a generic `jwt::basic_claim` that is templated based on type trait. This trait provides the semantic [JSON types](https://json-schema.org/understanding-json-schema/reference/type.html) for values, objects, arrays, strings, numbers, integers, and booleans, along with methods to seamlessly translate between them. + +This design offers flexibility in choosing the JSON library that best suits your needs. To leverage one of the provided JSON traits, refer to [docs/traits.md](docs/traits.md#selecting-a-json-library) for detailed guidance. + +##### Providing your own JSON Traits + +```cpp +jwt::basic_claim claim(json::object({{"json", true},{"example", 0}})); +``` + +To learn how to writes a trait's implementation, checkout the [these instructions](docs/traits.md#providing-your-own-json-traits) -### Providing your own JSON Traits +#### Base64 Options -To learn how to writes a trait's implementation, checkout the [these instructions](docs/traits.md) +With regard to the base64 specifications for JWTs, this library includes `base.h` encompassing all necessary variants. While the library itself offers a proficient base64 implementation, it's worth noting that base64 implementations are widely available, exhibiting diverse performance levels. If you prefer to use your own base64 implementation, you have the option to define `JWT_DISABLE_BASE64` to exclude the jwt-cpp implementation. ## Contributing -If you have an improvement or found a bug feel free to [open an issue](https://github.com/Thalhammer/jwt-cpp/issues/new) or add the change and create a pull request. If you file a bug please make sure to include as much information about your environment (compiler version, etc.) as possible to help reproduce the issue. If you add a new feature please make sure to also include test cases for it. +If you have suggestions for improvement or if you've identified a bug, please don't hesitate to [open an issue](https://github.com/Thalhammer/jwt-cpp/issues/new) or contribute by creating a pull request. When reporting a bug, provide comprehensive details about your environment, including compiler version and other relevant information, to facilitate issue reproduction. Additionally, if you're introducing a new feature, ensure that you include corresponding test cases to validate its functionality. -## Dependencies +### Dependencies In order to use jwt-cpp you need the following tools. @@ -152,4 +145,5 @@ In order to build the test cases you also need See the [FAQs](docs/faqs.md) for tips. ## Conference Coverage + [![CppCon](https://img.youtube.com/vi/Oq4NW5idmiI/0.jpg)](https://www.youtube.com/watch?v=Oq4NW5idmiI) diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..3a5b63a8e --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +doxygen-awesome*.css diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 000000000..1c1591559 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,23 @@ +file(DOWNLOAD https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.2.1/doxygen-awesome.css + ${CMAKE_CURRENT_LIST_DIR}/doxygen-awesome.css + EXPECTED_HASH SHA256=9b5549928906e9974cc12dcdde9265e016dc2388ec72d5aa3209f4870914a0c8) +file(DOWNLOAD https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.2.1/doxygen-awesome-sidebar-only.css + ${CMAKE_CURRENT_LIST_DIR}/doxygen-awesome-sidebar-only.css + EXPECTED_HASH SHA256=998328b27193b7be007a431bc9be1a6f6855ff4d8fa722ecfdfed79a8931409f) + +execute_process(COMMAND doxygen --version RESULT_VARIABLE DOXYGEN_VERSION_RESULT + OUTPUT_VARIABLE DOXYGEN_VERSION_RAW_OUTPUT) +if(NOT DOXYGEN_VERSION_RESULT EQUAL 0) + message(AUTHOR_WARNING "Unable to get the version of doxygen") +else() + # Extracts the version from the output of the command run before + string(REGEX MATCH "^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)" DOXYGEN_VERSION_OUTPUT + "${DOXYGEN_VERSION_RAW_OUTPUT}") + message(STATUS "doxygen version detected : ${DOXYGEN_VERSION_OUTPUT}") +endif() + +add_custom_target(jwt-docs COMMAND doxygen ${CMAKE_CURRENT_LIST_DIR}/Doxyfile WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + SOURCES ${CMAKE_CURRENT_LIST_DIR}/Doxyfile BYPRODUCTS ${CMAKE_BINARY_DIR}/html/index.html) +add_custom_command( + TARGET jwt-docs POST_BUILD COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "You can prview the documentation: ${CMAKE_BINARY_DIR}/html/index.html") diff --git a/Doxyfile b/docs/Doxyfile similarity index 72% rename from Doxyfile rename to docs/Doxyfile index 41343d736..2d8c8a8f9 100644 --- a/Doxyfile +++ b/docs/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.13 +# Doxyfile 1.10.0 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,16 +12,26 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -38,7 +48,7 @@ PROJECT_NAME = JWT-CPP # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v0.6.0 +PROJECT_NUMBER = v0.7.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -53,23 +63,41 @@ PROJECT_BRIEF = "A header only library for creating and validating JSON PROJECT_LOGO = +# With the PROJECT_ICON tag one can specify an icon that is included in the tabs +# when the HTML document is shown. Doxygen will copy the logo to the output +# directory. + +PROJECT_ICON = + # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = doxy +OUTPUT_DIRECTORY = build -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,14 +109,14 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English @@ -189,6 +217,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -209,6 +247,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -232,20 +278,19 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -274,28 +319,40 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -307,11 +364,22 @@ MARKDOWN_SUPPORT = YES # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. +# Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -337,7 +405,7 @@ BUILTIN_STL_SUPPORT = YES CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -423,6 +491,27 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -443,6 +532,12 @@ EXTRACT_ALL = NO EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -480,6 +575,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -491,14 +593,15 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -517,12 +620,20 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. CASE_SENSE_NAMES = YES @@ -540,6 +651,12 @@ HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -697,7 +814,8 @@ FILE_VERSION_FILTER = # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -708,7 +826,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -743,23 +861,50 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. # The default value is: NO. WARN_AS_ERROR = NO @@ -770,13 +915,27 @@ WARN_AS_ERROR = NO # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard -# error (stderr). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = @@ -790,17 +949,32 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = include README.md docs +INPUT = include \ + example \ + README.md \ + docs \ + .github/security.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. @@ -809,11 +983,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.ccm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, +# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, +# *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to +# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ @@ -873,7 +1051,9 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = include/nlohmann/json.hpp, include/picojson/picojson.h +EXCLUDE = include/picojson/picojson.h \ + example/conan/README.md \ + example/traits/README.md # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -889,18 +1069,17 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* +# ANamespace::AClass, ANamespace::*Test -EXCLUDE_SYMBOLS = jwt::details, std +EXCLUDE_SYMBOLS = jwt::details \ + jwt::base::details \ + std # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include @@ -913,7 +1092,7 @@ EXAMPLE_PATH = example # *.h) to filter out the source-files in the directories. If left blank all # files are included. -EXAMPLE_PATTERNS = * +EXAMPLE_PATTERNS = *.cpp # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands @@ -943,6 +1122,11 @@ IMAGE_PATH = # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. @@ -984,6 +1168,15 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = README.md +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- @@ -998,7 +1191,8 @@ USE_MDFILE_AS_MAINPAGE = README.md SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. +# multi-line macros, enums or list initialized variables directly into the +# documentation. # The default value is: NO. INLINE_SOURCES = NO @@ -1011,7 +1205,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -1043,12 +1237,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1070,25 +1264,6 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1100,17 +1275,11 @@ CLANG_OPTIONS = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = @@ -1189,10 +1358,17 @@ HTML_STYLESHEET = # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = doxygen-awesome.css doxygen-awesome-sidebar-only.css .github/overrides.css +HTML_EXTRA_STYLESHEET = docs/doxygen-awesome.css \ + docs/doxygen-awesome-sidebar-only.css \ + docs/overrides.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1204,10 +1380,23 @@ HTML_EXTRA_STYLESHEET = doxygen-awesome.css doxygen-awesome-sidebar-only.css .g HTML_EXTRA_FILES = +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = LIGHT + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1216,7 +1405,7 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1234,14 +1423,16 @@ HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = NO +HTML_DYNAMIC_MENUS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the @@ -1251,6 +1442,33 @@ HTML_TIMESTAMP = NO HTML_DYNAMIC_SECTIONS = NO +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + +# If the HTML_COPY_CLIPBOARD tag is set to YES then doxygen will show an icon in +# the top right corner of code and text fragments that allows the user to copy +# its content to the clipboard. Note this only works if supported by the browser +# and the web page is served via a secure context (see: +# https://www.w3.org/TR/secure-contexts/), i.e. using the https: or file: +# protocol. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COPY_CLIPBOARD = YES + +# Doxygen stores a couple of settings persistently in the browser (via e.g. +# cookies). By default these settings apply to all HTML pages generated by +# doxygen across all projects. The HTML_PROJECT_COOKIE tag can be used to store +# the settings under a project specific key, such that the user preferences will +# be stored separately. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_PROJECT_COOKIE = + # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to @@ -1266,13 +1484,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1286,6 +1505,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. @@ -1311,8 +1537,12 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1342,7 +1572,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1369,6 +1599,16 @@ BINARY_TOC = NO TOC_EXPAND = NO +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help @@ -1387,7 +1627,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1395,8 +1636,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1404,30 +1645,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1470,16 +1711,28 @@ DISABLE_INDEX = NO # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = YES +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # @@ -1504,6 +1757,24 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1513,19 +1784,14 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. -FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1535,11 +1801,29 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1552,22 +1836,29 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1595,7 +1886,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1614,7 +1905,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1627,8 +1919,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1679,21 +1972,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1723,29 +2030,31 @@ PAPER_TYPE = a4 EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1778,18 +2087,26 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. USE_PDFLATEX = YES -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error. +# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch +# mode nothing is printed on the terminal, errors are scrolled as if is +# hit at every error; missing files that TeX tries to input or request from +# keyboard input (\read on a not open input stream) cause the job to abort, +# NON_STOP In nonstop mode the diagnostic message will appear on the terminal, +# but there is no possibility of user interaction just like in batch mode, +# SCROLL In scroll mode, TeX will stop only for missing files to input or if +# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at +# each error, asking for user intervention. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1802,31 +2119,21 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: NO. +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_TIMESTAMP = NO +LATEX_EMOJI_DIRECTORY = #--------------------------------------------------------------------------- # Configuration options related to the RTF output @@ -1867,9 +2174,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1878,22 +2185,12 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -1965,6 +2262,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1983,27 +2287,44 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + +# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3 +# database with symbols found by doxygen stored in tables. +# The default value is: NO. + +GENERATE_SQLITE3 = NO + +# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be +# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put +# in front of it. +# The default directory is: sqlite3. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_OUTPUT = sqlite3 + +# The SQLITE3_RECREATE_DB tag is set to YES, the existing doxygen_sqlite3.db +# database file will be recreated with each doxygen run. If set to NO, doxygen +# will warn if a database file is already found and not modify it. +# The default value is: YES. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_RECREATE_DB = YES + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2078,7 +2399,8 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = @@ -2145,15 +2467,15 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. +# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces +# will be listed in the class and namespace index. If set to NO, only the +# inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be +# in the topic index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. @@ -2166,41 +2488,10 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2209,10 +2500,10 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO -# The default value is: YES. +# The default value is: NO. HAVE_DOT = YES @@ -2226,49 +2517,77 @@ HAVE_DOT = YES DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see Node, +# Edge and Graph Attributes specification You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" + +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about +# arrows shapes. +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification +# The default value is: shape=box,height=0.2,width=0.4. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will +# generate a graph for each documented class showing the direct and indirect +# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and +# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case +# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the +# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used. +# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance +# relations will be shown as texts / links. Explicit enabling an inheritance +# graph or choosing a different representation for an inheritance graph of a +# specific class, can be accomplished by means of the command \inheritancegraph. +# Disabling an inheritance graph can be accomplished by means of the command +# \hideinheritancegraph. +# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. +# class with other documented classes. Explicit enabling a collaboration graph, +# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the +# command \collaborationgraph. Disabling a collaboration graph can be +# accomplished by means of the command \hidecollaborationgraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. COLLABORATION_GRAPH = NO # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. Explicit enabling a group +# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means +# of the command \groupgraph. Disabling a directory graph can be accomplished by +# means of the command \hidegroupgraph. See also the chapter Grouping in the +# manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2291,10 +2610,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will be wrapped across multiple lines. Some heuristics are +# applied to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2306,7 +2647,9 @@ TEMPLATE_RELATIONS = NO # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO, +# can be accomplished by means of the command \includegraph. Disabling an +# include graph can be accomplished by means of the command \hideincludegraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2315,7 +2658,10 @@ INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set +# to NO, can be accomplished by means of the command \includedbygraph. Disabling +# an included by graph can be accomplished by means of the command +# \hideincludedbygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2355,22 +2701,30 @@ GRAPHICAL_HIERARCHY = NO # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the -# files in the directories. +# files in the directories. Explicit enabling a directory graph, when +# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command +# \directorygraph. Disabling a directory graph can be accomplished by means of +# the command \hidedirectorygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, -# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, -# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, # png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and # png:gdiplus:gdiplus. # The default value is: png. @@ -2403,11 +2757,12 @@ DOT_PATH = DOTFILE_DIRS = -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. -MSCFILE_DIRS = +DIA_PATH = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile @@ -2416,10 +2771,10 @@ MSCFILE_DIRS = DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. PLANTUML_JAR_PATH = @@ -2457,18 +2812,6 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = YES - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support @@ -2481,14 +2824,34 @@ DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will +# use a built-in version of mscgen tool to produce the charts. Alternatively, +# the MSCGEN_TOOL tag can also specify the name an external tool. For instance, +# specifying prog as the value, doxygen will call the tool as prog -T +# -o . The external tool should support +# output file formats "png", "eps", "svg", and "ismap". + +MSCGEN_TOOL = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = diff --git a/docs/faqs.md b/docs/faqs.md index 5b70a57b2..324c6be5d 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -45,16 +45,14 @@ auto token = jwt::create() ### Can you add claims to a signed token? -The signature includes both the header and payload, according to the RFCs... changing the payload would cause a discrepancy. -That should result in the token being rejected. For more details checkout [#194](https://github.com/Thalhammer/jwt-cpp/issues/194). +The signature includes both the header and payload, according to the RFCs... changing the payload would cause a discrepancy. That should result in the token being rejected. For more details checkout [#194](https://github.com/Thalhammer/jwt-cpp/issues/194). ### Why does `jwt::basic_claim` have no `as_object()` method? This was brought up in [#212](https://github.com/Thalhammer/jwt-cpp/issues/212#issuecomment-1054344192) and [#101](https://github.com/Thalhammer/jwt-cpp/issues/101) as it's an excellent question. -It simply was not required to handle the required keys in JWTs for signing or verification. All the the mandatory keys -are numeric, string or array types which required type definitions and access. +It simply was not required to handle the required keys in JWTs for signing or verification. All the the mandatory keys are numeric, string or array types which required type definitions and access. The alternative is to use the `to_json()` method and use the libraries own APIs to pick the data type you need. @@ -62,17 +60,15 @@ The alternative is to use the `to_json()` method and use the libraries own APIs ### Missing \_HMAC and \_EVP_sha256 symbols on Mac -There seems to exists a problem with the included openssl library of MacOS. Make sure you link to one provided by brew. -See [#6](https://github.com/Thalhammer/jwt-cpp/issues/6) for more details. +There seems to exists a problem with the included openssl library of MacOS. Make sure you link to one provided by brew. See [#6](https://github.com/Thalhammer/jwt-cpp/issues/6) for more details. ### Building on windows fails with syntax errors The header ``, which is often included in Windows projects, defines macros for MIN and MAX which conflicts -with `std::numeric_limits`. See [#5](https://github.com/Thalhammer/jwt-cpp/issues/5) for more details or -[this StackOverflow thread](https://stackoverflow.com/questions/13416418/define-nominmax-using-stdmin-max). +with `std::numeric_limits`. See [#5](https://github.com/Thalhammer/jwt-cpp/issues/5) for more details or [this StackOverflow thread](https://stackoverflow.com/questions/13416418/define-nominmax-using-stdmin-max). To fix this do one of the following things: -* define `NOMINMAX`, which suppresses this behavior -* include this library before you `#include ` -* place `#undef max` and `#undef min` before you include this library +- define `NOMINMAX`, which suppresses this behavior +- include this library before you `#include ` +- place `#undef max` and `#undef min` before you include this library diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 000000000..f5b633c6c --- /dev/null +++ b/docs/install.md @@ -0,0 +1,72 @@ +# Installation + +There's a number of options to choice from. + +## Overview + +It's strongly recommended to use a package manager, as JWT-CPP has dependencies for both cryptography and JSON libraries, having a tool to do the heavily lifting can be ideal. Examples of a C and C++ package manager are [Conan](https://conan.io/) and [vcpkg](https://vcpkg.io/). If the version is out of date please check with their respective communities before opening and issue here. + +When manually adding this dependency, and the dependencies this has, check the GitHub Actions and Workflows for some inspiration about how to go about it. + +### Package Manager + +- Conan: +- vcpkg: +- Nuget: +- Hunter: +- Spack: +- Xrepo: + +Looking for ways to contribute? Help by adding JWT-CPP to your favorite package manager! +[Nixpkgs](https://github.com/NixOS/nixpkgs) for example. Currently many are behind the latest. + +### Header Only + +Simply downloading the `include/` directory is possible. +Make sure the `jwt-cpp/` subdirectories is visible during compilation. +This **does require** correctly linking to OpenSSL or alternative cryptography library. + +The minimum is `jwt.h` but you will need to add the defines: + +- [`JWT_DISABLE_BASE64`](https://github.com/Thalhammer/jwt-cpp/blob/c9a511f436eaa13857336ebeb44dbc5b7860fe01/include/jwt-cpp/jwt.h#L11) +- [`JWT_DISABLE_PICOJSON`](https://github.com/Thalhammer/jwt-cpp/blob/c9a511f436eaa13857336ebeb44dbc5b7860fe01/include/jwt-cpp/jwt.h#L4) + +In addition to providing your own JSON traits implementation, see [traits.md](traits.ms) for more information. + +### CMake + +Using `find_package` is recommended. Step you environment by [installing OpenSSL](https://github.com/openssl/openssl/blob/master/INSTALL.md). Once complete, configure and install the `jwt-cpp` target using CMake. + +A simple installation of JWT-CPP may look like + +```sh +cmake . +cmake --build . # Make sure everything compiles and links together +cmake --install . +``` + +Then from your own project + +```cmake +find_package(jwt-cpp CONFIG REQUIRED) + +target_link_libraries(my_app PRIVATE jwt-cpp::jwt-cpp) +``` + +#### Unsupported Alternatives + +There's also the possibility of using [`FetchContent`](https://cmake.org/cmake/help/latest/module/FetchContent.html#examples) in pull this this project to your build tree. + +```cmake +include(FetchContent) +fetchcontent_declare(jwt-cpp + GIT_REPOSITORY https://github.com/Thalhammer/jwt-cpp.git + GIT_TAG 08bcf77a687fb06e34138e9e9fa12a4ecbe12332 # v0.7.0 release +) +set(JWT_BUILD_EXAMPLES OFF CACHE BOOL "disable building examples" FORCE) +fetchcontent_makeavailable(jwt-cpp) + +target_link_libraries(my_app PRIVATE jwt-cpp::jwt-cpp) +``` + +Lastly, you can use `add_subdirectory`, this is untested but should work. diff --git a/docs/overrides.css b/docs/overrides.css new file mode 100644 index 000000000..279c2df85 --- /dev/null +++ b/docs/overrides.css @@ -0,0 +1,26 @@ +html { + --top-nav-height: 150px +} + +@media screen and (min-width: 768px) { + #top { + height: var(--top-nav-height); + } + + #nav-tree, #side-nav { + height: calc(100vh - var(--top-nav-height)) !important; + } + + #side-nav { + top: var(--top-nav-height); + } +} + +.paramname em { + font-weight: 600; + color: var(--primary-dark-color); +} + +a code { + color: var(--primary-color) !important; +} diff --git a/docs/signing.md b/docs/signing.md index 419b7d2ad..359e9f36e 100644 --- a/docs/signing.md +++ b/docs/signing.md @@ -2,28 +2,27 @@ ## Custom Signature Algorithms -The libraries design is open so you can implement your own algorithms, see [existing examples](https://github.com/Thalhammer/jwt-cpp/blob/73f23419235661e89a304ba5ab09d6714fb8dd94/include/jwt-cpp/jwt.h#L874) for ideas. +The libraries design is open so you can implement your own algorithms, see [existing implementations](https://github.com/Thalhammer/jwt-cpp/blob/73f23419235661e89a304ba5ab09d6714fb8dd94/include/jwt-cpp/jwt.h#L874) for ideas. ```cpp struct your_algorithm{ - std::string sign(const std::string& /*unused*/, std::error_code& ec) const { - ec.clear(); + std::string sign(const std::string& /*unused*/, std::error_code& ec) const { + ec.clear(); // CALL YOUR METHOD HERE - return {}; - } - void verify(const std::string& /*unused*/, const std::string& signature, std::error_code& ec) const { - ec.clear(); - if (!signature.empty()) { ec = error::signature_verification_error::invalid_signature; } + return {}; + } + void verify(const std::string& /*unused*/, const std::string& signature, std::error_code& ec) const { + ec.clear(); + if (!signature.empty()) { ec = error::signature_verification_error::invalid_signature; } // CALL YOUR METHOD HERE - } - std::string name() const { return "your_algorithm"; } + } + std::string name() const { return "your_algorithm"; } }; ``` Then everything else is the same, just pass in your implementation such as: - ```cpp auto token = jwt::create() .set_id("custom-algo-example") diff --git a/docs/ssl.md b/docs/ssl.md index 4f001ac53..de972a46a 100644 --- a/docs/ssl.md +++ b/docs/ssl.md @@ -1,7 +1,6 @@ # Cryptography Libraries -The underlying cryptography libraries describe [here](../README.md#ssl-compatibility) can be selected when -configuring CMake by explicitly setting `JWT_SSL_LIBRARY` to one of three values. The default is to use OpenSSL. +The underlying cryptography libraries describe [here](../README.md#ssl-compatibility) can be selected when configuring CMake by explicitly setting `JWT_SSL_LIBRARY` to one of three values. The default is to use OpenSSL. - OpenSSL - LibreSSL @@ -13,6 +12,31 @@ Here's an example: cmake . -DJWT_SSL_LIBRARY:STRING=wolfSSL ``` +## Supported Versions + +These are the version which are currently being tested: + +| OpenSSL | LibreSSL | wolfSSL | +| ----------------- | -------------- | -------------- | +| ![1.0.2u][o1.0.2] | ![3.6.2][l3.6] | ![5.4.0][w5.4] | +| ![1.1.0i][o1.1.0] | ![3.7.2][l3.7] | ![5.5.4][w5.5] | +| ![1.1.1w][o1.1.1] | ![3.8.2][l3.8] | ![5.6.6][w5.6] | +| ![3.2.0][o3.2] | | | + +> [!NOTE] +> A complete list of versions tested in the past can be found [here](https://github.com/Thalhammer/jwt-cpp/tree/badges). + +[o1.0.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.0.2u/shields.json +[o1.1.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.0i/shields.json +[o1.1.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.1w/shields.json +[o3.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.2.0/shields.json +[l3.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.6.2/shields.json +[l3.7]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.7.2/shields.json +[l3.8]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.8.2/shields.json +[w5.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.6.6/shields.json +[w5.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.5.4/shields.json +[w5.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.4.0/shields.json + ## Notes JWT-CPP relies on the OpenSSL API, as a result both LibreSSL and wolfSSL need to include their respective compatibility layers. diff --git a/docs/traits.md b/docs/traits.md index 71eddb6af..caa12b8e5 100644 --- a/docs/traits.md +++ b/docs/traits.md @@ -2,6 +2,52 @@ Traits define the compatibility mapping for JWT-CPP required functionality to the JSON implementation of choice. +## Selecting a JSON library + +For your convenience there are serval traits implementation which provide some popular JSON libraries. They are: + +[![picojson][picojson]](https://github.com/kazuho/picojson) +[![nlohmann][nlohmann]](https://github.com/nlohmann/json) +[![jsoncons][jsoncons]](https://github.com/danielaparker/jsoncons) +[![boostjson][boostjson]](https://github.com/boostorg/json) +[![jsoncpp][jsoncpp]](https://github.com/open-source-parsers/jsoncpp) + +[picojson]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/kazuho-picojson/shields.json +[nlohmann]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/nlohmann-json/shields.json +[jsoncons]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/danielaparker-jsoncons/shields.json +[boostjson]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/boost-json/shields.json +[jsoncpp]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/traits/open-source-parsers-jsoncpp/shields.json + +In order to maintain compatibility, [picojson](https://github.com/kazuho/picojson) is still used to provide a specialized `jwt::claim` along with all helpers. Defining `JWT_DISABLE_PICOJSON` will remove this optional dependency. It's possible to directly include the traits defaults for the other JSON libraries. See the [traits examples](https://github.com/Thalhammer/jwt-cpp/tree/master/example/traits) for details. + +```cpp +//include "jwt-cpp/traits/author-library/traits.h" +#include "jwt-cpp/traits/nlohmann-json/traits.h" +// There is also a "defaults.h" if you's like to skip providing the +// template specializations for the JSON traits + +int main() { + // All the provided traits are in jwt::traits namespace + using traits = jwt::traits::nlohmann_json; + + const auto time = jwt::date::clock::now(); + const auto token = jwt::create() + .set_type("JWT") + .set_issuer("auth.mydomain.io") + .set_audience("mydomain.io") + .set_issued_at(time) + .set_not_before(time) + .set_expires_at(time + std::chrono::minutes{2} + std::chrono::seconds{15}) + .sign(jwt::algorithm::none{}); + const auto decoded = jwt::decode(token); + + jwt::verify() + .allow_algorithm(jwt::algorithm::none{}) + .with_issuer("auth.mydomain.io") + .with_audience("mydomain.io") + .verify(decoded); +``` + ## Providing your own JSON Traits There are several key items that need to be provided to a `jwt::basic_claim` in order for it to be interoperable with you JSON library of choice. @@ -12,7 +58,8 @@ There are several key items that need to be provided to a `jwt::basic_claim` in If ever you are not sure, the traits are heavily checked against static asserts to make sure you provide everything that's required. -> :warning: Not all JSON libraries are a like, you may need to extend certain types such that it can be used. See this [provided implementation](https://github.com/Thalhammer/jwt-cpp/blob/e6b92cca0b7088027269c481fa244e5c39df88ff/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h#L18). +> [!important] +> Not all JSON libraries are a like, you may need to extend certain types such that it can be used. See this [provided implementation](https://github.com/Thalhammer/jwt-cpp/blob/e6b92cca0b7088027269c481fa244e5c39df88ff/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h#L18). ```cpp struct my_favorite_json_library_traits { diff --git a/example/conan/CMakeLists.txt b/example/conan/CMakeLists.txt deleted file mode 100644 index 7bd897c16..000000000 --- a/example/conan/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(conan-example) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} main.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/example/conan/README.md b/example/conan/README.md deleted file mode 100644 index 8032ffdef..000000000 --- a/example/conan/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Conan example - -In the current directory on Linux environment - -```sh -mkdir build && cd build -conan install .. && cmake .. -cmake --build . -``` - -run executable - -```sh -$ ./bin/conan-example -sub = "jrocket@example.com" -iss = "Online JWT Builder" -exp = 1641559177 -aud = "www.example.com" -Surname = "Rocket" -Role = ["Manager","Project Administrator"] -iat = 1610023177 -GivenName = "Johnny" -Email = "jrocket@example.com" -``` diff --git a/example/conan/conanfile.txt b/example/conan/conanfile.txt deleted file mode 100644 index b2a27f124..000000000 --- a/example/conan/conanfile.txt +++ /dev/null @@ -1,6 +0,0 @@ -[requires] -jwt-cpp/0.6.0 -picojson/cci.20210117 - -[generators] -cmake diff --git a/example/conan/main.cpp b/example/conan/main.cpp deleted file mode 100644 index 9095ccb99..000000000 --- a/example/conan/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "jwt-cpp/jwt.h" -#include -#include - -int main() { - - std::string token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9." - "eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE2MTAwMjMxNzcsImV4cCI6MTY0MTU1OTE3NywiYXVkIjoid3" - "d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6IkpvaG5ueSIsIlN1cm5h" - "bWUiOiJSb2NrZXQiLCJFbWFpbCI6Impyb2NrZXRAZXhhbXBsZS5jb20iLCJSb2xlIjpbIk1hbmFnZXIiLCJQcm9qZWN0IE" - "FkbWluaXN0cmF0b3IiXX0.5EOfHnBmpdPvRHAuVDttgJQvbFuGEF7fC4uBSXAGg6c"; - - auto decoded = jwt::decode(token); - - for (auto& e : decoded.get_payload_json()) - std::cout << e.first << " = " << e.second << std::endl; -} diff --git a/example/es256k.cpp b/example/es256k.cpp index 5c302f1b2..1993413b7 100644 --- a/example/es256k.cpp +++ b/example/es256k.cpp @@ -1,3 +1,4 @@ +/// @file es256k.cpp #include #include diff --git a/example/jwks-verify.cpp b/example/jwks-verify.cpp index de4b13616..a9e80f240 100644 --- a/example/jwks-verify.cpp +++ b/example/jwks-verify.cpp @@ -1,3 +1,9 @@ +/** + * \file jwks-verify.cpp + * + * Novel example using a JWT's "key ID" to match with a JWK Set + * and using the corresponding x5c from the JWK to verify the token + */ #include #include #include diff --git a/example/partial-claim-verifier.cpp b/example/partial-claim-verifier.cpp index 4f8b41c48..737768c1e 100644 --- a/example/partial-claim-verifier.cpp +++ b/example/partial-claim-verifier.cpp @@ -1,3 +1,4 @@ +/// @file partial-claim-verifier.cpp #include "jwt-cpp/traits/nlohmann-json/defaults.h" #include @@ -77,10 +78,13 @@ YwIDAQAB ec = error::claim_type_missmatch; }; + /* [verifier check custom claim] */ auto verifier = jwt::verify() .allow_algorithm(jwt::algorithm::rs256(rsa_pub_key, "", "", "")) .with_issuer("auth0") + // Check for "foo" in /my-service/role .with_claim("resource-access", role_verifier); + /* [verifier check custom claim] */ try { verifier.verify(decoded); diff --git a/example/print-claims.cpp b/example/print-claims.cpp index 8dd05abba..156e33403 100644 --- a/example/print-claims.cpp +++ b/example/print-claims.cpp @@ -1,9 +1,10 @@ +/// @file print-claims.cpp #include #include int main() { - std::string token = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.AbIJTDMFc7yUa5MhvcP03nJPyCPzZtQcGEp-zWfOkEE"; + std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-" + "1L-FsOjtR6uE-L4E9zJutMWKIe1v1M"; auto decoded = jwt::decode(token); for (auto& e : decoded.get_payload_json()) diff --git a/example/private-claims.cpp b/example/private-claims.cpp index 97c84ae6c..730cf40ed 100644 --- a/example/private-claims.cpp +++ b/example/private-claims.cpp @@ -1,3 +1,4 @@ +/// @file private-claims.cpp #include #include @@ -35,12 +36,14 @@ int main() { const auto api_array = decoded.get_payload_claim("object").to_json().get("api").get("array"); std::cout << "api array = " << api_array << std::endl; + /* [verify exact claim] */ jwt::verify() .allow_algorithm(jwt::algorithm::none{}) .with_issuer("auth.mydomain.io") .with_audience("mydomain.io") - .with_claim("object", from_raw_json) + .with_claim("object", from_raw_json) // Match the exact JSON content .verify(decoded); + /* [verify exact claim] */ return 0; } diff --git a/example/rsa-create.cpp b/example/rsa-create.cpp index d072b67fa..de9f05ce7 100644 --- a/example/rsa-create.cpp +++ b/example/rsa-create.cpp @@ -1,3 +1,4 @@ +/// @file rsa-create.cpp #include #include diff --git a/example/rsa-verify.cpp b/example/rsa-verify.cpp index e2af4095d..68e7d3be0 100644 --- a/example/rsa-verify.cpp +++ b/example/rsa-verify.cpp @@ -1,3 +1,4 @@ +/// \file rsa-verify.cpp #include #include @@ -21,7 +22,13 @@ YwIDAQAB "sGQxiVqtRHKXZR9RbfvjrErY1KGiCp9M5i2bsUHadZEY44FE2jiOmx-" "uc2z5c05CCXqVSpfCjWbh9gQ"; - auto verify = jwt::verify().allow_algorithm(jwt::algorithm::rs256(rsa_pub_key, "", "", "")).with_issuer("auth0"); + /* [allow rsa algorithm] */ + auto verify = jwt::verify() + // We only need an RSA public key to verify tokens + .allow_algorithm(jwt::algorithm::rs256(rsa_pub_key, "", "", "")) + // We expect token to come from a known authorization server + .with_issuer("auth0"); + /* [allow rsa algorithm] */ auto decoded = jwt::decode(token); diff --git a/include/jwt-cpp/base.h b/include/jwt-cpp/base.h index fd3ee281b..c15f89922 100644 --- a/include/jwt-cpp/base.h +++ b/include/jwt-cpp/base.h @@ -68,7 +68,7 @@ namespace jwt { }; namespace helper { /** - * @brief A General purpose base64url alphabet respecting the + * \brief A General purpose base64url alphabet respecting the * [URI Case Normalization](https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1) * * This is useful in situations outside of JWT encoding/decoding and is provided as a helper @@ -101,7 +101,6 @@ namespace jwt { * \brief A collection of fellable functions for working with base64 and base64url */ namespace base { - namespace details { struct padding { size_t count = 0; @@ -248,18 +247,58 @@ namespace jwt { } } // namespace details + /** + * \brief Generic base64 encoding + * + * A Generic base64 encode function that supports any "alphabet" + * such as jwt::alphabet::base64 + * + * \code + * const auto b64 = jwt::base::encode("example_data") + * \endcode + */ template std::string encode(const std::string& bin) { return details::encode(bin, T::data(), T::fill()); } + /** + * \brief Generic base64 decoding + * + * A Generic base64 decoding function that supports any "alphabet" + * such as jwt::alphabet::base64 + * + * \code + * const auto b64 = jwt::base::decode("ZXhhbXBsZV9kYXRh") + * \endcode + */ template std::string decode(const std::string& base) { return details::decode(base, T::data(), T::fill()); } + /** + * \brief Generic base64 padding + * + * A Generic base64 pad function that supports any "alphabet" + * such as jwt::alphabet::base64 + * + * \code + * const auto b64 = jwt::base::pad("ZXhhbXBsZV9kYQ") + * \endcode + */ template std::string pad(const std::string& base) { return details::pad(base, T::fill()); } + /** + * \brief Generic base64 trimming + * + * A Generic base64 trim function that supports any "alphabet" + * such as jwt::alphabet::base64 + * + * \code + * const auto b64 = jwt::base::trim("ZXhhbXBsZV9kYQ==") + * \endcode + */ template std::string trim(const std::string& base) { return details::trim(base, T::fill()); diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 45c61e07a..013701a49 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -77,7 +77,7 @@ #endif /** - * \brief JSON Web Token + * \brief JSON Web Token. * * A namespace to contain everything related to handling JSON Web Tokens, JWT for short, * as a part of [RFC7519](https://tools.ietf.org/html/rfc7519), or alternatively for @@ -153,7 +153,9 @@ namespace jwt { static rsa_error_cat cat; return cat; } - + /** + * \brief Converts JWT-CPP errors into generic STL error_codes + */ inline std::error_code make_error_code(rsa_error e) { return {static_cast(e), rsa_error_category()}; } /** * \brief Errors related to processing of RSA signatures @@ -171,8 +173,7 @@ namespace jwt { get_key_failed, write_key_failed, write_cert_failed, - convert_to_pem_failed, - + convert_to_pem_failed }; /** * \brief Error category for ECDSA errors @@ -204,7 +205,9 @@ namespace jwt { static ecdsa_error_cat cat; return cat; } - + /** + * \brief Converts JWT-CPP errors into generic STL error_codes + */ inline std::error_code make_error_code(ecdsa_error e) { return {static_cast(e), ecdsa_error_category()}; } /** @@ -253,7 +256,9 @@ namespace jwt { static verification_error_cat cat; return cat; } - + /** + * \brief Converts JWT-CPP errors into generic STL error_codes + */ inline std::error_code make_error_code(signature_verification_error e) { return {static_cast(e), signature_verification_error_category()}; } @@ -321,7 +326,9 @@ namespace jwt { static signature_generation_error_cat cat = {}; return cat; } - + /** + * \brief Converts JWT-CPP errors into generic STL error_codes + */ inline std::error_code make_error_code(signature_generation_error e) { return {static_cast(e), signature_generation_error_category()}; } @@ -364,11 +371,15 @@ namespace jwt { static token_verification_error_cat cat = {}; return cat; } - + /** + * \brief Converts JWT-CPP errors into generic STL error_codes + */ inline std::error_code make_error_code(token_verification_error e) { return {static_cast(e), token_verification_error_category()}; } - + /** + * \brief Raises an exception if any JWT-CPP error codes are active + */ inline void throw_if_error(std::error_code ec) { if (ec) { if (ec.category() == rsa_error_category()) throw rsa_exception(ec); @@ -413,6 +424,9 @@ namespace jwt { */ class evp_pkey_handle { public: + /** + * \brief Creates a null key pointer. + */ constexpr evp_pkey_handle() noexcept = default; #ifdef JWT_OPENSSL_1_0_0 /** @@ -600,7 +614,7 @@ namespace jwt { * \brief Convert the certificate provided as base64 DER to PEM. * * This is useful when using with JWKs as x5c claim is encoded as base64 DER. More info - * (here)[https://tools.ietf.org/html/rfc7517#section-4.7] + * [here](https://tools.ietf.org/html/rfc7517#section-4.7). * * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64 decode and return @@ -622,7 +636,7 @@ namespace jwt { * \brief Convert the certificate provided as base64 DER to PEM. * * This is useful when using with JWKs as x5c claim is encoded as base64 DER. More info - * (here)[https://tools.ietf.org/html/rfc7517#section-4.7] + * [here](https://tools.ietf.org/html/rfc7517#section-4.7) * * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64 decode and return @@ -658,7 +672,7 @@ namespace jwt { * \brief Convert the certificate provided as base64 DER to PEM. * * This is useful when using with JWKs as x5c claim is encoded as base64 DER. More info - * (here)[https://tools.ietf.org/html/rfc7517#section-4.7] + * [here](https://tools.ietf.org/html/rfc7517#section-4.7) * * \param cert_base64_der_str String containing the certificate encoded as base64 DER * \param ec error_code for error_detection (gets cleared if no error occurs) @@ -674,7 +688,7 @@ namespace jwt { * \brief Convert the certificate provided as base64 DER to PEM. * * This is useful when using with JWKs as x5c claim is encoded as base64 DER. More info - * (here)[https://tools.ietf.org/html/rfc7517#section-4.7] + * [here](https://tools.ietf.org/html/rfc7517#section-4.7) * * \param cert_base64_der_str String containing the certificate encoded as base64 DER * \throw rsa_exception if an error occurred @@ -795,7 +809,7 @@ namespace jwt { * * The string should contain a pem encoded certificate or public key * - * \deprecated Use the templated version load_private_key_from_string with error::ecdsa_error + * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error * * \param key String containing the certificate encoded as pem * \param password Password used to decrypt certificate (leave empty if not encrypted) @@ -857,7 +871,7 @@ namespace jwt { * * The string should contain a pem encoded certificate or public key * - * \deprecated Use the templated version load_private_key_from_string with error::ecdsa_error + * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error * * \param key String containing the certificate or key encoded as pem * \param password Password used to decrypt certificate or key (leave empty if not encrypted) @@ -874,7 +888,7 @@ namespace jwt { /** * \brief Load a private key from a string. * - * \deprecated Use the templated version load_private_key_from_string with error::ecdsa_error + * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error * * \param key String containing a private key as pem * \param password Password used to decrypt key (leave empty if not encrypted) @@ -1059,11 +1073,10 @@ namespace jwt { return res; } #endif - /** * \brief Load a private key from a string. * - * \deprecated Use the templated version load_private_key_from_string with error::ecdsa_error + * \deprecated Use the templated version helper::load_private_key_from_string with error::ecdsa_error * * \param key String containing a private key as pem * \param password Password used to decrypt key (leave empty if not encrypted) @@ -1084,14 +1097,16 @@ namespace jwt { * JWT (JSON Web Tokens) signatures are typically used as the payload for a JWS (JSON Web Signature) or * JWE (JSON Web Encryption). Both of these use various cryptographic as specified by * [RFC7518](https://tools.ietf.org/html/rfc7518) and are exposed through the a [JOSE - * Header](https://tools.ietf.org/html/rfc7515#section-4) which points to one of the JWA (JSON Web - * Algorithms)(https://tools.ietf.org/html/rfc7518#section-3.1) + * Header](https://tools.ietf.org/html/rfc7515#section-4) which points to one of the JWA [JSON Web + * Algorithms](https://tools.ietf.org/html/rfc7518#section-3.1) */ namespace algorithm { /** * \brief "none" algorithm. * * Returns and empty signature and checks if the given signature is empty. + * See [RFC 7518 Section 3.6](https://datatracker.ietf.org/doc/html/rfc7518#section-3.6) + * for more information. */ struct none { /** @@ -1121,6 +1136,7 @@ namespace jwt { struct hmacsha { /** * Construct new hmac algorithm + * * \param key Key to use for HMAC * \param md Pointer to hash function * \param name Name of the algorithm @@ -1129,6 +1145,7 @@ namespace jwt { : secret(std::move(key)), md(md), alg_name(std::move(name)) {} /** * Sign jwt data + * * \param data The data to sign * \param ec error_code filled with details on error * \return HMAC signature for the given data @@ -1149,6 +1166,7 @@ namespace jwt { } /** * Check if signature is valid + * * \param data The data to check signature against * \param signature Signature provided by the jwt * \param ec Filled with details about failure. @@ -1169,6 +1187,7 @@ namespace jwt { } /** * Returns the algorithm name provided to the constructor + * * \return algorithm's name */ std::string name() const { return alg_name; } @@ -1187,6 +1206,7 @@ namespace jwt { struct rsa { /** * Construct new rsa algorithm + * * \param public_key RSA public key in PEM format * \param private_key RSA private key or empty string if not available. If empty, signing will always fail. * \param public_key_password Password to decrypt public key pem. @@ -1239,6 +1259,7 @@ namespace jwt { } /** * Check if signature is valid + * * \param data The data to check signature against * \param signature Signature provided by the jwt * \param ec Filled with details on failure @@ -1439,7 +1460,6 @@ namespace jwt { } #ifdef JWT_OPENSSL_1_0_0 - auto rr = helper::bn2raw(sig->r); auto rs = helper::bn2raw(sig->s); #else @@ -1796,11 +1816,14 @@ namespace jwt { explicit hs512(std::string key) : hmacsha(std::move(key), EVP_sha512, "HS512") {} }; /** - * RS256 algorithm + * RS256 algorithm. + * + * This data structure is used to describe the RSA256 and can be used to verify JWTs */ struct rs256 : public rsa { /** - * Construct new instance of algorithm + * \brief Construct new instance of algorithm + * * \param public_key RSA public key in PEM format * \param private_key RSA private key or empty string if not available. If empty, signing will always fail. * \param public_key_password Password to decrypt public key pem. @@ -2006,9 +2029,11 @@ namespace jwt { */ namespace json { /** - * \brief Generic JSON types used in JWTs + * \brief Categories for the various JSON types used in JWTs * - * This enum is to abstract the third party underlying types + * This enum is to abstract the third party underlying types and allows the library + * to identify the different structures and reason about them without needing a "concept" + * to capture that defintion to compare against a concrete type. */ enum class type { boolean, integer, number, string, array, object }; } // namespace json @@ -2286,7 +2311,7 @@ namespace jwt { class basic_claim { /** * The reason behind this is to provide an expressive abstraction without - * over complexifying the API. For more information take the time to read + * over complicating the API. For more information take the time to read * https://github.com/nlohmann/json/issues/774. It maybe be expanded to * support custom string types. */ @@ -2300,12 +2325,15 @@ namespace jwt { typename json_traits::array_type, typename json_traits::string_type, typename json_traits::number_type, typename json_traits::integer_type, typename json_traits::boolean_type>::value, - "must staisfy json container requirements"); + "must satisfy json container requirements"); static_assert(details::is_valid_traits::value, "traits must satisfy requirements"); typename json_traits::value_type val; public: + /** + * Order list of strings + */ using set_t = std::set; basic_claim() = default; @@ -3075,17 +3103,22 @@ namespace jwt { struct verify_context { verify_context(date ctime, const decoded_jwt& j, size_t l) : current_time(ctime), jwt(j), default_leeway(l) {} - // Current time, retrieved from the verifiers clock and cached for performance and consistency + /// Current time, retrieved from the verifiers clock and cached for performance and consistency date current_time; - // The jwt passed to the verifier + /// The jwt passed to the verifier const decoded_jwt& jwt; - // The configured default leeway for this verification + /// The configured default leeway for this verification size_t default_leeway{0}; - // The claim key to apply this comparison on + /// The claim key to apply this comparison on typename json_traits::string_type claim_key{}; - // Helper method to get a claim from the jwt in this context + /** + * \brief Helper method to get a claim from the jwt in this context + * \param in_header check JWT header or payload sections + * \param ec std::error_code which will indicate if any error occure + * \return basic_claim if it was present otherwise empty + */ basic_claim get_claim(bool in_header, std::error_code& ec) const { if (in_header) { if (!jwt.has_header_claim(claim_key)) { @@ -3101,6 +3134,13 @@ namespace jwt { return jwt.get_payload_claim(claim_key); } } + /** + * Helper method to get a claim of a specific type from the jwt in this context + * \param in_header check JWT header or payload sections + * \param t the expected type of the claim + * \param ec std::error_code which will indicate if any error occure + * \return basic_claim if it was present otherwise empty + */ basic_claim get_claim(bool in_header, json::type t, std::error_code& ec) const { auto c = get_claim(in_header, ec); if (ec) return {}; @@ -3110,7 +3150,18 @@ namespace jwt { } return c; } + /** + * \brief Helper method to get a payload claim from the jwt + * \param ec std::error_code which will indicate if any error occure + * \return basic_claim if it was present otherwise empty + */ basic_claim get_claim(std::error_code& ec) const { return get_claim(false, ec); } + /** + * \brief Helper method to get a payload claim of a specific type from the jwt + * \param t the expected type of the claim + * \param ec std::error_code which will indicate if any error occure + * \return basic_claim if it was present otherwise empty + */ basic_claim get_claim(json::type t, std::error_code& ec) const { return get_claim(false, t, ec); } @@ -3180,7 +3231,7 @@ namespace jwt { /** * Checks if the given set is a subset of the set inside the token. - * If the token value is a string it is traited as a set of a single element. + * If the token value is a string it is treated as a set with a single element. * The comparison is case sensitive. */ template @@ -3272,7 +3323,7 @@ namespace jwt { public: using basic_claim_t = basic_claim; /** - * Verification function + * \brief Verification function data structure. * * This gets passed the current verifier, a reference to the decoded jwt, a reference to the key of this claim, * as well as a reference to an error_code. @@ -3379,7 +3430,7 @@ namespace jwt { * * According to [RFC 7519 Section 5.1](https://datatracker.ietf.org/doc/html/rfc7519#section-5.1), * This parameter is ignored by JWT implementations; any processing of this parameter is performed by the JWT application. - * Check is casesensitive. + * Check is case sensitive. * * \param type Type Header Parameter to check for. * \param locale Localization functionality to use when comparing @@ -3391,7 +3442,7 @@ namespace jwt { /** * Set an issuer to check for. - * Check is casesensitive. + * Check is case sensitive. * \param iss Issuer to check for. * \return *this to allow chaining */ @@ -3401,7 +3452,7 @@ namespace jwt { /** * Set a subject to check for. - * Check is casesensitive. + * Check is case sensitive. * \param sub Subject to check for. * \return *this to allow chaining */ @@ -3431,7 +3482,7 @@ namespace jwt { } /** * Set an id to check for. - * Check is casesensitive. + * Check is case sensitive. * \param id ID to check for. * \return *this to allow chaining */ @@ -3439,6 +3490,11 @@ namespace jwt { /** * Specify a claim to check for using the specified operation. + * This is helpful for implementating application specific authentication checks + * such as the one seen in partial-claim-verifier.cpp + * + * \snippet{trimleft} partial-claim-verifier.cpp verifier check custom claim + * * \param name Name of the claim to check for * \param fn Function to use for verifying the claim * \return *this to allow chaining @@ -3450,6 +3506,10 @@ namespace jwt { /** * Specify a claim to check for equality (both type & value). + * See the private-claims.cpp example. + * + * \snippet{trimleft} private-claims.cpp verify exact claim + * * \param name Name of the claim to check for * \param c Claim to check for * \return *this to allow chaining @@ -3459,7 +3519,15 @@ namespace jwt { } /** - * Add an algorithm available for checking. + * \brief Add an algorithm available for checking. + * + * This is used to handle incomming tokens for predefined algorithms + * which the authorization server is provided. For example a small system + * where only a single RSA key-pair is used to sign tokens + * + * \snippet{trimleft} example/rsa-verify.cpp allow rsa algorithm + * + * \tparam Algorithm any algorithm such as those provided by jwt::algorithm * \param alg Algorithm to allow * \return *this to allow chaining */ @@ -3685,7 +3753,7 @@ namespace jwt { bool has_x5t_sha256() const noexcept { return has_jwk_claim("x5t#S256"); } /** - * Check if a jwks claim is present + * Check if a jwk claim is present * \return true if claim was present, false otherwise */ bool has_jwk_claim(const typename json_traits::string_type& name) const noexcept { @@ -3693,7 +3761,7 @@ namespace jwt { } /** - * Get jwks claim + * Get jwk claim by name * \return Requested claim * \throw std::runtime_error If claim was not present */ @@ -3701,6 +3769,10 @@ namespace jwt { return jwk_claims.get_claim(name); } + /** + * Check if the jwk has any claims + * \return true is any claim is present + */ bool empty() const noexcept { return jwk_claims.empty(); } /** @@ -3723,11 +3795,19 @@ namespace jwt { template class jwks { public: - using jwk_t = jwk; - using jwt_vector_t = std::vector; - using iterator = typename jwt_vector_t::iterator; - using const_iterator = typename jwt_vector_t::const_iterator; - + /// JWK instance template specialization + using jwks_t = jwk; + /// Type specialization for the vector of JWK + using jwks_vector_t = std::vector; + using iterator = typename jwks_vector_t::iterator; + using const_iterator = typename jwks_vector_t::const_iterator; + + /** + * Parses a string buffer to extract the JWKS. + * \param str buffer containing JSON object representing a JWKS + * \throw error::invalid_json_exception or underlying JSON implation error if the JSON is + * invalid with regards to the JWKS specification + */ JWT_CLAIM_EXPLICIT jwks(const typename json_traits::string_type& str) { typename json_traits::value_type parsed_val; if (!json_traits::parse(parsed_val, str)) throw error::invalid_json_exception(); @@ -3737,7 +3817,7 @@ namespace jwt { auto jwk_list = jwks_json.get_claim("keys").as_array(); std::transform(jwk_list.begin(), jwk_list.end(), std::back_inserter(jwk_claims), - [](const typename json_traits::value_type& val) { return jwk_t{val}; }); + [](const typename json_traits::value_type& val) { return jwks_t{val}; }); } iterator begin() { return jwk_claims.begin(); } @@ -3760,17 +3840,17 @@ namespace jwt { * \return Requested jwk by key_id * \throw std::runtime_error If jwk was not present */ - jwk_t get_jwk(const typename json_traits::string_type& key_id) const { + jwks_t get_jwk(const typename json_traits::string_type& key_id) const { const auto maybe = find_by_kid(key_id); if (maybe == end()) throw error::claim_not_present_exception(); return *maybe; } private: - jwt_vector_t jwk_claims; + jwks_vector_t jwk_claims; const_iterator find_by_kid(const typename json_traits::string_type& key_id) const noexcept { - return std::find_if(cbegin(), cend(), [key_id](const jwk_t& jwk) { + return std::find_if(cbegin(), cend(), [key_id](const jwks_t& jwk) { if (!jwk.has_key_id()) { return false; } return jwk.get_key_id() == key_id; }); @@ -3801,11 +3881,18 @@ namespace jwt { * Default clock class using std::chrono::system_clock as a backend. */ struct default_clock { + /** + * Gets the current system time + * \return time_point of the host system + */ date now() const { return date::clock::now(); } }; /** - * Create a verifier using the given clock + * Create a verifier using the default_clock. + * + * + * * \param c Clock instance to use * \return verifier instance */ @@ -3823,7 +3910,13 @@ namespace jwt { } /** - * Decode a token + * \brief Decode a token. This can be used to to help access important feild like 'x5c' + * for verifying tokens. See associated example rsa-verify.cpp for more details. + * + * \tparam json_traits JSON implementation traits + * \tparam Decode is callable, taking a string_type and returns a string_type. + * It should ensure the padding of the input and then base64url decode and + * return the results. * \param token Token to decode * \param decode function that will pad and base64url decode the token * \return Decoded token @@ -3836,7 +3929,10 @@ namespace jwt { } /** - * Decode a token + * Decode a token. This can be used to to help access important feild like 'x5c' + * for verifying tokens. See associated example rsa-verify.cpp for more details. + * + * \tparam json_traits JSON implementation traits * \param token Token to decode * \return Decoded token * \throw std::invalid_argument Token is not in correct format @@ -3846,15 +3942,29 @@ namespace jwt { decoded_jwt decode(const typename json_traits::string_type& token) { return decoded_jwt(token); } - + /** + * Parse a single JSON Web Key + * \tparam json_traits JSON implementation traits + * \param jwk_ string buffer containing the JSON object + * \return Decoded jwk + */ template - jwk parse_jwk(const typename json_traits::string_type& token) { - return jwk(token); + jwk parse_jwk(const typename json_traits::string_type& jwk_) { + return jwk(jwk_); } - + /** + * Parse a JSON Web Key Set. This can be used to to help access + * important feild like 'x5c' for verifying tokens. See example + * jwks-verify.cpp for more information. + * + * \tparam json_traits JSON implementation traits + * \param jwks_ string buffer containing the JSON object + * \return Parsed JSON object containing the data of the JWK SET string + * \throw std::runtime_error Token is not in correct format + */ template - jwks parse_jwks(const typename json_traits::string_type& token) { - return jwks(token); + jwks parse_jwks(const typename json_traits::string_type& jwks_) { + return jwks(jwks_); } } // namespace jwt diff --git a/include/jwt-cpp/traits/boost-json/defaults.h b/include/jwt-cpp/traits/boost-json/defaults.h index 56615e4e0..21aea7f52 100644 --- a/include/jwt-cpp/traits/boost-json/defaults.h +++ b/include/jwt-cpp/traits/boost-json/defaults.h @@ -47,7 +47,7 @@ namespace jwt { /** * Decode a token - * \tparam Decode is callabled, taking a string_type and returns a string_type. + * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64url decode and * return the results. * \param token Token to decode diff --git a/include/jwt-cpp/traits/boost-json/traits.h b/include/jwt-cpp/traits/boost-json/traits.h index 3b27d5f2f..a421bfd09 100644 --- a/include/jwt-cpp/traits/boost-json/traits.h +++ b/include/jwt-cpp/traits/boost-json/traits.h @@ -8,8 +8,12 @@ // if not boost JSON standalone then error... namespace jwt { + /** + * \brief Namespace containing all the json_trait implementations for a jwt::basic_claim. + */ namespace traits { namespace json = boost::json; + /// basic_claim's JSON trait implementation for Boost.JSON struct boost_json { using value_type = json::value; using object_type = json::object; diff --git a/include/jwt-cpp/traits/danielaparker-jsoncons/defaults.h b/include/jwt-cpp/traits/danielaparker-jsoncons/defaults.h index f2642aa57..d09897d4d 100644 --- a/include/jwt-cpp/traits/danielaparker-jsoncons/defaults.h +++ b/include/jwt-cpp/traits/danielaparker-jsoncons/defaults.h @@ -47,7 +47,7 @@ namespace jwt { /** * Decode a token - * \tparam Decode is callabled, taking a string_type and returns a string_type. + * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64url decode and * return the results. * \param token Token to decode diff --git a/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h b/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h index be56740ca..835d0201d 100644 --- a/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h +++ b/include/jwt-cpp/traits/danielaparker-jsoncons/traits.h @@ -8,7 +8,11 @@ #include namespace jwt { + /** + * \brief Namespace containing all the json_trait implementations for a jwt::basic_claim. + */ namespace traits { + /// basic_claim's JSON trait implementation for jsoncons. struct danielaparker_jsoncons { // Needs at least https://github.com/danielaparker/jsoncons/commit/28c56b90ec7337f98a5b8942574590111a5e5831 static_assert(jsoncons::version().minor >= 167, "A higher version of jsoncons is required!"); diff --git a/include/jwt-cpp/traits/defaults.h.mustache b/include/jwt-cpp/traits/defaults.h.mustache index e3c8fb88b..82a67aeb7 100644 --- a/include/jwt-cpp/traits/defaults.h.mustache +++ b/include/jwt-cpp/traits/defaults.h.mustache @@ -49,7 +49,7 @@ namespace jwt { /** * Decode a token - * \tparam Decode is callabled, taking a string_type and returns a string_type. + * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64url decode and * return the results. * \param token Token to decode diff --git a/include/jwt-cpp/traits/kazuho-picojson/defaults.h b/include/jwt-cpp/traits/kazuho-picojson/defaults.h index 05589faab..eae9789ae 100644 --- a/include/jwt-cpp/traits/kazuho-picojson/defaults.h +++ b/include/jwt-cpp/traits/kazuho-picojson/defaults.h @@ -43,7 +43,7 @@ namespace jwt { /** * Decode a token - * \tparam Decode is callabled, taking a string_type and returns a string_type. + * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64url decode and * return the results. * \param token Token to decode diff --git a/include/jwt-cpp/traits/kazuho-picojson/traits.h b/include/jwt-cpp/traits/kazuho-picojson/traits.h index 2f96bfc01..27a11df4d 100644 --- a/include/jwt-cpp/traits/kazuho-picojson/traits.h +++ b/include/jwt-cpp/traits/kazuho-picojson/traits.h @@ -12,7 +12,11 @@ #include "jwt-cpp/jwt.h" namespace jwt { + /** + * \brief Namespace containing all the json_trait implementations for a jwt::basic_claim. + */ namespace traits { + /// basic_claim's JSON trait implementation for picojson struct kazuho_picojson { using value_type = picojson::value; using object_type = picojson::object; diff --git a/include/jwt-cpp/traits/nlohmann-json/defaults.h b/include/jwt-cpp/traits/nlohmann-json/defaults.h index 0495dbd3f..a5ca8dd1d 100644 --- a/include/jwt-cpp/traits/nlohmann-json/defaults.h +++ b/include/jwt-cpp/traits/nlohmann-json/defaults.h @@ -47,7 +47,7 @@ namespace jwt { /** * Decode a token - * \tparam Decode is callabled, taking a string_type and returns a string_type. + * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64url decode and * return the results. * \param token Token to decode diff --git a/include/jwt-cpp/traits/nlohmann-json/traits.h b/include/jwt-cpp/traits/nlohmann-json/traits.h index 7cf486902..272f3d331 100644 --- a/include/jwt-cpp/traits/nlohmann-json/traits.h +++ b/include/jwt-cpp/traits/nlohmann-json/traits.h @@ -5,7 +5,11 @@ #include "nlohmann/json.hpp" namespace jwt { + /** + * \brief Namespace containing all the json_trait implementations for a jwt::basic_claim. + */ namespace traits { + /// basic_claim's JSON trait implementation for Modern C++ JSON struct nlohmann_json { using json = nlohmann::json; using value_type = json; diff --git a/include/jwt-cpp/traits/open-source-parsers-jsoncpp/defaults.h b/include/jwt-cpp/traits/open-source-parsers-jsoncpp/defaults.h index 9f150c5ee..76663e601 100644 --- a/include/jwt-cpp/traits/open-source-parsers-jsoncpp/defaults.h +++ b/include/jwt-cpp/traits/open-source-parsers-jsoncpp/defaults.h @@ -47,7 +47,7 @@ namespace jwt { /** * Decode a token - * \tparam Decode is callabled, taking a string_type and returns a string_type. + * \tparam Decode is callable, taking a string_type and returns a string_type. * It should ensure the padding of the input and then base64url decode and * return the results. * \param token Token to decode diff --git a/include/jwt-cpp/traits/open-source-parsers-jsoncpp/traits.h b/include/jwt-cpp/traits/open-source-parsers-jsoncpp/traits.h index 16f76f1b1..0f420a233 100644 --- a/include/jwt-cpp/traits/open-source-parsers-jsoncpp/traits.h +++ b/include/jwt-cpp/traits/open-source-parsers-jsoncpp/traits.h @@ -5,7 +5,11 @@ #include "json/json.h" namespace jwt { + /** + * \brief Namespace containing all the json_trait implementations for a jwt::basic_claim. + */ namespace traits { + /// basic_claim's JSON trait implementation for jsoncpp struct open_source_parsers_jsoncpp { using value_type = Json::Value; using string_type = std::string; From 0c313507a95e5f2bcf463a718199e6c9d676adf1 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 11 Jan 2024 13:46:28 -0500 Subject: [PATCH 09/60] error handling --- .github/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 437a7812e..9e10670c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,13 +33,21 @@ jobs: steps: - uses: actions/checkout@v4 - - run: tar -czf /tmp/$NAME.tar.gz . + - run: | + tar -czf /tmp/$NAME.tar.gz . + if [ -f /tmp/$NAME.tar.gz ]; then; else + echo "error:: title=Missing File::File /tmp/$NAME.tar.gz does not exist." + fi - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} asset_path: /tmp/$NAME.tar.gz - - run: zip -r /tmp/$NAME.zip . + - run: | + zip -r /tmp/$NAME.zip . + if [ -f /tmp/$NAME.zip ]; then; else + echo "error:: title=Missing File::File /tmp/$NAME.zip does not exist." + fi - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From c4d61e0ba34e27a40cb3f86a65b95d2d1c061489 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 11 Jan 2024 14:54:03 -0500 Subject: [PATCH 10/60] Update release.yml --- .github/workflows/release.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e10670c5..22c8e0372 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,9 +34,12 @@ jobs: - uses: actions/checkout@v4 - run: | - tar -czf /tmp/$NAME.tar.gz . - if [ -f /tmp/$NAME.tar.gz ]; then; else - echo "error:: title=Missing File::File /tmp/$NAME.tar.gz does not exist." + FILE=/tmp/$NAME.tar.gz + tar -czf $FILE . + if [ -f $FILE ]; then + echo "File $FILE exists." + else + echo "error:: title=Missing File::File $FILE does not exist." fi - uses: shogo82148/actions-upload-release-asset@v1 with: @@ -44,9 +47,12 @@ jobs: asset_path: /tmp/$NAME.tar.gz - run: | - zip -r /tmp/$NAME.zip . - if [ -f /tmp/$NAME.zip ]; then; else - echo "error:: title=Missing File::File /tmp/$NAME.zip does not exist." + FILE=/tmp/$NAME.zip + zip -r $FILE . + if [ -f $FILE ]; then + echo "File $FILE exists." + else + echo "error:: title=Missing File::File $FILE does not exist." fi - uses: shogo82148/actions-upload-release-asset@v1 with: From 1c64b0e3b502975d344fde3dba7bfd9419644054 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 16:51:14 -0500 Subject: [PATCH 11/60] simple conditional trying https://unix.stackexchange.com/a/344207 --- .github/workflows/release.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22c8e0372..8ef47d30a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,11 +36,7 @@ jobs: - run: | FILE=/tmp/$NAME.tar.gz tar -czf $FILE . - if [ -f $FILE ]; then - echo "File $FILE exists." - else - echo "error:: title=Missing File::File $FILE does not exist." - fi + [ ! -f $FILE ] "error:: title=Missing File::File $FILE does not exist." - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} @@ -49,11 +45,7 @@ jobs: - run: | FILE=/tmp/$NAME.zip zip -r $FILE . - if [ -f $FILE ]; then - echo "File $FILE exists." - else - echo "error:: title=Missing File::File $FILE does not exist." - fi + [ ! -f $FILE ] "error:: title=Missing File::File $FILE does not exist." - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From a30c0f75bd23342945952f533c3c154d3a11da0f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 16:57:44 -0500 Subject: [PATCH 12/60] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ef47d30a..a6ba78c2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: - run: | FILE=/tmp/$NAME.tar.gz tar -czf $FILE . - [ ! -f $FILE ] "error:: title=Missing File::File $FILE does not exist." + [ ! -f $FILE ] && "error:: title=Missing File::File $FILE does not exist." - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} @@ -45,7 +45,7 @@ jobs: - run: | FILE=/tmp/$NAME.zip zip -r $FILE . - [ ! -f $FILE ] "error:: title=Missing File::File $FILE does not exist." + [ ! -f $FILE ] && "error:: title=Missing File::File $FILE does not exist." - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From e679f3312b12fe3bb63dfd2baa2b5c88e65fc962 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 18:30:41 -0500 Subject: [PATCH 13/60] back to basics --- .github/workflows/release.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6ba78c2f..a17c2065b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,25 +28,17 @@ jobs: release-asset: runs-on: ubuntu-latest - env: - NAME: jwt-cpp-${{ github.event.release.tag_name }} steps: - uses: actions/checkout@v4 - - run: | - FILE=/tmp/$NAME.tar.gz - tar -czf $FILE . - [ ! -f $FILE ] && "error:: title=Missing File::File $FILE does not exist." + - run: tar -vczf /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} - asset_path: /tmp/$NAME.tar.gz + asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz - - run: | - FILE=/tmp/$NAME.zip - zip -r $FILE . - [ ! -f $FILE ] && "error:: title=Missing File::File $FILE does not exist." + - run: zip -r /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} - asset_path: /tmp/$NAME.zip + asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip From 337de478dd5d6fcb7c7c0ba1e4f9270023a407af Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 18:44:06 -0500 Subject: [PATCH 14/60] exclude .git folder --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a17c2065b..63d1437c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,13 +31,13 @@ jobs: steps: - uses: actions/checkout@v4 - - run: tar -vczf /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . + - run: tar -vczf --exclude='./.git' /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz - - run: zip -r /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . + - run: zip -r -x "./.git/*" /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From dd748ec713330dd68d4ffbc3a94793c32b6c95d0 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 19:13:41 -0500 Subject: [PATCH 15/60] fix order for args --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63d1437c1..a6a821913 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: steps: - uses: actions/checkout@v4 - - run: tar -vczf --exclude='./.git' /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . + - run: tar --exclude='./.git' -vczf /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From 3ed0b790829a403629b9523ce3edb16cf94d96f0 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 19:27:26 -0500 Subject: [PATCH 16/60] protect glob --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6a821913..7850f5edc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: upload_url: ${{ github.event.release.upload_url }} asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz - - run: zip -r -x "./.git/*" /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . + - run: zip -r -x './.git/*' /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From 539850a42107d715791d1678abbed60505a6047e Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 19:44:51 -0500 Subject: [PATCH 17/60] fix order --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7850f5edc..52086100b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: upload_url: ${{ github.event.release.upload_url }} asset_path: /tmp/jwt-cpp-${{ github.event.release.tag_name }}.tar.gz - - run: zip -r -x './.git/*' /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . + - run: zip -x './.git/*' -r /tmp/jwt-cpp-${{ github.event.release.tag_name }}.zip . - uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.release.upload_url }} From c5017b2ad7fb22120872e207e765cffe4a41453d Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 20:01:07 -0500 Subject: [PATCH 18/60] remove remove testing code --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52086100b..7cd7ef531 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,6 @@ on: jobs: nuget: - if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -27,6 +26,7 @@ jobs: run: nuget push *.nupkg -Source 'https://api.nuget.org/v3/index.json' release-asset: + if: github.event_name != 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 723a2d238d0c730610ac698502d5cfaed33187c9 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 22:03:36 -0500 Subject: [PATCH 19/60] compiler openssl on windows --- .github/actions/install/openssl/action.yml | 15 ++++++++++++++- .github/workflows/cross-platform.yml | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 1f94304f4..256252370 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -8,14 +8,27 @@ inputs: runs: using: composite steps: + - uses: ilammy/setup-nasm@v1 - run: | cd /tmp wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz tar -zxf /tmp/${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} + shell: bash + - if: runner.os == Windows + shell: cmd + run: | + %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + perl Configure VC-WIN64A + nmake + nmake install + - if: runner.os == Linux + shell: bash + run: | ./config --prefix=/tmp --libdir=lib make -j $(nproc) sudo make -j $(nproc) install_sw + - shell: bash + run: | echo "OPENSSL_ROOT_DIR=/tmp" >> "$GITHUB_ENV" echo "OpenSSL_ROOT=/tmp" >> "$GITHUB_ENV" - shell: bash diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 5a1211ea8..17628d401 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -13,8 +13,8 @@ jobs: os: [macos-latest, windows-latest, ubuntu-latest] steps: - - if: matrix.os == 'windows-latest' - run: choco install openssl + - if: matrix.os != 'macos-latest' + use: ./.github/actions/install/openssl - if: matrix.os == 'macos-latest' run: sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ From e1dc9e5774a5633fd6d76df31c32353aa772a29c Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 22:12:17 -0500 Subject: [PATCH 20/60] fix string compare --- .github/actions/install/openssl/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 256252370..58c8ec86d 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -15,14 +15,14 @@ runs: tar -zxf /tmp/${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} shell: bash - - if: runner.os == Windows + - if: runner.os == 'Windows' shell: cmd run: | %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" perl Configure VC-WIN64A nmake nmake install - - if: runner.os == Linux + - if: runner.os == 'Linux' shell: bash run: | ./config --prefix=/tmp --libdir=lib From 6587501ace53d6c67cf24cc2e7c247e9e0a4ce3c Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 22:17:26 -0500 Subject: [PATCH 21/60] fix typo --- .github/workflows/cross-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 17628d401..a6ea3c6b1 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -14,7 +14,7 @@ jobs: steps: - if: matrix.os != 'macos-latest' - use: ./.github/actions/install/openssl + uses: ./.github/actions/install/openssl - if: matrix.os == 'macos-latest' run: sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ From 0d125d5392efaf92d3358d9680c1c6f93cd52ad6 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 22:22:06 -0500 Subject: [PATCH 22/60] fix order --- .github/workflows/cross-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index a6ea3c6b1..9a045ab19 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -13,15 +13,15 @@ jobs: os: [macos-latest, windows-latest, ubuntu-latest] steps: + - uses: actions/checkout@v3 + - if: matrix.os != 'macos-latest' uses: ./.github/actions/install/openssl - if: matrix.os == 'macos-latest' run: sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ - - uses: actions/checkout@v3 - run: cmake -E make_directory ${{ github.workspace }}/build - - name: configure shell: bash # access regardless of the host operating system working-directory: ${{ github.workspace }}/build From cba6d37aaeadc239a20e84b14f418d23de2c4c34 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 22:53:02 -0500 Subject: [PATCH 23/60] download with powershell --- .github/actions/install/openssl/action.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 58c8ec86d..a49260d40 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -9,15 +9,15 @@ runs: using: composite steps: - uses: ilammy/setup-nasm@v1 - - run: | - cd /tmp - wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - tar -zxf /tmp/${{ inputs.version }}.tar.gz - cd openssl-${{ inputs.version }} - shell: bash + - if: runner.os == 'Windows' + shell: powershell + run: | + Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - if: runner.os == 'Windows' shell: cmd run: | + tar -zxf /tmp/${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" perl Configure VC-WIN64A nmake @@ -25,6 +25,10 @@ runs: - if: runner.os == 'Linux' shell: bash run: | + cd /tmp + wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + tar -zxf /tmp/${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} ./config --prefix=/tmp --libdir=lib make -j $(nproc) sudo make -j $(nproc) install_sw From 85e9fa66695b2eeb3008c71a896f74e6f065b031 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 16 Jan 2024 23:01:48 -0500 Subject: [PATCH 24/60] write file to the correct directory --- .github/actions/install/openssl/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index a49260d40..5d3d4d723 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -11,6 +11,7 @@ runs: - uses: ilammy/setup-nasm@v1 - if: runner.os == 'Windows' shell: powershell + working_directory: /tmp run: | Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - if: runner.os == 'Windows' From dcb0a118578b813d4fcc392a554dbeb08e3bdc52 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 17 Jan 2024 08:09:40 -0500 Subject: [PATCH 25/60] Update action.yml --- .github/actions/install/openssl/action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 5d3d4d723..1248c60d5 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -17,7 +17,7 @@ runs: - if: runner.os == 'Windows' shell: cmd run: | - tar -zxf /tmp/${{ inputs.version }}.tar.gz + tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" perl Configure VC-WIN64A @@ -33,7 +33,5 @@ runs: ./config --prefix=/tmp --libdir=lib make -j $(nproc) sudo make -j $(nproc) install_sw - - shell: bash - run: | echo "OPENSSL_ROOT_DIR=/tmp" >> "$GITHUB_ENV" echo "OpenSSL_ROOT=/tmp" >> "$GITHUB_ENV" From f37e3a51f9e7ea8691ad8e46dc09c504f6d68d3b Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 17 Jan 2024 08:17:58 -0500 Subject: [PATCH 26/60] Update action.yml --- .github/actions/install/openssl/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 1248c60d5..00c117721 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -11,7 +11,6 @@ runs: - uses: ilammy/setup-nasm@v1 - if: runner.os == 'Windows' shell: powershell - working_directory: /tmp run: | Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - if: runner.os == 'Windows' From b6a1ebdc2f9852e3dabdf73506d522779dc0b676 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 17 Jan 2024 08:45:16 -0500 Subject: [PATCH 27/60] Update action.yml tying https://github.com/ilammy/msvc-dev-cmd --- .github/actions/install/openssl/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 00c117721..633ae383c 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -13,12 +13,13 @@ runs: shell: powershell run: | Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + - if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 - if: runner.os == 'Windows' shell: cmd run: | tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" perl Configure VC-WIN64A nmake nmake install From 2025457eca59c17020f94b06068e1b5eaa1e55fd Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 23 Jan 2024 21:09:04 -0800 Subject: [PATCH 28/60] get more info from msbuild --- .github/workflows/cross-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 900a97198..01d264ccb 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -30,7 +30,7 @@ jobs: - name: build working-directory: ${{ github.workspace }}/build shell: bash - run: cmake --build . + run: MSBUILD_VERBOSITY=Diagnostic cmake --build . - if: matrix.os != 'windows-latest' name: test From 3e3f8b9444bba62af8e347019f7df80f89ba9515 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 23 Jan 2024 21:11:30 -0800 Subject: [PATCH 29/60] install less on windows --- .github/actions/install/openssl/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 633ae383c..4c256002a 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -22,7 +22,7 @@ runs: cd openssl-${{ inputs.version }} perl Configure VC-WIN64A nmake - nmake install + nmake install_sw - if: runner.os == 'Linux' shell: bash run: | From a1f37d1c5f873fa0b7b79b47d487b96fa1fef12e Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 23 Jan 2024 21:39:19 -0800 Subject: [PATCH 30/60] cache openssl + non default install location --- .github/actions/install/openssl/action.yml | 30 ++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 4c256002a..6d6fdc856 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -8,6 +8,13 @@ inputs: runs: using: composite steps: + - name: Cache CMake + id: cache-openssl + uses: actions/cache@v3 + with: + path: openssl-${{ inputs.version }} + key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} + - uses: ilammy/setup-nasm@v1 - if: runner.os == 'Windows' shell: powershell @@ -15,23 +22,30 @@ runs: Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 - - if: runner.os == 'Windows' + - if: runner.os == 'Windows' && steps.cache-openssl.outputs.cache-hit != 'true' shell: cmd run: | tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - perl Configure VC-WIN64A + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl nmake + - if: runner.os == 'Windows' + shell: bash + run: | nmake install_sw - - if: runner.os == 'Linux' + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + - if: runner.os == 'Linux' && steps.cache-openssl.outputs.cache-hit != 'true' shell: bash run: | - cd /tmp wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - tar -zxf /tmp/${{ inputs.version }}.tar.gz + tar -zxf ./${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - ./config --prefix=/tmp --libdir=lib + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib make -j $(nproc) + - if: runner.os == 'Linux' + shell: bash + run: | sudo make -j $(nproc) install_sw - echo "OPENSSL_ROOT_DIR=/tmp" >> "$GITHUB_ENV" - echo "OpenSSL_ROOT=/tmp" >> "$GITHUB_ENV" + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" From 79f16cbaffbe91a0553c732913a5a20139a70cbd Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 23 Jan 2024 21:41:45 -0800 Subject: [PATCH 31/60] delete github provided openssl --- .github/workflows/cross-platform.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 01d264ccb..3cfbc9b4d 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -18,6 +18,8 @@ jobs: - if: matrix.os != 'macos-latest' uses: ./.github/actions/install/openssl + - if: matrix.os == 'windows-latest' + run: rmdir C:\Program Files\OpenSSL - if: matrix.os == 'macos-latest' run: sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ From 3a87a2d1c8be3a9d89874768614e87bfa09148ee Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 23 Jan 2024 21:51:58 -0800 Subject: [PATCH 32/60] add missing cd --- .github/actions/install/openssl/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 6d6fdc856..63788419b 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -32,6 +32,7 @@ runs: - if: runner.os == 'Windows' shell: bash run: | + cd openssl-${{ inputs.version }} nmake install_sw echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" @@ -46,6 +47,7 @@ runs: - if: runner.os == 'Linux' shell: bash run: | + cd openssl-${{ inputs.version }} sudo make -j $(nproc) install_sw echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" From a09bd3844fa8463d24e245e964231555c0e8f380 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 23 Jan 2024 22:19:46 -0800 Subject: [PATCH 33/60] do not build openssl tests --- .github/actions/install/openssl/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 63788419b..1e8e5a12d 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -27,7 +27,7 @@ runs: run: | tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests nmake - if: runner.os == 'Windows' shell: bash @@ -42,7 +42,7 @@ runs: wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz tar -zxf ./${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - ./config --prefix=${{ github.workspace }}/openssl --libdir=lib + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests make -j $(nproc) - if: runner.os == 'Linux' shell: bash From 124fe77f57034512e1ba5ba52955e01967b459f8 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 24 Jan 2024 21:31:27 -0800 Subject: [PATCH 34/60] back to nmake install --- .github/actions/install/openssl/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 1e8e5a12d..a0a872cbd 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -33,9 +33,10 @@ runs: shell: bash run: | cd openssl-${{ inputs.version }} - nmake install_sw + nmake install echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + - if: runner.os == 'Linux' && steps.cache-openssl.outputs.cache-hit != 'true' shell: bash run: | From 887315286d22fa03629bde50f3f94049f04cb12c Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 27 Apr 2024 16:34:22 -0700 Subject: [PATCH 35/60] run cross-platform with default installed SSL libraries --- .github/workflows/cross-platform.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index dd9ec8d70..7e94b37ca 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -14,15 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - - if: matrix.os != 'macos-latest' - uses: ./.github/actions/install/openssl - - - if: matrix.os == 'windows-latest' - run: rmdir C:\Program Files\OpenSSL - - if: matrix.os == 'macos-latest' - run: sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ - - run: cmake -E make_directory ${{ github.workspace }}/build - name: configure shell: bash # access regardless of the host operating system From 76735b9b28c53dc3c2ebd517feea9c02452e01c3 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 27 Apr 2024 16:47:38 -0700 Subject: [PATCH 36/60] rafctor manual install to split OS specific instrcutions --- .github/actions/install/openssl/action.yml | 48 +++---------------- .../actions/install/openssl/linux/action.yml | 32 +++++++++++++ .../install/openssl/windows/action.yml | 37 ++++++++++++++ 3 files changed, 76 insertions(+), 41 deletions(-) create mode 100644 .github/actions/install/openssl/linux/action.yml create mode 100644 .github/actions/install/openssl/windows/action.yml diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index a0a872cbd..d148f5ac0 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -8,47 +8,13 @@ inputs: runs: using: composite steps: - - name: Cache CMake - id: cache-openssl - uses: actions/cache@v3 + - if: runner.os == 'Windows' + uses: ./github/actions/install/openssl/windows with: - path: openssl-${{ inputs.version }} - key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} + version: ${{ inputs.version }} - - uses: ilammy/setup-nasm@v1 - - if: runner.os == 'Windows' - shell: powershell - run: | - Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - - if: runner.os == 'Windows' && steps.cache-openssl.outputs.cache-hit != 'true' - shell: cmd - run: | - tar -zxf ${{ inputs.version }}.tar.gz - cd openssl-${{ inputs.version }} - perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests - nmake - - if: runner.os == 'Windows' - shell: bash - run: | - cd openssl-${{ inputs.version }} - nmake install - echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" - echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + - if: runner.os == 'Linux' + uses: ./github/actions/install/openssl/linux + with: + version: ${{ inputs.version }} - - if: runner.os == 'Linux' && steps.cache-openssl.outputs.cache-hit != 'true' - shell: bash - run: | - wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - tar -zxf ./${{ inputs.version }}.tar.gz - cd openssl-${{ inputs.version }} - ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests - make -j $(nproc) - - if: runner.os == 'Linux' - shell: bash - run: | - cd openssl-${{ inputs.version }} - sudo make -j $(nproc) install_sw - echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" - echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" diff --git a/.github/actions/install/openssl/linux/action.yml b/.github/actions/install/openssl/linux/action.yml new file mode 100644 index 000000000..4c4411d91 --- /dev/null +++ b/.github/actions/install/openssl/linux/action.yml @@ -0,0 +1,32 @@ +name: Install OpenSSL on Linux +description: Install and setup OpenSSL for linking and building test application +inputs: + version: + description: The desired OpenSSL version to install + required: false + default: "openssl-3.2.0" +runs: + using: composite + steps: + - name: Cache OpenSSL + id: cache-openssl + uses: actions/cache@v3 + with: + path: openssl-${{ inputs.version }} + key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} + + - if: steps.cache-openssl.outputs.cache-hit != 'true' + shell: bash + run: | + wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + tar -zxf ./${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests + make -j $(nproc) + + - shell: bash + run: | + cd openssl-${{ inputs.version }} + sudo make -j $(nproc) install_sw + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" diff --git a/.github/actions/install/openssl/windows/action.yml b/.github/actions/install/openssl/windows/action.yml new file mode 100644 index 000000000..8484a9f9c --- /dev/null +++ b/.github/actions/install/openssl/windows/action.yml @@ -0,0 +1,37 @@ +name: Install OpenSSL +description: Install and setup OpenSSL for linking and building test application +inputs: + version: + description: The desired OpenSSL version to install + required: false + default: "openssl-3.2.0" +runs: + using: composite + steps: + - name: Cache OpenSSL + id: cache-openssl + uses: actions/cache@v3 + with: + path: openssl-${{ inputs.version }} + key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} + + - uses: ilammy/setup-nasm@v1 + - if: steps.cache-openssl.outputs.cache-hit != 'true' + shell: powershell + run: | + Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + - if: steps.cache-openssl.outputs.cache-hit != 'true' + shell: cmd + run: | + tar -zxf ${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests + nmake + + - uses: ilammy/msvc-dev-cmd@v1 + - shell: bash + run: | + cd openssl-${{ inputs.version }} + nmake install + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" From 7fd62c728c09d9a7a580e4cc8aa9fea9d432de7c Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sat, 27 Apr 2024 23:07:13 -0700 Subject: [PATCH 37/60] Revert "rafctor manual install to split OS specific instrcutions" This reverts commit 76735b9b28c53dc3c2ebd517feea9c02452e01c3. --- .github/actions/install/openssl/action.yml | 48 ++++++++++++++++--- .../actions/install/openssl/linux/action.yml | 32 ------------- .../install/openssl/windows/action.yml | 37 -------------- 3 files changed, 41 insertions(+), 76 deletions(-) delete mode 100644 .github/actions/install/openssl/linux/action.yml delete mode 100644 .github/actions/install/openssl/windows/action.yml diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index d148f5ac0..a0a872cbd 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -8,13 +8,47 @@ inputs: runs: using: composite steps: - - if: runner.os == 'Windows' - uses: ./github/actions/install/openssl/windows + - name: Cache CMake + id: cache-openssl + uses: actions/cache@v3 with: - version: ${{ inputs.version }} + path: openssl-${{ inputs.version }} + key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} - - if: runner.os == 'Linux' - uses: ./github/actions/install/openssl/linux - with: - version: ${{ inputs.version }} + - uses: ilammy/setup-nasm@v1 + - if: runner.os == 'Windows' + shell: powershell + run: | + Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + - if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + - if: runner.os == 'Windows' && steps.cache-openssl.outputs.cache-hit != 'true' + shell: cmd + run: | + tar -zxf ${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests + nmake + - if: runner.os == 'Windows' + shell: bash + run: | + cd openssl-${{ inputs.version }} + nmake install + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + - if: runner.os == 'Linux' && steps.cache-openssl.outputs.cache-hit != 'true' + shell: bash + run: | + wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + tar -zxf ./${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests + make -j $(nproc) + - if: runner.os == 'Linux' + shell: bash + run: | + cd openssl-${{ inputs.version }} + sudo make -j $(nproc) install_sw + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" diff --git a/.github/actions/install/openssl/linux/action.yml b/.github/actions/install/openssl/linux/action.yml deleted file mode 100644 index 4c4411d91..000000000 --- a/.github/actions/install/openssl/linux/action.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Install OpenSSL on Linux -description: Install and setup OpenSSL for linking and building test application -inputs: - version: - description: The desired OpenSSL version to install - required: false - default: "openssl-3.2.0" -runs: - using: composite - steps: - - name: Cache OpenSSL - id: cache-openssl - uses: actions/cache@v3 - with: - path: openssl-${{ inputs.version }} - key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} - - - if: steps.cache-openssl.outputs.cache-hit != 'true' - shell: bash - run: | - wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - tar -zxf ./${{ inputs.version }}.tar.gz - cd openssl-${{ inputs.version }} - ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests - make -j $(nproc) - - - shell: bash - run: | - cd openssl-${{ inputs.version }} - sudo make -j $(nproc) install_sw - echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" - echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" diff --git a/.github/actions/install/openssl/windows/action.yml b/.github/actions/install/openssl/windows/action.yml deleted file mode 100644 index 8484a9f9c..000000000 --- a/.github/actions/install/openssl/windows/action.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Install OpenSSL -description: Install and setup OpenSSL for linking and building test application -inputs: - version: - description: The desired OpenSSL version to install - required: false - default: "openssl-3.2.0" -runs: - using: composite - steps: - - name: Cache OpenSSL - id: cache-openssl - uses: actions/cache@v3 - with: - path: openssl-${{ inputs.version }} - key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} - - - uses: ilammy/setup-nasm@v1 - - if: steps.cache-openssl.outputs.cache-hit != 'true' - shell: powershell - run: | - Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - - if: steps.cache-openssl.outputs.cache-hit != 'true' - shell: cmd - run: | - tar -zxf ${{ inputs.version }}.tar.gz - cd openssl-${{ inputs.version }} - perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests - nmake - - - uses: ilammy/msvc-dev-cmd@v1 - - shell: bash - run: | - cd openssl-${{ inputs.version }} - nmake install - echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" - echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" From 5766cfc7c78026f5b6a066767b2915460665a0e8 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sat, 27 Apr 2024 23:10:43 -0700 Subject: [PATCH 38/60] drop no-tests since it's nuot supported by 1.1.0 --- .github/actions/install/openssl/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index a0a872cbd..54d0ab16b 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -43,7 +43,7 @@ runs: wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz tar -zxf ./${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib make -j $(nproc) - if: runner.os == 'Linux' shell: bash From af1ba9f2e3127055a8bcf355ff35ecab74bf6005 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sat, 27 Apr 2024 23:49:24 -0700 Subject: [PATCH 39/60] test on windows as well --- .github/workflows/ssl.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 90b90f219..b8797a65a 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -8,16 +8,20 @@ on: jobs: openssl: - runs-on: ubuntu-latest + runs-on: matrix.os strategy: + fail-fast: false matrix: + os: [windows-latest, ubuntu-latest] openssl: - - { tag: "openssl-3.2.0", name: "3.2.0" } - - { tag: "openssl-3.1.4", name: "3.1.4" } + - { tag: "openssl-3.3.0", name: "3.3.0" } + # - { tag: "openssl-3.2.1", name: "3.2.1" } + # - { tag: "openssl-3.1.5", name: "3.1.5" } + # - { tag: "openssl-3.0.13", name: "3.0.13" } - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } - - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } + # - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained + # - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } + # - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } name: OpenSSL ${{ matrix.openssl.name }} steps: - uses: actions/checkout@v4 From f4b77db4826a8d1e4be78a1219cb12ce616b547f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 28 Apr 2024 00:13:20 -0700 Subject: [PATCH 40/60] Update ssl.yml --- .github/workflows/ssl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index b8797a65a..0ce9f12b4 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -8,7 +8,7 @@ on: jobs: openssl: - runs-on: matrix.os + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: From 3da03370aa69b83f05fda7dc5943a53229fa5c16 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 28 Apr 2024 00:24:30 -0700 Subject: [PATCH 41/60] adapt for windows --- .github/workflows/ssl.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 0ce9f12b4..9e4fc7a1c 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -26,16 +26,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest - - uses: ./.github/actions/install/gtest - uses: ./.github/actions/install/openssl with: version: ${{ matrix.openssl.tag }} - name: configure - run: cmake . -DJWT_BUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/tmp - - run: make + run: cmake . -DJWT_BUILD_TESTS=ON + - name: build + run: cmake --build . --target jwt-cpp-test - name: test - run: ./tests/jwt-cpp-test + run: cmake --build . --target jwt-cpp-test-run - if: github.event_name == 'push' && always() uses: ./.github/actions/badge @@ -90,8 +90,8 @@ jobs: strategy: matrix: wolfssl: - - { ref: "v5.6.6-stable", name: "5.6.6"} - - { ref: "v5.5.4-stable", name: "5.5.4" } + #- { ref: "v5.6.6-stable", name: "5.6.6"} + #- { ref: "v5.5.4-stable", name: "5.5.4" } - { ref: "v5.4.0-stable", name: "5.4.0"} name: wolfSSL ${{ matrix.wolfssl.name }} steps: From a30a51f7e9f9e74bdbf5cd16924280c180b1d80b Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 00:59:18 -0700 Subject: [PATCH 42/60] run windows install in cmd prompt trying to avoid https://github.com/ilammy/msvc-dev-cmd?tab=readme-ov-file#name-conflicts-with-shell-bash --- .github/actions/install/openssl/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 54d0ab16b..3cd493fc6 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -30,7 +30,7 @@ runs: perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests nmake - if: runner.os == 'Windows' - shell: bash + shell: cmd run: | cd openssl-${{ inputs.version }} nmake install From 27466103e217ffcc332ffd2b95fc5dcf7973ccf1 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 08:14:16 -0700 Subject: [PATCH 43/60] test more SSL variations --- .github/workflows/ssl.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 9e4fc7a1c..88581e8c5 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -15,13 +15,13 @@ jobs: os: [windows-latest, ubuntu-latest] openssl: - { tag: "openssl-3.3.0", name: "3.3.0" } - # - { tag: "openssl-3.2.1", name: "3.2.1" } - # - { tag: "openssl-3.1.5", name: "3.1.5" } - # - { tag: "openssl-3.0.13", name: "3.0.13" } + - { tag: "openssl-3.2.1", name: "3.2.1" } + - { tag: "openssl-3.1.5", name: "3.1.5" } + - { tag: "openssl-3.0.13", name: "3.0.13" } - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } - # - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - # - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - # - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } + - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained + - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } + - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } name: OpenSSL ${{ matrix.openssl.name }} steps: - uses: actions/checkout@v4 From c7ca3fe99717e482fb2cf210c877ed1d832934ee Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 08:17:30 -0700 Subject: [PATCH 44/60] bump libressl to latest --- .github/workflows/ssl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 88581e8c5..86dd60130 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -63,7 +63,7 @@ jobs: strategy: fail-fast: false matrix: - libressl: ["3.8.2", "3.7.2", "3.6.2"] + libressl: ["3.9.1", "3.8.2", "3.7.3"] name: LibreSSL ${{ matrix.libressl }} steps: - uses: actions/checkout@v4 From 029d691610b6755d79caed9da3dfab0a22b3ad46 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 08:43:17 -0700 Subject: [PATCH 45/60] enable no-tests for openssl>3 this was introduced in 1.1.1 but thats too complicated in batch or shell --- .github/actions/install/openssl/action.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 3cd493fc6..c8357c7c1 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -27,7 +27,13 @@ runs: run: | tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests + + rem Check version using string comparison + if "%openssl_version%" GEQ "3.0.0" ( + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests + ) else ( + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl + ) nmake - if: runner.os == 'Windows' shell: cmd @@ -43,7 +49,13 @@ runs: wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz tar -zxf ./${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - ./config --prefix=${{ github.workspace }}/openssl --libdir=lib + + # Check version using major number comparison + if [[ "${{ inputs.version }}" -ge "3.0.0" ]]; then + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests + else + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib + fi make -j $(nproc) - if: runner.os == 'Linux' shell: bash From d6649b1375cc36cbb2e1e32d65218e5927660680 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 08:52:46 -0700 Subject: [PATCH 46/60] ux and dont push labels twice --- .github/workflows/ssl.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 86dd60130..aea507775 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -22,7 +22,7 @@ jobs: - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } - name: OpenSSL ${{ matrix.openssl.name }} + name: OpenSSL ${{ matrix.openssl.name }} - ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest @@ -37,7 +37,7 @@ jobs: - name: test run: cmake --build . --target jwt-cpp-test-run - - if: github.event_name == 'push' && always() + - if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && always() uses: ./.github/actions/badge with: category: openssl @@ -52,11 +52,12 @@ jobs: - uses: ./.github/actions/install/gtest - uses: ./.github/actions/install/openssl with: - version: "openssl-3.2.0" + version: "openssl-3.3.0" - name: configure - run: cmake . -DJWT_BUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" - - run: make + run: cmake . -DJWT_BUILD_TESTS=ON -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" + - name: build + run: cmake --build . --target jwt-cpp-test libressl: runs-on: ubuntu-latest From 071d01f3fe63003faa0638da167163bb78a840a1 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 09:12:32 -0700 Subject: [PATCH 47/60] old openssl had separate makefile for windows https://github.com/openssl/openssl/issues/4352#issuecomment-700043440 --- .github/actions/install/openssl/action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index c8357c7c1..70ceb9d5b 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -28,13 +28,19 @@ runs: tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} + set openssl_version="${{ inputs.version }}" rem Check version using string comparison if "%openssl_version%" GEQ "3.0.0" ( perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests ) else ( perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl ) - nmake + + if "%openssl_version:~0,2%"=="1.0" ( + nmake -f ms\ntdll.mak + ) else ( + nmake + ) - if: runner.os == 'Windows' shell: cmd run: | From d69cded34ec358b8a8c197e17a7c652a870a2c8b Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 09:16:03 -0700 Subject: [PATCH 48/60] dont use runner name for cache these are no unique and change frequently --- .github/actions/install/cmake/action.yml | 2 +- .github/actions/install/openssl/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/cmake/action.yml b/.github/actions/install/cmake/action.yml index a018583ff..7af442767 100644 --- a/.github/actions/install/cmake/action.yml +++ b/.github/actions/install/cmake/action.yml @@ -15,7 +15,7 @@ runs: uses: actions/cache@v3 with: path: cmake-${{ inputs.version }} - key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }} + key: ${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }} - name: Build cmake if: steps.cache-cmake.outputs.cache-hit != 'true' run: | diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 70ceb9d5b..9b80673f6 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -13,7 +13,7 @@ runs: uses: actions/cache@v3 with: path: openssl-${{ inputs.version }} - key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} + key: ${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} - uses: ilammy/setup-nasm@v1 - if: runner.os == 'Windows' From c1ae547aee3865810561f8419fe672acf1831f4c Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 09:37:50 -0700 Subject: [PATCH 49/60] debug print --- .github/actions/install/openssl/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 9b80673f6..c91ccc62e 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -36,7 +36,9 @@ runs: perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl ) - if "%openssl_version:~0,2%"=="1.0" ( + set openssl_major_minor="%openssl_version:~0,3%" + echo OpenSSL %openssl_major_minor% + if "%openssl_major_minor%" == "1.0" ( nmake -f ms\ntdll.mak ) else ( nmake From e4948d2e1b7ec03896f80669fab6f9a2edf7ea63 Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Sun, 28 Apr 2024 17:43:05 -0700 Subject: [PATCH 50/60] version checks are too hard just limit the testing on windows --- .github/actions/install/openssl/action.yml | 18 ++---------------- .github/workflows/ssl.yml | 10 ++++++++++ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index c91ccc62e..660dc85c6 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -27,22 +27,8 @@ runs: run: | tar -zxf ${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - - set openssl_version="${{ inputs.version }}" - rem Check version using string comparison - if "%openssl_version%" GEQ "3.0.0" ( - perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl no-tests - ) else ( - perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl - ) - - set openssl_major_minor="%openssl_version:~0,3%" - echo OpenSSL %openssl_major_minor% - if "%openssl_major_minor%" == "1.0" ( - nmake -f ms\ntdll.mak - ) else ( - nmake - ) + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl + nmake - if: runner.os == 'Windows' shell: cmd run: | diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index aea507775..8de01403b 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -22,6 +22,16 @@ jobs: - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } + exclude: + - os: windows-latest + tag: "OpenSSL_1_1_0i" + name: "1.1.0i" + - os: windows-latest + tag: "OpenSSL_1_0_2u" + name: "1.0.2u" + - os: windows-latest + tag: "OpenSSL_1_0_1u" + name: "1.0.1u" name: OpenSSL ${{ matrix.openssl.name }} - ${{ matrix.os }} steps: - uses: actions/checkout@v4 From 994427f509101faec08e46703d5be5067ca5fe94 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 12 May 2024 10:31:15 -0700 Subject: [PATCH 51/60] bump openssl --- .github/workflows/jwt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jwt.yml b/.github/workflows/jwt.yml index 21b2ecde6..c5e4fc19a 100644 --- a/.github/workflows/jwt.yml +++ b/.github/workflows/jwt.yml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: openssl: - - { tag: "openssl-3.2.0", name: "3.2.0" } + - { tag: "openssl-3.3.0", name: "3.3.0" } - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } steps: - uses: actions/checkout@v4 From f8baef5518e544e3352680421d4c6bb91c9da590 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 12 May 2024 10:34:05 -0700 Subject: [PATCH 52/60] Update ssl.yml --- .github/workflows/ssl.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 8de01403b..6f3c8cfe5 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -23,6 +23,9 @@ jobs: - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } exclude: + # The older version of OpenSSL were less cross-platform friendly, the Windows builds had a seperate set of builds + # script to build them but it's just a pain to support them, see the failed attempt: + # https://github.com/prince-chrismc/jwt-cpp/pull/35/commits/e4948d2e1b7ec03896f80669fab6f9a2edf7ea63 - os: windows-latest tag: "OpenSSL_1_1_0i" name: "1.1.0i" From 2126bd6e362a4f36abd53d9206710047b923497f Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 12 May 2024 10:46:56 -0700 Subject: [PATCH 53/60] trying different syntax for exclude to see if it's valid --- .github/workflows/ssl.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 6f3c8cfe5..aeff30ba4 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -27,14 +27,14 @@ jobs: # script to build them but it's just a pain to support them, see the failed attempt: # https://github.com/prince-chrismc/jwt-cpp/pull/35/commits/e4948d2e1b7ec03896f80669fab6f9a2edf7ea63 - os: windows-latest - tag: "OpenSSL_1_1_0i" - name: "1.1.0i" + openssl.tag: "OpenSSL_1_1_0i" + openssl.name: "1.1.0i" - os: windows-latest - tag: "OpenSSL_1_0_2u" - name: "1.0.2u" + openssl.tag: "OpenSSL_1_0_2u" + openssl.name: "1.0.2u" - os: windows-latest - tag: "OpenSSL_1_0_1u" - name: "1.0.1u" + openssl.tag: "OpenSSL_1_0_1u" + openssl.name: "1.0.1u" name: OpenSSL ${{ matrix.openssl.name }} - ${{ matrix.os }} steps: - uses: actions/checkout@v4 From b673082c66adb2fb20ea36fbc3287af4aa0c2c3e Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 12 May 2024 10:58:27 -0700 Subject: [PATCH 54/60] trying to use a JSON map for name/tag values of openssl https://stackoverflow.com/a/64405821 --- .github/workflows/ssl.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index aeff30ba4..bff0c3849 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -14,35 +14,31 @@ jobs: matrix: os: [windows-latest, ubuntu-latest] openssl: - - { tag: "openssl-3.3.0", name: "3.3.0" } - - { tag: "openssl-3.2.1", name: "3.2.1" } - - { tag: "openssl-3.1.5", name: "3.1.5" } - - { tag: "openssl-3.0.13", name: "3.0.13" } - - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } - - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } + - "3.3.0" + - "3.2.1" + - "3.1.5" + - "3.0.13" + - "1.1.1w" + - "1.1.0i" # Do not bump, there's a broken in the autoconfig script and it's not maintained + - "1.0.2u" + - "1.0.1u" exclude: # The older version of OpenSSL were less cross-platform friendly, the Windows builds had a seperate set of builds # script to build them but it's just a pain to support them, see the failed attempt: # https://github.com/prince-chrismc/jwt-cpp/pull/35/commits/e4948d2e1b7ec03896f80669fab6f9a2edf7ea63 - os: windows-latest - openssl.tag: "OpenSSL_1_1_0i" - openssl.name: "1.1.0i" + openssl: "1.1.0i" - os: windows-latest - openssl.tag: "OpenSSL_1_0_2u" - openssl.name: "1.0.2u" + openssl: "1.0.2u" - os: windows-latest - openssl.tag: "OpenSSL_1_0_1u" - openssl.name: "1.0.1u" - name: OpenSSL ${{ matrix.openssl.name }} - ${{ matrix.os }} + openssl: "1.0.1u" + name: OpenSSL ${{ matrix.openssl }} - ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest - uses: ./.github/actions/install/openssl with: - version: ${{ matrix.openssl.tag }} - + version: ${{ fromJSON('{"3.3.0": "openssl-3.3.0","3.2.1": "openssl-3.2.1","3.1.5": "openssl-3.1.5","3.0.13": "openssl-3.0.13","1.1.1w": "OpenSSL_1_1_1w","1.1.0i": "OpenSSL_1_1_0i","1.0.2u": "OpenSSL_1_0_2u","1.0.1u": "OpenSSL_1_0_1u"}')[matrix.openssl] }} - name: configure run: cmake . -DJWT_BUILD_TESTS=ON - name: build @@ -54,7 +50,7 @@ jobs: uses: ./.github/actions/badge with: category: openssl - label: ${{ matrix.openssl.name }} + label: ${{ matrix.openssl }} openssl-no-deprecated: runs-on: ubuntu-latest From a9df39724d21c4a824ed50bc26bfb013afcdc167 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 12 May 2024 11:00:19 -0700 Subject: [PATCH 55/60] remove space since that makes editor happy --- .github/workflows/ssl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index bff0c3849..3801ad935 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -38,7 +38,7 @@ jobs: - uses: lukka/get-cmake@latest - uses: ./.github/actions/install/openssl with: - version: ${{ fromJSON('{"3.3.0": "openssl-3.3.0","3.2.1": "openssl-3.2.1","3.1.5": "openssl-3.1.5","3.0.13": "openssl-3.0.13","1.1.1w": "OpenSSL_1_1_1w","1.1.0i": "OpenSSL_1_1_0i","1.0.2u": "OpenSSL_1_0_2u","1.0.1u": "OpenSSL_1_0_1u"}')[matrix.openssl] }} + version: ${{ fromJson('{"3.3.0":"openssl-3.3.0","3.2.1":"openssl-3.2.1","3.1.5":"openssl-3.1.5","3.0.13":"openssl-3.0.13","1.1.1w":"OpenSSL_1_1_1w","1.1.0i":"OpenSSL_1_1_0i","1.0.2u":"OpenSSL_1_0_2u","1.0.1u":"OpenSSL_1_0_1u"}')[matrix.openssl] }} - name: configure run: cmake . -DJWT_BUILD_TESTS=ON - name: build From e8d257d31311d75a7931b192dec64f5b8a2d9ce9 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sun, 12 May 2024 14:14:43 -0700 Subject: [PATCH 56/60] dont download on cache hit + bump action --- .github/actions/install/openssl/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 660dc85c6..100770049 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -4,19 +4,19 @@ inputs: version: description: The desired OpenSSL version to install required: false - default: "openssl-3.2.0" + default: "openssl-3.3.0" runs: using: composite steps: - name: Cache CMake id: cache-openssl - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: openssl-${{ inputs.version }} key: ${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} - uses: ilammy/setup-nasm@v1 - - if: runner.os == 'Windows' + - if: runner.os == 'Windows' && steps.cache-openssl.outputs.cache-hit != 'true' shell: powershell run: | Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz From a9522c68ca7d9167ddc2f9adbae5c0f2130d11f9 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 8 Aug 2024 21:20:19 -0700 Subject: [PATCH 57/60] install openssl sets the env correctly --- .github/workflows/ssl.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 48adf7f4e..7cd1bbf4a 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -40,7 +40,7 @@ jobs: with: version: ${{ fromJson('{"3.3.0":"openssl-3.3.0","3.2.1":"openssl-3.2.1","3.1.5":"openssl-3.1.5","3.0.13":"openssl-3.0.13","1.1.1w":"OpenSSL_1_1_1w","1.1.0i":"OpenSSL_1_1_0i","1.0.2u":"OpenSSL_1_0_2u","1.0.1u":"OpenSSL_1_0_1u"}')[matrix.openssl] }} - name: configure - run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp + run: cmake --preset unit-tests - run: cmake --build --preset unit-tests - name: test run: ctest --preset unit-tests @@ -63,7 +63,7 @@ jobs: version: "openssl-3.3.0" - name: configure - run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" + run: cmake --preset unit-tests -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" - run: cmake --build --preset unit-tests - name: test run: ctest --preset unit-tests From 40a6211e8c566bc580afafb9b211b8f680a62779 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 8 Aug 2024 21:46:19 -0700 Subject: [PATCH 58/60] rm windows specific test --- .github/workflows/cross-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index 738895caa..600cd1c44 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -18,7 +18,7 @@ jobs: run: cmake --preset examples - name: build - run: MSBUILD_VERBOSITY=Diagnostic cmake --build --preset examples + run: cmake --build --preset examples - name: test run: | From c0174fc5b5e418bd6a52706c00bbe20f69d198d2 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Thu, 8 Aug 2024 22:01:40 -0700 Subject: [PATCH 59/60] output failures --- .github/workflows/ssl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 7cd1bbf4a..d61020479 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -43,7 +43,7 @@ jobs: run: cmake --preset unit-tests - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure - if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && always() uses: ./.github/actions/badge From a05fb16a33ea6ffc9a4377833b5ebffad745b7ab Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Tue, 8 Oct 2024 21:40:21 -0700 Subject: [PATCH 60/60] output failures --- .github/workflows/ssl.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index d61020479..caef86785 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -66,7 +66,7 @@ jobs: run: cmake --preset unit-tests -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure libressl: runs-on: ubuntu-latest @@ -87,7 +87,7 @@ jobs: run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=LibreSSL - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure - if: github.event_name == 'push' && always() uses: ./.github/actions/badge @@ -101,9 +101,9 @@ jobs: fail-fast: false matrix: wolfssl: + - { ref: "v5.7.0-stable", name: "5.7.0"} - { ref: "v5.6.6-stable", name: "5.6.6"} - { ref: "v5.5.4-stable", name: "5.5.4" } - - { ref: "v5.7.0-stable", name: "5.7.0"} name: wolfSSL ${{ matrix.wolfssl.name }} steps: - uses: actions/checkout@v4 @@ -117,7 +117,7 @@ jobs: run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=wolfSSL - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure - if: github.event_name == 'push' && always() uses: ./.github/actions/badge