Commit Graph

257 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
Sonkeng Maldini
f85e6dfe90 Update README.md (#108) 2020-11-14 11:34:15 +01:00
Chris Mc
4dc22036bf Removing code incorrectly introduced into nlohmann/json (#107)
while experimenting with the traits supporting `std::wstring` some test code was not reverted.

The new copy is simply https://github.com/nlohmann/json/releases/download/v3.9.1/json.hpp

This was flagged fd6cec9a8d (commitcomment-44012502)

/cc @nickform-ost
2020-11-11 16:35:45 +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
Dominik Thalhammer
0ebf4f16c9 Fix issue #100 and #99 (#105)
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2020-10-26 16:48:50 +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
Richard Hozák
2dabd3f3e5 Remove toolchain include (#102)
Toolchain file gets included by CMAKE by default, including it again breaks things.
2020-10-19 17:53:23 +02:00
Dominik Thalhammer
7715cc2eff Bugfix type in ed448 implementation
partially fix for #99
2020-09-10 13:34:26 +02: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
Chris Mc
ee11e8873e 🔖 set version to 0.5.0-rc.0 (#93) 2020-07-29 20:15:41 +02:00
Speeder
8642cb0582 Fixed a build error (#91)
`jwt.h` previously depended on the nlohmann JSON library's inclusion of `iso646.h`, which defines the `not` operator.
2020-07-22 17:25:22 +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
dde742cca3 adding example for working with private claims (#88)
* adding example for working with private claims

* adding nlohmann `set_payload_claim` example to constrast picojson

to highlight the problems in #87
2020-07-20 23:28:45 +02:00
Chris Mc
a3fa4318d5 remove building examples separately (#85)
follow up from #84
2020-07-16 13:53:24 +02:00
Dominik Thalhammer
312cb9d74c Allow building examples as subproject and build them by default (#84) 2020-07-16 11:45:59 +02:00
Dominik Thalhammer
d2223db256 Merge pull request #81 from prince-chrismc/stl-detector
add support for stl detect idiom
2020-07-16 11:27:46 +02:00
Dominik Thalhammer
ab0f81e6b1 Merge pull request #82 from prince-chrismc/exclude-picojson
dont install picojson when it's disabled
2020-07-16 11:26:45 +02:00
Dominik Thalhammer
85c214d8e3 Merge branch 'master' into stl-detector 2020-07-16 11:26:05 +02:00
Dominik Thalhammer
3b8a2e1c29 Merge pull request #83 from matze/fix-non-virtual-dtor
Add virtual dtor to algo_base
2020-07-14 20:46:03 +02:00
Matthias Vogelgesang
9be143971d Add virtual dtor to algo_base
Otherwise, compilers will complain if verifier is used as a member
variable.
2020-07-14 10:00:27 +02:00
Chris Mc
184134c317 Add cpp14check for fundamentals ts v2 include 2020-07-09 22:36:26 -04:00
Christopher McArthur
e4eb2d9e49 dont install picojson when it's disabled
closes #68
2020-07-09 21:10:16 -04:00
Christopher McArthur
bc3cfd6479 add support for stl detect idiom
over in-house impl

closes #73
2020-07-09 20:55:14 -04:00
Dominik Thalhammer
eee4f7cbd0 Merge pull request #80 from prince-chrismc/master
Documentation improvements
2020-07-09 23:31:31 +02:00
Chris Mc
6a5cf85385 Apply suggestions from code review
Co-Authored-By: Dominik Thalhammer <Thalhammer@users.noreply.github.com>
2020-07-08 09:40:21 -04:00
Chris Mc
a0f51e74df 🖊️ improving examples 2020-07-07 23:40:40 -04:00
Chris Mc
ef5bba2659 Update README.md 2020-07-07 22:03:55 -04:00
Chris Mc
00f96ea6e7 🖊️ improving documentation
around namespaces and implementating traits
2020-07-07 20:01:20 -04:00
Dominik Thalhammer
b984af596a Merge pull request #75 from prince-chrismc/compile-examples
Compile examples
2020-07-06 12:50:44 +02:00
Dominik Thalhammer
23bc2efcfc Merge branch 'master' into compile-examples 2020-07-06 12:24:08 +02:00
Dominik Thalhammer
627c45b1b5 Merge pull request #76 from prince-chrismc/master
Generate doxygen documentation and publish on github pages + code coverage published on coveralls.io
2020-07-06 12:20:57 +02:00
Dominik Thalhammer
98e767f019 Change coverage url 2020-07-06 12:19:17 +02:00
Chris Mc
191b3cf216 adding coverage badge 2020-07-05 21:49:17 -04: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
e47a39fd4d Create coverage.yml 2020-07-05 21:04:59 -04:00
Chris Mc
4425448e99 tweak options 2020-07-01 22:37:40 -04:00
Chris Mc
15ad450885 ignoring third party deps 2020-07-01 20:01:32 -04:00
Chris Mc
a4971496a0 Update documentation.yml 2020-07-01 17:55:49 -04:00
Chris Mc
d1c0a6712f Update documentation.yml 2020-07-01 17:53:43 -04:00
Chris Mc
bfcc582b60 Create documentation.yml 2020-07-01 17:52:35 -04:00
Chris Mc
b93bdcf60b correcting decoded_jwt + builder api breaks
- decoded_jwt to expose get_payload_claims() and get_header_claims()
- builder set expires, not_before and issued correctly pass date as an arg
2020-07-01 17:33:42 -04:00
Chris Mc
6a41dbaf31 adding link to RSA examples 2020-07-01 15:39:49 -04:00
Chris Mc
0e6d47277a improve rsa verify with output 2020-07-01 15:34:39 -04:00
Chris Mc
309ff66826 adding verification example
addess issue flagged in #41
2020-07-01 15:26:00 -04:00
Chris Mc
071abc5f81 make sure to use sudo for make install 2020-07-01 15:14:40 -04:00
Chris Mc
2af994251a compiling example with travis 2020-07-01 15:12:56 -04:00
Dominik Thalhammer
9efa1c90c3 Use C++17 void_t if available
See #73
2020-06-27 14:10:28 +02:00
Dominik Thalhammer
8f4660e19c Merge pull request #74 from prince-chrismc/patch-1
Correcting spelling in test code
2020-06-27 13:34:01 +02:00
Chris Mc
8eaf1a8a37 Correcting spelling
Of nlohmamm, some sloppy copy paste
2020-06-26 16:24:43 -04:00