From 3ddac0c776ecb066b9b60d60c5015a322f950113 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Wed, 10 Jan 2024 09:29:46 -0500 Subject: [PATCH] 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 | 226 +++- 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, 1237 insertions(+), 567 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 ac0a023..a018583 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 42d2421..0000000 --- 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 da68441..da10cb7 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 751d595..dc994bd 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 badf330..870a363 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 9aea7c8..803bbae 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 +## Getting Started -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: +Installation instructions can be found [here](docs/install.md). -| 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] | | | - -> ℹ️ 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 - -## 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 - -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! -### Providing your own JSON Traits +### Configuration Options -To learn how to writes a trait's implementation, checkout the [these instructions](docs/traits.md) +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) + +#### Base64 Options + +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 0000000..3a5b63a --- /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 0000000..1c15915 --- /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 41343d7..2d8c8a8 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_FONTNAME = Helvetica +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=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_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_FONTSIZE = 10 +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# 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. +# 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_NODE_ATTR = "shape=box,height=0.2,width=0.4" + +# 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 5b70a57..324c6be 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 0000000..f5b633c --- /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 0000000..279c2df --- /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 419b7d2..359e9f3 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 4f001ac..f24e648 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.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] | | | + +> [!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 + ## 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 71eddb6..caa12b8 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 7bd897c..0000000 --- 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 8032ffd..0000000 --- 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 b2a27f1..0000000 --- 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 9095ccb..0000000 --- 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 5c302f1..1993413 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 de4b136..a9e80f2 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 4f8b41c..737768c 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 8dd05ab..156e334 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 97c84ae..730cf40 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 d072b67..de9f05c 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 e2af409..68e7d3b 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 fd3ee28..c15f899 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 45c61e0..013701a 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 56615e4..21aea7f 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 3b27d5f..a421bfd 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 f2642aa..d09897d 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 be56740..835d020 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 e3c8fb8..82a67ae 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 05589fa..eae9789 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 2f96bfc..27a11df 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 0495dbd..a5ca8dd 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 7cf4869..272f3d3 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 9f150c5..76663e6 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 16f76f1..0f420a2 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;