Commit Graph

173 Commits

Author SHA1 Message Date
Chris Mc
8cb307a8eb Remove duplicated key handlers (#318)
* 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
2023-12-12 09:49:26 -05:00
Stéphane Janel
0e3d6a142c Fix gcc-12 compilation error (#312)
* 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>
2023-11-25 22:32:03 -08:00
Stéphane Janel
ce1f9df3a9 Fix warning vla-extension by changing MB_CUR_MAX into MB_LEN_MAX which is a compile time constant (#302) 2023-08-12 14:17:22 +02:00
Alejandro Criado-Pérez
6fed66d0d5 Corrected a few typos (#297)
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2023-07-25 18:45:15 +02:00
Jonas Borchelt
4e3dd40cfe Replace deprecated wstring_convert (#290)
Co-authored-by: Jonas Borchelt <jonas.borchelt@icloud.com>
2023-05-16 12:57:05 +02:00
hlounent
a068ebd661 Fix build with GCC 13 (#287)
Include <cstdint> for fixed width integers used by base64 library.

Co-authored-by: Hannu Lounento <hannu.lounento@vaisala.com>
2023-04-22 23:33:27 +02:00
Dennis Yakovlev
c2b43e67c1 Added convenience function for binary DER to PEM (#283) 2023-03-14 17:00:41 +01:00
gizmocuz
9730001c41 💄 Cast der_signature.length() to 'long' to silence compile warning (#270)
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2022-11-03 20:12:22 +01: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
Dominik Thalhammer
02e94cafcb ⏫ Update clang-format to 14.0, pin version (#266) 2022-10-23 11:57:38 +02:00
Chris Mc
aac4b62923 Add helpers to some crypto APIs that vary by version (#256)
Hides API changes between older OpenSSL versions behind a helper function to improve readability and maintainability of the application code.
2022-10-11 08:05:36 +02:00
Chris Mc
5032d59124 🧹 Removing extra exception aliases (#257)
* remove exception outside of error namespace

* linter
2022-10-05 09:09:02 +02:00
Stéphane Janel
07a2f64b0d 📤 Do not embed nlohmann::json directly, use find_package / FetchContent instead (#254)
* 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>
2022-10-03 11:01:42 +02:00
Chris Mc
cba92ab173 🔭 Allow generic access to JWT header and payload (#251)
* boost print header claims

* type

* update other example

* lint

* update example

* update example

* update examples

* tidy

* renaming to clarity

* delete old check in traits

* return underlying type
2022-10-02 08:47:10 +02:00
Chris Mc
0628011aeb 🔤 Support for Base64url with case insensitive padding (#219)
* 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
2022-09-19 08:52:07 -07:00
Chris Mc
484bdb086a ⚙️ Restore support for GCC-4.8 (#246)
* Create workflow for targeting specific platforms/compilers

starts with a GCC-4.8 CentOS base

* make sure to install dev tools

* Update targets.yml

* Update targets.yml

* Update targets.yml

* Update targets.yml

* install CMake by hand

* try ubuntu with gcc 4.8

* fix action

* actions/checkout@v3

* latest cmake + set compiler for CMake

* install g++

* fix compiler passed to cmake

* try to run in docker container

* in container we are root

* try an update

* assume yes

* revert to using gh runner image

* permissions

* replace `codecvt` when required

* pass locale

* fix linter

* linter

* revert changes to actions (min for pr)
2022-09-17 21:04:40 -07:00
Prosperoh
68309438cf Fix as_date()'s std::bad_cast with decimal value (#240)
Signed-off-by: Dominik Thalhammer <dominik@thalhammer.it>
Co-authored-by: Prosperoh <prosperoh@protonmail.com>
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2022-09-14 13:04:12 +02:00
Dominik Thalhammer
3ed4ff9704 Use EVP_PKEY_up_ref if available (#238) 2022-09-13 08:52:13 +02:00
Chris Mc
c9a511f436 🔒 Update SSL libraries to latest versions (#235)
* 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>
2022-06-14 09:02:34 -07:00
Kai Takac
9f36be9392 🔎 Allow to retrieve list of claims (#231)
It is now possible to iterate over the list of claims of a JWK
2022-06-12 18:54:46 -07:00
Chris Mc
6aabc2e81b 🏟️ Add verify context trait template specialization (#229)
* Add verify context template specialization

Co-authored-by:  sirzooro <sirzooro@users.noreply.github.com>

* add `verify_context` to all defaults

Co-authored-by: sirzooro <sirzooro@users.noreply.github.com>
2022-05-17 22:49:58 -07:00
Jan Blome
d7e0936d84 🔧 Fix build with OPENSSL_NO_DEPRECATED (#228)
* 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>
2022-05-12 16:43:47 -07:00
Kai Takac
5c588fccd6 Allow moving decoded_jwt (#225) 2022-04-12 13:24:31 +02:00
Chris Mc
142d2d38e7 🖊️ Update documentation layout (#202)
* 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>
2022-01-30 16:31:20 -08:00
alexeyserbin
97c8782605 🔐 Make it possible to build with OpenSSL 1.0.1 (#199)
* Make it possible to build with OpenSSL 1.0.1

This patch updates the code in the jwt-cpp/jwt.h header and relaxes the
requirement for OpenSSL's version in the top-level CMakeLists.txt to
allow for compiling with OpenSSL 1.0.1.  The patch works around the
non-constantness of the 'sig' parameter in the signature of the
EVP_DigestVerifyFinal() function in versions of OpenSSL prior to 1.0.2.

I verfied it's now possible to compile with OpenSSL 1.0.1, but I guess
it might be possible to compile even with OpenSSL 1.0.0 after tweaking
the version requirement in CMakeLists.txt.

The new EVP_DigestVerifyFinal() signature was introduced in [1] and then
cherry-picked into the main branch as [2].  The update [1] doesn't
contain any functional change per se: even prior to the update,
EVP_DigestVerifyFinal() implementation was de facto treating the 'sig'
parameter as if it were immutable [3].

[1] 1abfa78a8b
[2] 0f7fa1b190
[3] 27007233db/crypto/evp/m_sigver.c (L163-L187)

* Fix formatting in jwt-cpp/jwt.h

This patch doesn't contain any functional modifications.

This is a follow-up to d74c832bd9fae79c2dcaf0def67e3c2c501a6b80.

* Test against OpenSSL 1.0.1u

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2022-01-24 23:09:48 -08: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
Marek Klein
275c750fa1 🔧 Replace deprecated OpenSSL functions (#191)
* 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>
2021-12-12 10:25:43 -08:00
Marek Klein
55aaf31ad8 🔧 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
2021-11-22 20:18:50 -08:00
Marek Klein
66eea980b5 🗜️ Simplify reading of EC keys (#185)
* simplify reading of EC keys

* fix formatting
2021-11-18 20:26:03 -08:00
Chris Mc
ab1a60ec8a ⬆️ Bump danielaparker/jsoncons to v0.167.1 (#178)
* Update traits.yml

* Update traits.yml

* better error report for missing method

* clean up traits implementation

in prep for Thalhammer#174
2021-09-27 09:23:36 -04:00
Chris Mc
de457af919 🐺 Add WolfSSL support (#171)
* 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 =)
2021-09-21 21:30:54 -04:00
Chris Mc
7fd8470cf1 🧷 Fuzz testing (#98)
* Update coverage.yml

* adding a fuzz test

* adding more fuzzing

TBA how to handle input requirement of decode

* base64 encoding input to avoid "obvious" exceptions

trying out the EVP_ interface from #89

* fixing decode fuzz

* accepting exceptions are normal

After comparing with https://github.com/nlohmann/json/blob/v3.9.0/test/src/fuzzer-parse_json.cpp I must agree data can be random so it should be accepted

* decoding twice should produce the same result

again based on https://github.com/nlohmann/json/blob/v3.9.0/test/src/fuzzer-parse_json.cpp

* fixing token decode fuzzer

* adding corpus for fuzz tests + adding them to ci

* removing numbers with more meaning descriptions

* Update BaseEncodeFuzz.cpp

* Update coverage.yml

* Update coverage.yml

* shrink interations

* cleaning cmake

* Update and rename coverage.yml to jwt.yml

* Update lint.yml

* Update jwt.yml

* Update jwt.yml
2021-09-17 20:01:38 -04:00
Chris Mc
aaf3c714e3 🔧 Fix shadow variables (#170)
* Renamed variables being shadowed by lambda arguments

Co-authored-by: Tobias Kux <XyFreak@users.noreply.github.com>

* Renamed lambda parameter name shadowing parameter of parent function

Co-authored-by: Tobias Kux <XyFreak@users.noreply.github.com>

* Update include/jwt-cpp/jwt.h

Co-authored-by: Tobias Kux <XyFreak@users.noreply.github.com>

Co-authored-by: Tobias Kux <XyFreak@users.noreply.github.com>
2021-09-13 20:37:38 -04:00
Chris Mc
bb8627bf66 🗺️ Add support for Boost.JSON traits (#165)
* wip boost test

* wip hardcoded just to test

* wip more

* working POC

* trying boost json with c++17

* working boost json standalone with cxx17

* Delete conanfile.txt

* revert some changes to see if they are required

* adding a workflow

* cleanup

* naming convention

* testing for substr on string_type

* trying to test for operator+

* fix check for operator+

* losen std::string requirement (experimental)

* Update .gitignore

Co-authored-by: gerardoprada <gerardoprada@users.noreply.github.com>

Co-authored-by: gerardoprada <gerardoprada@users.noreply.github.com>
2021-09-13 20:10:04 -04:00
Dominik Thalhammer
da4adc3651 Fix to_lower_unicode to do what it claims (#162)
No idea how it came in there and it doesn't influence anything as long as both expected and checked
value have the same casing (which they do since we apply it to both).
2021-09-01 18:54:08 +02:00
Aydin
402179d8fb 🔑 Using RSA_padding_add_PKCS1_PSS and RSA_verify_PKCS1_PSS functions (#159)
When both Hash and mgs1Hash parameters match in the _mgf1 equivalent calls,
or mgf1Hash is NULL, we can opt to use the non _mgf1 calls mentioned.
This change will allow wolfssl to be compiled with jwt-cpp.

Co-authored-by: Aydin Arik <aarik@teradici.com>
2021-09-01 12:01:37 -04:00
Chris Mc
d708be00b8 🔐 Adding support for "alg" ES256K (#156)
* adding support for alg es256k

* fix example

* chore: lint

* update alg tabls

Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2021-08-17 17:51:22 -04:00
Chris Mc
23fd608caf 📈 Improving OpenSSL test coverage (#155)
This cleans up some of the testing for specific ssl versions, updates LibreSSL tests to the latest patch versions and adds badges for OpenSSL test.
2021-08-17 13:42:24 +02:00
Marek Klein
17fdd26d97 Fix tests for OpenSSL 3.0.0 (#153)
* update signatures of PEM_write_bio_PUBKEY and PEM_write_bio_X509
* run tests with openssl
* Update .github/workflows/openssl.yml
* fetch openssl from github

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2021-08-13 13:33:43 +02:00
Dominik Thalhammer
619948fdc0 Rework verifier checks (#148)
Reworks the verifier to allow for per claim verification functions. This removes the need for special cases in the core verifier and allows users to do advanced verification like deep object inspection or case sensitive/insensitive comparisons.

In addition a dedicated "typ" check has been added.

API Breakage: none
ABI Breakage: verifier
2021-07-08 11:46:54 +02:00
Tarun Chinmai Sekar
ae8d1ef632 Add JWKS parsing (#146)
* Add JWKS parsing
* Add more unit-tests, modify get_x5c to return an array per review-comments
* Add accessors for remaining jwk fields
* Apply suggestions from code review

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2021-07-01 11:17:21 +02:00
Chris Mc
0d10b631ea 🐛 Fix warning C4267 from STL to OpenSSL API (#141) 2021-04-21 08:50:42 -04:00
Chris Mc
4620bf43be Remove unused member from eddsa algorithm base (#136)
* Remove unsed memember from eddsa algotithm base

* docs

* Remove silly test code
2021-03-20 17:08:12 +01:00
Chris Mc
0f20aa600f 🐛 Relax operator access syntax for MSVC (#132) 2021-02-14 09:52:11 -05:00
Dominik Thalhammer
cf11f094e3 Update picojson to most recent version (#123)
closes #92
2021-01-18 13:46:11 +01: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
ac3de9e69b 🐛 Remove noexcept specifiers when using default (#121)
the C++ ISO describes the expected behavoir where by default ctors may in fact be noexcept
ref: https://en.cppreference.com/w/cpp/language/noexcept_spec

resolves #118
2021-01-09 19:27:36 -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
Chris Mc
159527930e Make LibreSSL support official (tested against 3.3.0 along with CMake install) (#113)
outline to add libressl testing

add missing arg

fix bad copy paste

adding cmake option for openssl versus libressl

explicit directory

set cmake dirs

used seperate build folder + make directly

trying autotools

download cmake module

typo

link against correct ssl target

force openssl 1.0 API when using libressl

add missing macro

make sure to configure ssl error tests based on ssl lib/version

fix compare on min ssl version

fix compare

adding CMake install support to SSL optional

Make sure to copy fin package module

fix fake install path

Update cmake.yml

Update cmake.yml

Update tests/cmake/libressl-is-used.cpp

jwt header now configures itself for libressl (no externly dep on cmake)

this is acompnaied by a docker image to test libressl with

writing sheild.io json to seperate branch

fix bad syntax

make missing dirs

make sure to not overwrite files

add tables to advertise support

only update on push to master
2020-12-13 20:43:24 +01:00
Chris Mc
ca110ade5b 🔧 Improved CMake options and macros to prevent collisions (#109)
* exclude any folder prefixed with build

* seeing how far generator expresstion will go

* refactor cmake + outline some tests

* adding missing install destiniation

* rolling back some changes since the workflow was no support by CMake

* adding missing include

* fixing old variable names being used

* using target_compile_definitions instead of options

* correct options for CI + reporting errors for consumer

* using sudo to install

* fix bad variable

* trying CMAKE_PREFIX_PATH

* removing recursive call

* remove options from generators + dedicated exports target

* remove pthread link lib (unused)

* install targets files + include

* add missing main

* remove install prefix

* revive CMAKE_PREFIX_PATH it's really needed

* fix collision on DISABLE_BASE64 + more cmake tests

* bump cmake version + test minimum

* fix job names

* fix bad replace

* fix bad permissions

* fix install of picojson

* adding missing ifndef and overload for pico and no base64

* linting

* test for version

* trying to find version

* [test] remove semver prerelase from CMake

* fixing some documentation issues

* limit cmake test to only related files

* touch up docs

* making sure new helper supports no base64 mode

* some doc fixes

* Update cmake.yml

* Update .github/workflows/cmake.yml

* Update .gitignore
2020-11-29 15:56:53 +01:00