Commit Graph

17 Commits

Author SHA1 Message Date
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
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
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
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
fb8fe65234 Refactor traits validation to reduce code bloat (#261)
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2022-10-31 19:54:19 +01:00
Chris Mc
5c9787ebca 🚢 Provide trait implementation for supported JSON libraries (#193)
* quick poc for Thalhammer#174

* Copy paste

* Rename include/jwt-cpp/traits/traits.h to include/jwt-cpp/traits/danielaparker-jsoncons/traits.h

* Create traits.h

* adding a namespace

* mustache + action to automate defaults generation

since they should always be the same

* fix order

* traits tests should use traits

* playing with header order

to make clang happy

* install all possible traits 

switch badge name to sha

* Update CMakeLists.txt

* Update traits.h

* try commenting corrected code

* rm typescript

* make sure to implace edit

* dont comment when no diff

* apply linting

* fixup boost-json traits

* move comment and render to composite action

* actions/github-script does not leave context in the usual spot

* enabled globstar

* make sure to forward inputs

* try using env normally

* fix typo

* pass in linter name correctly

* debug print

* fix linting issues

* more debug printing

* fix linting issues

* fix typpo + more rebug print

* apply linting

* more debug

* try npm install global to be less intrusive

* wip render traits tests

* Update lint.yml

* global install does not work

* Update action.yml

* Update defaults.h

* remove nodejs action poc

* include jsoncons in main test application (for coverage of new files)

* do not exclude json (since it's used by all the traits)

* exclude bundled json libraries

* apply linting

* add jsoncons for coverage testing

* jsoncons set default to a viable version

* exploring ci failure

* Revert "exploring ci failure" it's overlapping symbols

This reverts commit 3d5b7f9f5d4f393f03b84a59557fecdee833c822.

* add missing specialization

* be explicit with the tests

* Create CMakeLists.txt

* Create danielaparker-jsoncons.cpp

* Update lint.yml

* Update traits.yml

* lint

* better access too decoded claims

* more tests on verify

* tweak test

trying to find minimum

* lets enable linting tests

* using env impl for github script

* fix typo

* apply linting

* add boost to the tests (very hacky)

* Update lint.yml

* ceate light boost installer

there is no cmake install anymore so just a blanket copy should do

* remove path requirement

* outline for commit and push linting on comment

* try different webhook target

* more event types

* fix if for more event types

* just a test commit

* Update lint.yml

* Update lint.yml

* Update lint.yml

* Apply automatic changes

* add token

* screw up formatting

* Update lint.yml

* Update lint.yml

* Apply automatic changes

* fix merge conflicts

* missing errors

* playing with globbing

* lint issues

* matrix on comment should give many pushes

* Apply automatic changes

* Update lint.yml

* Apply automatic changes

* Apply automatic changes

* fix rebase

* apply render tests

* Apply automatic changes

* Apply automatic changes

* Delete package-lock.json

* fail linting

* Update .gitignore

* Update lint.yml

* Update lint.yml

* Update lint.yml

* Apply automatic changes

* Update lint.yml

* Update CMakeLists.txt

* refactor boost.json inclusion

- find paths
- compile library
- code coverage
- traits example

* Apply automatic changes

* debug log

* Update action.yml

* debug output

* Update action.yml

* Delete private-boost-json.cpp.in

* Update private-find-boost-json.cmake

* Update CMakeLists.txt

* Update CMakeLists.txt

* Create CMakeLists.txt

* Update boost-json.cpp

* Update boost-json.cpp

* Update boost-json.cpp

* Update boost-json.cpp

* remove old boost tests

* examples to include traits

* fix compilation

* test nlohmann json traits

* linting

* refactor traits to make badges

* try with less expression syntax

* trying single quotes

* advertise traits support

* Update lint.yml

* Update lint.yml

* Update lint.yml

* sync (prince-chrismc/jwt-cpp#16)

* 🔧 Replace RSA related deprecated functions (#189)

* RSA_size() --> EVP_PKEY_size()

* getting rid of deprecated functions in rsa-pss signature creation

* getting rid of deprecated functions in rsa-pss signature verification

* generate_hash not used in pss

* Update lint.yml

* Update lint.yml

* Update lint.yml

Co-authored-by: Marek Klein <kleinmrk@gmail.com>

* Update lint.yml

* make sure to use install `nlohmann-json`

* make action folder match trait names

* add example + badge for kazuho-picojson

* link to new examples

* revert debug code

* dont mix matrix with uses

* fix bad copy paste

* spec interface library so it's no compiled

* fix installer

* fix to interface

* fix example

* attempt 2

* make sure to avoid circular reference

* attempt 3

* white space

* white space

* Update and rename .github/actions/comment-linting/action.yml to .github/actions/process-linting-results/action.yml

* Update lint.yml

* Update action.yml

* Update action.yml

* Update README.md

Co-authored-by: prince-chrismc <prince-chrismc@users.noreply.github.com>
Co-authored-by: Marek Klein <kleinmrk@gmail.com>
2022-01-17 14:05:01 -08:00
Chris Mc
3d501217a3 🧰 Adding clang-tidy, cmake-format, and ASAN tests (#168)
* adding clang-tidy and asan tests

Playing with clang-tidy, we already had the rule removed in #166... running the static analyzer from CMake reproduced the report in many places... I suspect the macro and `new`/`delete` separation clang-tidy is just unable to understand.

Running the problematic examples + tests with the ASAN enabled reported no problems

* Apply suggestions from code review

* Update lint.yml

* applying linting rules

* fix bad rename

* formating

* clang-tidy on jsoncons tests

* and cmake-format to lint

* cmake format improve change detection

* Update lint.yml

* apply linting
2021-09-17 19:42:21 -04:00
Chris Mc
b21d80c22e 🧰 Linting and maintenance (#120)
* some manual fixes to obtain

* fairly close enough

* whitespace fixes

* add comment

* adding clang format + applied

* add editorconfig (supported natively by github web editor)

* apply linting to project

* clean up CI workflows

* zap vcpkg folder

actual one is here
https://github.com/microsoft/vcpkg/tree/master/ports/jwt-cpp

* adding a logo

* thin the lines in the pluses

* use logo + more links to spec and examples

* Create lint.yml

* apply linting
2021-01-11 17:37:14 -05:00
Chris Mc
933fc1681f 🎛️ Expand support to include non STL container based JSON implementations (#117)
* initial outline for a jsoncons traits implementation

https://github.com/danielaparker/jsoncon

fix extracted dir

* make sure to set cmake to current directory

* install jwt + pass install prefix

fix bad copy paste

fix filename

* Update JsonconsTest.cpp

* add checks for type alias in object_type

* poc for checking for `cbegin` (begin does not work because of overloads... no sure how compilers do this in for loops

* add checks for begin method

* check for begin const overload

* add missing details to object_type

rm extra update

fix using ctor

* adding missing type trait for pretty print

fix typo

fix type extraction

* fix object wrapper extraction

revet int extraction

* try calling ctor directly

trying a differnt ctor

* trying operator[] with no args (hoping for default ctor)

* adding missing pair to second from it

* dont assume std::pair

more adjustments

* apply constness

* refactor parsing of claims to no longer assume/require std::pair

cherry picking https://github.com/dtiukalov/jwt-cpp/pull/1

* add missing header

* adding missing at functors

* add missing move assignment

fixes

implementing compilers

more indirection

attempt 3

more fixes

more ctors

oen more time

again

* fix serilization

* prefer apt-get for stable cli

* add note about serializationg requirements in readme

* adding call to get decoded claims (this should fail)

* print helpful failure message

* move get claim to traits test that support it

* remove cbegin traits check (not used) replaced with end

* adding count, at, and [] requirements to traits

dont used removed functions

update tests

changed missing claim to return expected ISO exception base type

* remove extra nesting namespace
2021-01-09 09:39:02 -05:00
Jaideep Bajwa
aa258bdfdf Add helper function to convert cert from base64DER to PEM (#106)
* Add helper function to convert cert from base64DER to PEM

This is particularly useful when dealing with JWKs x5c claim which
is encoded as base64 DER. With this helper function the client can
convert x5c claim to PEM, which makes it easy to interact with this
library.
2020-11-08 22:04:51 +01:00
Dominik Thalhammer
ab37be7df4 Initial support for std::error_code (#86)
* Add error_code support to algorithm::verify

* Add error_code support for signing

* Add error_code overloads to verifying

* Fix missing throw

* Improvements

* Remove unused throwing overloads

* Fix test on older gtest

* Found bug and added more testing

* Move exceptions into error namespace
2020-07-21 18:30:51 +02:00
Christopher McArthur
767c3fc827 [skip ci] more progress 2020-05-20 14:23:28 -04:00
Christopher McArthur
56ffe083ae tester that compiles 2020-05-18 22:25:19 -04:00
Chris Mc
6793369939 token expected as per jwt.io
https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2UiOnsiYXBpLXgiOlsxXX19.F8I6I2RcSF98bKa0IpIz09fRZtHr1CWnWKx2za-tFQA
2020-03-28 17:30:09 -04:00
Christopher McArthur
92ddc67817 Adding SetObject to ClaimTests 2020-03-28 17:19:15 -04:00
Christopher McArthur
a9a1b80eda adding tests to cmake 2020-01-19 17:25:51 -05:00
Christopher McArthur
bb42fd9472 moving tests to a subdir 2020-01-19 15:08:20 -05:00