* 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
* 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>
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
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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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
* 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>
* 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>
* upload tar.gz for new releases
* revert name to manually trigger it
* write to separate path
* Update and rename nuget.yml to release.yml
* disable nuget for testing
* add a zip as well
* error handling
* Update release.yml
* simple conditional
trying https://unix.stackexchange.com/a/344207
* Update release.yml
* back to basics
* exclude .git folder
* fix order for args
* protect glob
* fix order
* remove remove testing code
* bump actions
* avoid conflicts
* work around nodejs being too new
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04
* clang-format-14 needs ubuntu 22
* dont use source
* limit check to v3
there no docker image for node 20 on debian buster with gcc-4.8 and ubuntu 18 has a glibc that is too low
we'll need to checkout manually when needed
* explicit format
* Update jwt.yml
* clean up attempt code
* 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 <christopherm@jfrog.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
* Fix gcc 12 compiling error
* add test for gcc-12
* replace array with vector
this is to avoid breaking the API down the line
* pin down ubuntu base images
these do get updated with with under active development and there are changes which could affect us
* skip gtest + set cxx_std to 20
---------
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>