mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
🔧 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
This commit is contained in:
12
README.md
12
README.md
@@ -26,7 +26,7 @@ For the sake of completeness, here is a list of all supported algorithms:
|
||||
* PS256
|
||||
* PS384
|
||||
* PS512
|
||||
* EdDSA (Ed25519, Ed448), since 0.5.0
|
||||
* EdDSA (Ed25519, Ed448) _since 0.5.0_
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -38,13 +38,13 @@ jwt::basic_claim<my_favorite_json_library_traits> claim(json::object({{"json", t
|
||||
|
||||
This allows for complete freedom when picking which libraries you want to use. For more information, [see below](#providing-your-own-json-traits-your-traits)
|
||||
|
||||
In order to maintain compatibility, [picojson](https://github.com/kazuho/picojson) is still used to provide a specialized `jwt::claim` along with all helpers. Defining `DISABLE_PICOJSON` will remove this optional dependency.
|
||||
In order to maintain compatibility, [picojson](https://github.com/kazuho/picojson) is still used to provide a specialized `jwt::claim` along with all helpers. Defining `JWT_DISABLE_PICOJSON` will remove this optional dependency.
|
||||
|
||||
As for the base64 requirements of JWTs, this libary provides `base.h` with all the required implentation; However base64 implementations are very common, with varying degrees of performance. When providing your own base64 implementation, you can define `DISABLE_BASE64` to remove the jwt-cpp implementation.
|
||||
As for the base64 requirements of JWTs, this libary provides `base.h` with all the required implentation; However base64 implementations are very common, with varying degrees of performance. When providing your own base64 implementation, you can define `JWT_DISABLE_BASE64` to remove the jwt-cpp implementation.
|
||||
|
||||
### Getting Started
|
||||
|
||||
Simple example of decoding a token and printing all claims:
|
||||
Simple example of decoding a token and printing all claims ([try it out](https://github.com/Thalhammer/jwt-cpp/tree/master/example/print-claims.cpp)):
|
||||
|
||||
```cpp
|
||||
#include <jwt-cpp/jwt.h>
|
||||
@@ -71,7 +71,7 @@ verifier.verify(decoded_token);
|
||||
|
||||
The created verifier is stateless so you can reuse it for different tokens.
|
||||
|
||||
Creating a token (and signing) is equally easy.
|
||||
Creating a token (and signing) is equally as easy.
|
||||
|
||||
```cpp
|
||||
auto token = jwt::create()
|
||||
@@ -98,7 +98,7 @@ auto token = jwt::create()
|
||||
There are several key items that need to be provided to a `jwt::basic_claim` in order for it to be interoptable with you JSON library of choice.
|
||||
|
||||
* type specifications
|
||||
* conversion from generic "value type" to specific
|
||||
* conversion from generic "value type" to a specific type
|
||||
* serialization and parsing
|
||||
|
||||
If ever you are not sure, the traits are heavily checked against static asserts to make sure you provide everything that's required.
|
||||
|
||||
Reference in New Issue
Block a user