libjwt-typed: A Haskell implementation of JSON Web Token (JWT)
A Haskell implementation of JSON Web Token (JWT)
Above Haskell standard type-safety, the library keeps track of public and private claim names and types. There are no user-facing
HashMaps in this library!
A type of a JWT token might be:
Jwt '["user_name" ->> Text, "is_root" ->> Bool, "user_id" ->> UUID, "created" ->> UTCTime, "accounts" ->> NonEmpty (UUID, Text)] ('SomeNs "https://example.com").
From information encoded with precise types, it automatically derives encoders and decoders. It can also work with generic representations such as records.
Speed and robustness
libjwt-typed uses libjwt for low-level functionality.
libjwt delegates cryptographic work to either
This way, not only the most performance-sensitive features work lightning fast, they are also extremely reliable.
Besides, the library does not depend on any JSON library like
aeson, but it implements the necessary JSON processing in C via jsmn - which makes it even faster. Benchmarking shows that it can be over 10 times faster than other Haskell JWT libraries.
Ease of use
The library is designed for frictionless use.
It can be easily extended, e.g. to add support for new types or to use custom JSON encodings compatible with other libraries you may already use in your project. Most instances can be derived automatically.
The compilation errors are designed to be informational, i.e. you get
Claim "user_name" does not exist in this claim set from GHC, not some 3 page long instance resolution output.
You must have libjwt (preferrably the latest version) installed on your system and visible to the linker.
libjwt-typed links to it at compile time.
You can configure
Please see the full README or browse the docs for more details.
[Skip to Readme]
|Versions [faq]||0.1, 0.2|
|Dependencies||base (>=22.214.171.124 && <4.15), bytestring (>=0.10.10.0 && <0.11), case-insensitive (>=126.96.36.199), casing (>=0.1.4.1 && <0.2), data-default (>=0.2 && <1.0), either (>=188.8.131.52 && <5.1), exceptions (==0.10.4), extra (==1.7.*), monad-time (==0.3.*), proxied (==0.3.*), text (>=184.108.40.206 && <1.2.5), time (==1.9.*), transformers (>=0.5.6.2 && <0.6), unordered-containers (>=0.2.10.0 && <0.3), utf8-string (>=220.127.116.11 && <1.1), uuid (>=1.3) [details]|
|License||MPL-2.0[multiple license files]|
|Copyright||2020 Marcin Rzeźnicki|
|Maintainer||Marcin Rzeźnicki <email@example.com>|
|Source repo||head: git clone https://github.com/marcin-rzeznicki/libjwt-typed.git|
|Uploaded||by rzeznik at 2020-09-15T20:00:49Z|
|Downloads||62 total (62 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
Docs uploaded by user [build log]
All reported builds failed as of 2020-09-15 [all 2 reports]
For package maintainers and hackage trustees