* 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
* 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
* 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
* 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>
* Support Ed25519 for LibreSSL 3.7.1+
* fix EdDSACertificate error code test for new implementation
---------
Co-authored-by: Chris McArthur <prince.chrismc@gmail.com>
* 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
* 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
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
* 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>
* 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
* 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>
* 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
* 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>
* Add set_expires_in and set_issued_now methods
* Add a Clock type parameter for builder
* set_expires_in method sets exp from the current moment
* Update default traits with the new builder interface
* Add VerifyTokenExpirationInValid for all traits
* Use the new methods in examples
* Add create method to specify the clock type
* Use JWT_CLAIM_EXPLICIT for explicit constructors
* Fix builder factory method in mustache file
* fixup whitespace
* default template was missing a few args
* fix whitespace
* linter
---------
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
* - Added creation of public key from its components
- Split verify function to signature and claims
- Added handling of claims set in json while creating a verifier
* - Added creation of public key from its components
- Split verify function to signature and claims
- Added handling of claims set in json while creating a verifier
* Fixed missing lines
* Added unit tests
* Additional changes
* delete
* refactor free
* remove testing
* align white space
* Update tests/PubKeyTest.cpp
Yes I should have removed it. Used it in testing
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
* Add support for 1.0.2
* refactor a bit
* user jwt define for SSL API that is cross-library
* add support for no base64 from jwt
* refactor a bit more
* fixup wolfssl + linters
* missing include for openssl 3
* quick draft of openssl 3 implementation
* linter
* add in a health layer of error handling and memory management
* flip function order
* fix typo
* error tests for openssl
* more all helper tests to one file
* update cmake
* update tests
* more negative test cases
* fixup old api calls depending on version
* linter
* fixup return types
* disable failing tests
* fixup copy passed
* disable more tests
* fixup broke tests
* better error code handling
* test asan with more openssl versions
* fix template render path
* fix cache conflict
running different ubuntu docker images for with different GLIB c and cxx ABIs
* add missing lib to tests
* run both openssl versions with asan
* openssl code always calls new and returns an adress in most cases
so always save the pointer to call free?
* go back to old raw2bn implementation
* Revert "openssl code always calls new and returns an adress in most cases"
This reverts commit 45e85b8c667587236ac3dd255d1450bcf22f5723.
* remove add new tests (needs to be a seperate pr)
* fix jwks verify example + run with asan+lsan
* some extra backwards compat for ssl1.1
* compat rsa keygen
* fixup copy paste
* fix typo
* linter
* wolfssl compat
* compat 1.1.0i
* more compat
since they changed the API with ever version
* linter
* fix 1.1.0
* more compat
* more compat
working on the matrix of wolfssl and libress and 1.1.0
* updated example with hardcoded values
* action to install openssl now sets ENV vars for CMake
https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindOpenSSL.cmake#L233https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variablehttps://gitlab.kitware.com/cmake/cmake/-/issues/24236
* update example to create a valid token
* update asan to latest compiler
* clang tidy
* fix memory leak in openssl 1.1.1
this is theoretically only because of the test code but better safe then sorry
* clang format
* improve docs
* enable one more test
* fix test impl signature
* more test for bio to std::string
* DRY up code with new helper for write_bio_to_string
* fix copy paste + spell checking
* linter
* fix typo
* fix return type
* BIO_get_mem_data is just a define
so fixup error implementation to match
* put extra tests in too many places
its only for certs not just pubkeys
---------
Co-authored-by: ZOHARGO <zohargo@amdocs.com>
Co-authored-by: zgofer1 <zgofer@gmail.com>
* update tests to run jsoncpp
* fix order for type checking
Co-authored-by: cjserio <cjserio@users.noreply.github.com>
* linter should be more specific on on default for trait
* fix linter
* output folder name
* use filepath for linter processing
---------
Co-authored-by: cjserio <cjserio@users.noreply.github.com>
* Implemented JsonCPP Traits
* quick pass to add CI
* correct find_packge to use config and not be required
* typo in default version
* jsoncpp forces out of source builds
* disable tests and shared library
* add missing build step
* try a different target + build less
"they" do not maintain the CMake scripts so this will be fun https://github.com/open-source-parsers/jsoncpp/issues/455#issuecomment-478251641
* fix name for traits (missed replaces)
* Added missing array_type constructor so that basic_claims can be formed from sets of values
* Linters and more tests + fetchcontent gtest
* linter
* support library names with many separators
* linters
* run clang format after rendering defaults
---------
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
* add a quick test to see if rsa helpers handle ec certs
LoadPublicKeyFromStringReferenceWithEcCert
* run all tests with generic helper
* template out error category and new tests
* linter
* missing enum entry
* does convert_base64_der_to_pem work with ecdsa?
* use correct EC curve functions
* missing extern symbol
* dont change behavior
* typo
* fix tests
* update private key to be more generic
* fixup 2 more tests
* update exception for libressl 3.5.3
https://github.com/Thalhammer/jwt-cpp/actions/runs/7161143039/job/19496334109?pr=318#step:8:248
```
[ RUN ] OpenSSLErrorTest.ECDSACertificate
/home/runner/work/jwt-cpp/jwt-cpp/tests/OpenSSLErrorTest.cpp:487: Failure
Expected equality of these values:
ec
Which is: ecdsa_error:19
e.expected_ec
Which is: rsa_error:12
```
* linter
* add missing test
* fix copy paste
* typo part 2
* Do not embed nlohmann::json directly, use find_package / FetchContent instead
* Clea up traits workflow
Headers are no longer vendored
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
* stl algs for `alphabet::index`
* refact `jwt::base` to a namespace
instead of a class
* recursive count passing
* test complicated scenarios
* count padding of variable length
* new percent enconding helper
* spelling
* fix gcc 4.8
* trying to avoid the runtime problem on init list with dynamic values
* :qRevert "trying to avoid the runtime problem on init list with dynamic values"
This reverts commit b9be15e06c397e6c2fecc6d60bde90bbb55f84a2.
* switch to vector
* linter
* missing header
* fix gcc 4.8 more
* more tests with new alphabet
* Bump test SSL libraries
* Fix copy paste error
* fix bad spacing
* Update README.md
* bump again
* remove libressl 3.5.3
* Update ssl.yml
* put back 3.5.x for failing badge
* Update action.yml
* point URLs back to main since testing worked
* Only publish badge on push
leftover from me testing on my fork 25 days ago 😭
* Trying using 1.1 apis with libressl
https://github.com/libressl-portable/portable/issues/764#issuecomment-1153548504
Co-Authored-By: Theo Buehler <botovq@users.noreply.github.com>
* Limit new APIs to required version
limit change to older supported versions
* Update tests for new libressl APIs
Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
* Add missing include to fix build with OPENSSL_NO_DEPRECATED
Creating and verifying RSA signatures requires some OpenSSL functions
declared in the `openssl/rsa.h` header. When `OPENSSL_NO_DEPRECATED` is
not defined this header gets indirectly included. But with this define
set the function declarations are missing. This commit adds an explicit
include for the file to fix this.
* Remove unused functions in OpenSSLErrorTest
Some functions from OpenSSL redefined in `OpenSSLErrorTest.cpp` use
types that are not available when `OPENSSL_NO_DEPRECATED` is defined.
Since they do not seem to be actually used this commit simply removes
them.
* Test with OPENSSL_NO_DEPRECATED
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
* split docs into sub pages
* lets see if we can fix the logo size on doxy
* try usine a theme to make it more modern
* fix bad link
* fix broken link
* Update docs/faqs.md
Co-authored-by: Dominik Thalhammer <thalhammer.d@googlemail.com>
* Update faqs.md
Co-authored-by: Dominik Thalhammer <thalhammer.d@googlemail.com>
* Update Doxyfile
Co-authored-by: Dominik Thalhammer <thalhammer.d@googlemail.com>
* Update README.md
* clean up utc vs localtime FAQ
* fix the table image colors
following https://github.com/jothepro/doxygen-awesome-css#css-variables
* fix colors for class index
* enable graphics diagrams
* fix colors
* fix version number
we missed a patch release
* white space
* fix docs not matching code
* Improve SSL selection docs
Co-authored-by: Dominik Thalhammer <thalhammer.d@googlemail.com>
* 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>
* do not use deprecated functions in ecdsa context
* check ecdsa key on creation
* add test
* set compiler flags correctly
* set compiler flags correctly attempt 2
Co-authored-by: Chris McArthur <prince.chrismc@gmail.com>
* 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 ssl.yml
* Update README.md
* Update ssl.yml
* Update README.md
* update test data to 5.0 impl
* remove older abi version
the data generated changed so the test code no longer supports the old way
something ~4.8 should work
* outline for wolfssl support
lots of missing symbols
* rm old libressl dockerfile
* ass wolfssl test + dry up workflows
with improved composite action having `use` keyword
* autoreconf
* brute force zap openssl headers
* Update action.yml
* try to access nested headers
* trying to log include headers
* more debug logs
* fix bad variable
* tweaks
* more features
* cleanup
* wolfssl is special like libressl
* test header order
* revert order
* trying wolfssl master
* adding wolfssl compatiblity macros
trying to get access to
1662b01157/wolfssl/ssl.h (L3960)
* trying no newline
to fix tests
* typo
* bad copy paste pt2
* not a new line problem
* typo
* workaround failing helper test
* update cmake test
list(TRANSFORM raised min
* test cmake install with wolfSSL
* add missing EOF
* more generic wolfssl install
since there is no release that works yet
* typo
* debug print
* add more checks
* force HAVE_ECC
* install master
* hunter does not support wolfssl
* pretty job name
* clean up
* Update README.md
* bump to latest master
* Update cmake.yml
* bump coveralls action
* switch badge name to sha
* Update jwt.yml
they published a bad tag =)