413 Commits

Author SHA1 Message Date
Dominik Thalhammer
1e9b1354e1 🐛 Fix recursion in count_padding (#432) 2026-10-06 17:53:56 +02:00
Chris Mc
0a503e7508 ⬆️ Upgrade boost json to v1.90.0 (#425)
replace deprecated standalone with full release with one component
2026-04-02 10:58:46 -07:00
Chris Mc
3e037df3e6 🧹 Improve linters for traits (#424)
* quick poc at using cmake to generate the defaults.h traits files

* add test preset to dev

* self review

* poc moving logic to actions

* Remove stale defaults.h generation configuration

* Fix file path in lint workflow configuration

* chmod +x

* linter

* linter

* clean up action and lint workflow

* rm source_dir cli arg from cmake script

now just assume the current directory is correct

* linter

* fix order

* add workflow preset for running unit test

sadly then is less reusable than i wanted
2026-03-24 18:11:15 -07:00
JurgenLB
78c07912d0 🔸 MSVC warnings (#422)
* undo unwanted changes from #405 and #408

* Cast asInt64 result to integer_type

* Fix double type handling for int64_type

* unwanted change

---------

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2026-03-24 16:24:30 -07:00
Chris Mc
a751ea2272 🌱 Utilize gtest's TypeParam to change traits implementation during testing (#423)
* utilize TypeParam to change traits implementation

explains why coverage hits were so slow

* fixup danielaparker-jsoncons locally

* fixup open_source_parsers_jsoncpp

tested locally

* cleanup lcov args

* add install script for osp/jsoncpp

* linting

* install script for boost

* boost outputs json in different order

this si allowed so the tests are now more relaxed when matching tokens

* update gtest to install gmock as well

* update gtest

* add default version for gtest

* lower gtest for min cmake compat test

* fix typo

* find gtest package is now config

* add back install for lcov

* try forcing install on

* debug print cmake cache file from gtest

* try install with make directly

* workaround for gtest 1.16 cmake install

* lower gtest to match cmake_min_versions

* enable picojson lint tests generation

* move negative decode tests

* linter

* explicit trait test for picojson

* lint
2026-03-17 19:48:25 -07:00
Chris Mc
df914eba76 🪞 Add support for reflect-cpp's JSON (#421)
* add reflect json traits

* jwt-cpp defaults

* fix clang tidy warnings

* fix clang tidy warnings

* rename directory

* add tests

* add tests

* add tests

* replace unnecessary copy with move

* gate reflect cpp tests behind flag

* reflect cpp CI work

* reflect-cpp example

* reflect-cpp CI

* reflect-cpp CI

* match naming + update ci

* first pass code review

* linter

* linter

* align naming

* make file +x

* align target name

fix order or targets in tests

* fix typo

* Fix target_link_libraries syntax for jwt-cpp

* cleanup example code

* add reflect-json to coverage tests

---------

Co-authored-by: Ali Girayhan Ozbay <aligirayhan.ozbay@abex.capital>
Co-authored-by: Ali Girayhan Özbay <aligirayhan@ozbay.org>
2026-03-09 22:19:31 -07:00
Chris Mc
b12ab284d3 💡 Reorder and add C++ tools in extensions.json (#420)
drop no longer support CMake extension
2026-03-06 21:12:59 -08:00
Chris Mc
75dd7aa5c1 📈 Expanding testing coverage to all JSON trait implementations (#419)
* typed tests for all the various json implementation

more coverage of all the various traits

* Configure LCOV_OPTS for coverage reporting

Add LCOV_OPTS to ignore errors in coverage report

* linter

* Update LCOV_OPTS to ignore multiple mismatch errors

* Configure LCOV to ignore mismatches

Added configuration for LCOV to ignore mismatches in coverage reports.

* try to pass lcov args + cleanup excludes

* directly pass lcov args

* fix min cmake req

prepend is 3.15, seems overkill
2026-03-06 20:44:55 -08:00
Chris Mc
5ee8567d4a Add Glaze Support (#417)
* feat: add glaze traits

* fix: format

* name glaze_json, add to ci, add example

* code review

* linter

* disable linter for glaze tests

* add badge to docs for new library

---------

Co-authored-by: Curve <fynnbwdt@gmail.com>
2026-03-02 20:25:31 -08:00
Chris Mc
58622a3f01 🏷️ Set version to 0.7.2 + Document release steps (#414)
updated doxygen to 1.14.0 and doxygen-awesome-css to 2.4.1
2026-02-25 17:55:44 -08:00
Chris Mc
6a0a9a2e5a ⬆️ Update tests to the latest versions of OpenSSL (#413)
asan and matrix for latest releases across all versions. Add back badges for older paid support releases and cleanup docs
2026-02-20 21:14:53 -08:00
Chris Mc
2e16efe5da 💾 Fix CMake cache key to support both runner and container based jobs (#411)
* Fix CMake cache key to use container image fallback

* fix cache key for containers

* pass cache key in one level higher

* store info one level higher

again

* try $env:ImageOS

* capture it from a step

maybe

* steal cache key logic from setup-go  action

* cleanup + comment explanation

* spelling
2026-02-18 14:18:58 -08:00
Chris Mc
c5a1fb5e7a 📜 Separated install scripts for jsonsonc. libressl, and wolfssl (#412)
* Extra install scripts for jsonconc. libressl, and wolfssl

this make it easier to run locally when testing

* make script exe

plus cleanup
2026-02-18 11:37:04 -08:00
Ramtin Nouri
971b897d7b 🔑 Support Ed25519 for LibreSSL 3.7.1+ (#407)
* Support Ed25519 for LibreSSL 3.7.1+

* fix EdDSACertificate error code test for new implementation

---------

Co-authored-by: Chris McArthur <prince.chrismc@gmail.com>
2026-02-16 21:02:20 -08:00
Chris Mc
179beb3627 ⬆️ Update LibreSSL version up to 4.2.1 (#410)
* Update LibreSSL version to 4.2.1 in CI configuration and documentation

* update OpenSSLErrorTest for LibreSSL 4.2.0+

Add Linux LibreSSL support in CMake presets

* add debug output to failure for all ssl libraries

* fix type in libressl version check

* chore: lint
2026-02-16 20:03:33 -08:00
JurgenLB
91848add8f Additional Appveyor warnings (#408)
* Fix lcov line number mismatch for ClaimTest::AudienceAsString (#1)

* Add blank line before TEST macro to fix coverage line mismatch

* Verify tests pass after fix

* Remove CodeQL build artifacts and update .gitignore

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JurgenLB <77586573+JurgenLB@users.noreply.github.com>

* Remove blank line

* Add concurrency to traits job

Add concurrency settings to traits job in workflow

* Additional spacing added to prevent geninfo line mismatch errors

* Fix concurrency group in traits workflow to prevent job cancellations

* fix-msvc-type-trait-warnings

* Apply clang-format

* Fix formatting issues

* Fix formatting issues in jwt.h

* format

* Update jwt.h

* Remove unwanted reference

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-02-16 10:47:27 -08:00
Chris Mc
ca96081348 Bump OpenSSL versions in CI configuration and documentation (#406) 2026-02-16 09:24:48 -08:00
JurgenLB
0b4fecead6 Cast data size to unsigned int (#405)
* Cast data size to unsigned int

* correcting CI worktree

* Add LCOV_ARGS to Fix geninfo line mismatch error

* Add unused error ignore to LCOV_ARGS

* Refactor Format to match lint requirements

* Fix formatting in CMakeLists.txt for coverage setup

* Fix coverage setup for jwt-cpp-test
2026-02-08 20:51:20 -08:00
JurgenLB
b0ea29a58f AppVeyor Warnings (#403)
* Add size checks before casting to int

Added checks to ensure sizes fit into int before casting.

* Fix windows build without NOMINMAX

---------

Co-authored-by: Dominik Thalhammer <thalhammer.d@googlemail.com>
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2025-12-29 14:52:29 +01:00
Ilya Andreev
b89a5b1cb5 Fix set_expires_in not accepting non-default Period (#402) 2025-12-29 14:08:15 +01:00
MarchMore
7fc762d7d6 Migrate time_t to chrono equivalents (#401) 2025-12-01 11:01:03 +01:00
Oliver Freyermuth
3972ac2d17 CMake: synchronize cmake_minimum_required from main CMakeLists.txt (#398)
The examples have been using older cmake_minimum_required,
given support for versions <3.10 is deprecated since 3.31,
synchronize the minimum required version from the main CMakeLists.txt
(version 3.14) into examples and tests.

closes #397
2025-10-24 17:43:17 -07:00
Eero Aaltonen
cf0dab1263 Fix error in CMake config-file package (#387)
Fixes error
```
  The link interface of target "jwt-cpp::jwt-cpp" contains:

    picojson::picojson>

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.
```

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2025-06-19 15:35:27 -07:00
Dominik Thalhammer
0c676f86b7 👷 Update CMP0135 to new behaviour (#385)
closes #384
2025-05-27 11:16:31 +02:00
sandro97git
9f07905f98 Support passing ssl library key handles to algorithms (#369)
* Support passing ssl library key handles to algorithms

* Support passing public keys too for ssl library key handles

* add documentation to ecdsa constructor

* Support passing ssl library rsa keys

* reformat code

---------

Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2025-05-14 05:44:43 -04:00
Chris Mc
0ab9469c7d Update workflows for new GitHub Action Runner Images (#382)
* use ubuntu-latest + update actions/cache

* performance-avoid-endl

https://clang.llvm.org/extra/clang-tidy/checks/performance/avoid-endl.html

* misc-const-correctness

https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html

* misc-const-correctness

https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html

* formatting

* clang format and tidy and already installed

https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#language-and-runtime

* explict clang-format-14

* disable include cleaner

* format

* format

* install lcov to get patching geninfo for gcc 13

* revert "install lcov to get patching geninfo for gcc 13"
2025-05-13 17:35:46 -04:00
Chris Mc
5a4c6ebc17 Fix linter error (#381)
introduced in Thalhammer#378
2025-05-13 11:36:41 -04:00
Damiano Mazzella
d3b93ef1e3 update trait dependencies to support CMake v4 (#379)
* update nlohmann-json to 3.12.0 (fix cmake min version)

* Bump fetch ver

Needs new md5

* 3.12 md5

* Limit hunter cmake version

* bump jsoncpp version to v1.9.6 as well

* bump workflow as well as default

---------

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2025-05-13 10:44:51 -04:00
Damiano Mazzella
82e5dae762 Update jsoncons trait to support v1 release (#375)
* Update traits.h

* fix actions fails

* update version of jsoncons warkflow traits and install action

* update example/traits/danielaparker-jsoncons.cpp

* Drop support of the 0.x release of jsoncons

* Update jsoncons to 1.3.2 and nlohmann-json to 3.12.0

* revert the changes for nlohmann-json

---------

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2025-05-13 10:16:48 -04:00
ambiennt
f54fe2bd40 Fix as_date: Avoid narrowing conversion, addressing C4244 warning (#378) 2025-05-13 10:10:22 -04:00
Chris Mc
e71e0c2d58 Update version to 0.7.1 (#373) 2025-03-09 22:00:21 -07:00
Dominik Thalhammer
482f4f1c05 ⬆️ Update Thalhammer/patch-generator-action (#370) 2025-02-25 11:15:40 +01:00
Omar Mohamed Khallaf
71c3d36507 Ensure array_type has front() method + fix array_type on jsoncpp (#361)
* Use operator[] instead of front to support jsoncpp

Replace the `front()` with `[0]` as front is not supported by jsoncpp on
array types.

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>

* Revert "Use operator[] instead of front to support jsoncpp"

This reverts commit dfa7d29dae9d3b3cc1d8a434bc8e5ca330e6202f.

* Implement `front()` in jsoncpp array_type

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>

* Check if array_type has a front() method

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>

* Add `front()` to jsoncons array_type

* Remove non-const overloads of front()

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>

* Fix check for front() in array_type

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>

* Use std::decay

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>

* fix example to print array value

* expose base class ctors

* update as_array traits helper

* fixup linter

---------

Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2024-11-16 20:58:16 -08:00
Marcel
59cdb435db Refactor base64 decoding to use a lookup table (#364)
* Refactor base64 decoding to use a lookup table

* Refactor base64 decoding to use a lookup table - clang format adaptions
2024-11-16 17:06:29 -08:00
Daniel Nicoletti
6dd190d154 Update CMakeLists.txt (#365)
Specify C++ language to avoid searching for C compiler
2024-11-02 10:10:36 +01:00
Chris Mc
83703d718a Add testing with RSA keys encrypted with a passphrase (#360)
* add testing with rsa and a passphrase

* fix name and disable 1.0.2

* enable ctest output on failure

* re-enable test for 1.0.2

* try keys generated with older openssl

* drop 1.0.2 and older since they used a non-standard format for encrypt private keys
2024-09-01 17:23:05 -07:00
Tom Hughes
c870903d9f Add helper for making EC key from components (#358) 2024-08-08 21:44:30 -07:00
Juliusz Sosinowicz
a968dfe4f7 Fix build and tests for wolfSSL (#352)
* Fix build and tests for wolfSSL

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>

* Remove unnecessary symbols

* Don't fail fast on wolfSSL actions

* Include wolfssl/options.h explicitly

* Fix old wolfSSL failures

* remove unused EVP_PKEY_get1_RSA

this is deprecated with 3.0

* code review comments

* Apply suggestions from code review

* rm extra headers?

* fix cmake test

use the new macro that was required

* linter

* fix unused warning fail_HMAC

* reenable fail fast

* fix spelling

---------

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2024-07-29 08:14:34 -07:00
KidDigital
b36e8a9886 Jsoncpp traits no longer uses deprecated Reader (#357)
* Jsoncpp traits no longer uses depricated Reader

* linter changes

---------

Co-authored-by: Christopher McArthur <prince.chrismc@gmail.com>
2024-07-28 21:52:59 -07:00
Chris Mc
3376880740 Disable gcc-4.8 since node20 is now required (#356) 2024-07-18 07:09:35 -07:00
Chris Mc
a6927cb814 Add support for CMake Presets (#348)
* dev container + vscode extensions

* exploring cmake presets for CI

* ignore user presets

* add configure to build preset

windows ran in debug, which means the multi config needs more help

* coverage preset

* creating a fuzzing preset

* fuzzing fix cwd + more configs to preset

* move cmake set vars to right section

https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-170

"You can set C and C++ compilers by using cacheVariables.CMAKE_C_COMPILER and cacheVariables.CMAKE_CXX_COMPILER in a Configure Preset. It's equivalent to passing -D CMAKE_C_COMPILER=<value> and -D CMAKE_CXX_COMPILER=<value> to CMake from the command line."

* fix workdir for new fuzz run targets

* split up presets into more files

* fix include order (liking this less)

* add asan to presets

* fix copy paste

* add asan build preset

* move ubsan to presets

* replace mustache with a cmake script

* touch ups

* restore file to void merge conflicts

* fix order for args

* remove action wrapper

more quotes for inputs

* revert bad render of boost_json

* fix casing

* format changes

* test to see if output is working

* last try

* git revert moving mustache to cmake

* cmake not enough for presets

* drop ci prefix

* new test for `library_ROOT` search path

* install with presets

* cmake --install does not take a preset

* install with preset is not yet supported

https://gitlab.kitware.com/cmake/cmake/-/issues/23208

* add missing build step

* more global fuzzing flags to toolchain file

* fixup toolchain in presets

* fix pathing and limit configs to tested platforms

* clean up + use presets for clang-tidy

* dry up sanitizer flags

* try install with a preset

* remove duplicated test

* notes about hunter test

* skip checking the compiler since this causes errors with the same CMake uses in combinations with the fuzz sanitizer flag

https://github.com/prince-chrismc/jwt-cpp/actions/runs/7481024827/job/20361722539?pr=33

```
    /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x22
    CMakeFiles/cmTC_ff7c6.dir/testCCompiler.c.o: in function `main':
    testCCompiler.c:(.text.main[main]+0x0): multiple definition of `main'; /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerMain.cpp.o):(.text.main+0x0): first defined here
    /usr/bin/ld: /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerMain.cpp.o): in function `main':
    (.text.main+0x12): undefined reference to `LLVMFuzzerTestOneInput'
```

* remove system name to disable cross compiling

* tests do not pass clang-tidy

* drop toolchain, use target specific flags

* leave flags in cmake

* missing deps + clean apt files

* remove some code duplication

* fix typo

* devcontainers fix, test and add wolfssl

refactored installer to have a script that could be reused

* add missing build context

* pass version to script

* dont use bash syntax

* fix typo

* upload tar.gz for new releases

* revert name to manually trigger it

* Update and rename nuget.yml to release.yml

* disable nuget for testing

* add a zip as well

* back to basics

* remove remove testing code

* update workflow name

* enable testing needs to be in the root

* add a test preset and use it in some workflows

* fix linting tests

* bump github actions

* bump python setup

* drop dev containers

* dont install openssl on windows

* revert merge conflicts

* fix whitespace

* fix private claims example to have a valid token

#351

* put back versioned format

I dont remember why, it looks like it was debugging
2024-06-15 07:52:23 -07:00
Chris Mc
0d03bc5bc8 Support new Action macOS Runners (#347)
* trying to grab a macos14 arm with different openssl install

* lets see if last weeks works

* test is older macos still needs workaround

* just use latest
2024-04-27 16:48:23 -07:00
Justen Di Ruscio
461162ca79 Default constructor for jwks object (#346)
* correct invalid link to traits.md

* default constructor for jwks

* Update comment of default constructor

* apply automatically generated patch from CI. Damn, that's cool

* test JWKs default c'tor using deduced jwt::jwk from available traits

* rm unused type_traits from test

* apply auto format to jwkstest

---------

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2024-04-23 20:15:31 -07:00
Chris Mc
1611f58310 Add a test for how to cache the jwk (#345) 2024-04-22 08:37:34 -07:00
Chris Mc
f698216008 Add addition CMake "run" targets to simplify calling exes (#344)
* Add addition CMake "run" targets to simplify calling exes

* fix bad replace
2024-04-22 08:08:35 -07:00
Chris Mc
e9cd684d02 Add token format test from #341 (#343)
* Update TokenFormatTest.cpp

* Update TokenFormatTest.cpp

* Update TokenFormatTest.cpp

* cleanup test for issue

* clang-format
2024-04-20 13:34:09 -07:00
Justen Di Ruscio
d53e01333e Find nlohmann_json dependency only when required (#342)
* only find nlohmann_json test dep when required

* provide config-variable JWT_EXTERNAL_TEST_NLOHMANN_JSON

* be a doll and make PICOJSON variables dependent

* dont mention test in the option name

I think in the longer term we'll probably switch to this since it;s maintained unlike the current default

---------

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2024-04-20 12:07:32 -07:00
Yurun
bd682eddba Fix demo code in README.md (#336) 2024-03-30 20:26:20 -07:00
Gareth Sylvester-Bradley
364a5572f4 Fix MSVC 32bit compiler warning (#331) 2024-02-17 09:09:26 -05:00
Erwan Legrand
3e029c7efd Minor cleanup: remove unused header (#329)
Co-authored-by: Erwan Legrand <elegrand@proofpoint.com>
2024-02-06 11:04:51 +01:00