Commit Graph

51 Commits

Author SHA1 Message Date
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
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
Chris Mc
149af7a2c5 Test token expiration handling with nlohmann/json traits (#104)
Correctly handle unsigned integers provided by nlohmann/json.
closes 103

Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2020-10-26 08:52:38 +01:00
Speeder
49d29e3d43 Added EdDSA support (#95)
* Fixed a build error

`jwt.h` previously depended on the nlohmann JSON library's inclusion of `iso646.h`, which defines the `not` operator.

* Added EdDSA support

https://github.com/Thalhammer/jwt-cpp/issues/79
Disabled EdDSA support when building with OpenSSL <1.1.1. Support for EdDSA came with OpenSSL version 1.1.1, incl. API extensions.

* Fixed build generation for Microsoft Visual Studio

* Fixed MSVC build warnings "hides previous local declaration"

* Fixed narrowing warnings when building with OpenSSL 1.0.2

* Compacted the string buffer initialization code pattern

As per review comment: https://github.com/Thalhammer/jwt-cpp/pull/95#discussion_r462985506

* adding eddsa openssl tests

* adding on mock openssl call as a test

* adding more mock openssl call to test failures

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2020-08-03 23:40:08 +02:00
Dominik Thalhammer
9711259ef2 Openssl testing (#90)
* 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

* Initial implementation of openssl tests

* Fix tests for older compilers

* Only enable openssl test on openssl >=1.1
2020-07-21 18:47:10 +02: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
Chris Mc
22e43afba8 adding coverage testing (#2)
* adding coverage testing

surprisingly:
Overall coverage rate:
  lines......: 80.6% (519 of 644 lines)
  functions..: 92.5% (235 of 254 functions)

* Update coverage.yml
2020-07-05 21:43:09 -04:00
Chris Mc
8eaf1a8a37 Correcting spelling
Of nlohmamm, some sloppy copy paste
2020-06-26 16:24:43 -04:00
Dominik Thalhammer
2d362fddbe Move json types into json trait 2020-06-26 14:40:49 +02:00
Christopher McArthur
10361407f8 adding option to remove picojson dep 2020-06-10 20:38:22 -04:00
Chris Mc
83aae8990a Update tests/CMakeLists.txt
fixing typo
2020-06-10 13:59:51 -04:00
Chris Mc
cb8af09d10 adding option to disable the base64 support 2020-06-07 16:35:19 -04:00
Christopher McArthur
8426dc3e14 running cmake format 2020-06-06 21:22:06 -04:00
Chris Mc
cdbc1168d7 removing as_set from traits 2020-05-31 10:16:32 -04:00
Chris Mc
739b7cdb90 improver traits + consistent order for tpl params 2020-05-30 23:32:46 -04:00
Chris Mc
5d3624b8bb removing attempt at support for wide strings 2020-05-30 17:28:03 -04:00
Chris Mc
ddf09881e7 nholmann json dump does not support wchar_t =? 2020-05-30 13:54:48 -04:00
Chris Mc
ceb6e176eb trying to support a std::wstring bacis_claim 2020-05-30 10:43:15 -04:00
Chris Mc
9f4a217fff [skip ci] fixing clang warnings 2020-05-30 08:50:16 -04:00
Christopher McArthur
76aac93d4d [skip ci] adding std::wstring test 2020-05-28 23:14:29 -04:00
Christopher McArthur
b6e1d4dece find package for GTest 2020-05-27 21:58:39 -04:00
Christopher McArthur
089d9011f6 adding the rest of that static assert for functions 2020-05-26 08:21:51 -04:00
Christopher McArthur
9afe25a364 revert test 2020-05-25 22:44:30 -04:00
Christopher McArthur
bcd7e3f99c [skip ci] attempt at is_basic_claim check 2020-05-25 22:25:57 -04:00
Christopher McArthur
e1d2f58a00 adding serialize trait 2020-05-24 08:47:54 -04:00
Christopher McArthur
474a870889 adding verification test 2020-05-20 21:24:46 -04:00
Christopher McArthur
cb9165b3ba using operator<< instead of function call 2020-05-20 21:04:56 -04:00
Christopher McArthur
8ec4bfb836 removing duplication 2020-05-20 15:06:41 -04:00
Christopher McArthur
44592aeb5a testing nholmann json array 2020-05-20 14:39:13 -04:00
Christopher McArthur
f45db90c43 fixing error is nholmann traits 2020-05-20 14:36:50 -04:00
Christopher McArthur
b3de79da98 testing just picojson templating 2020-05-20 14:26:48 -04:00
Christopher McArthur
767c3fc827 [skip ci] more progress 2020-05-20 14:23:28 -04:00
Christopher McArthur
45ccd617ad rough nholmann/json traits 2020-05-19 21:34:40 -04:00
Christopher McArthur
56ffe083ae tester that compiles 2020-05-18 22:25:19 -04:00
Dominik Thalhammer
f62fe8b9cd Merge branch 'master' into master 2020-05-02 15:03:28 +02:00
Dominik Thalhammer
0c803ed905 Merge branch 'master' into verify-aud-string 2020-05-02 14:59:09 +02:00
Chris Mc
aa001544e2 correcting usage of stream operator 2020-04-15 23:53:26 -04:00
Chris Mc
5df90e9c11 fixing ambiguous 2020-04-15 23:52:17 -04:00
Chris Mc
385afc3bd7 fixing string literal 2020-04-15 23:48:47 -04:00
Chris Mc
9dec02d571 adding tests for new functionality 2020-04-15 23:37:55 -04:00
Christopher McArthur
79370dcf1e making sure there warnings 2020-04-11 12:58:19 -04:00
Chris Mc
27673b058d adding test code fro pad and trim 2020-04-11 12:58: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
Dominik Thalhammer
b57ac3aab4 Fix googletest 2020-03-18 21:39:42 +01:00
Dominik Thalhammer
c9e7b80452 Merge remote-tracking branch 'upstream/master' 2020-03-18 21:22:04 +01:00
Christopher McArthur
9a197a445e correctly cofiguring config.in to be usable with deps 2020-01-20 22:10:14 -05:00
Christopher McArthur
bb5a76ec45 trying to figure out cmake config files 2020-01-19 20:38:46 -05:00
Christopher McArthur
a9a1b80eda adding tests to cmake 2020-01-19 17:25:51 -05:00
Christopher McArthur
3f002e59f1 zapping project files 2020-01-19 15:19:02 -05:00