The latest version of libjwt-typed is 0.2-0.

libjwt-typed

Version 0.1 revision 0 uploaded by rzeznik.

Package meta

Synopsis
A Haskell implementation of JSON Web Token (JWT)
Description

A Haskell implementation of JSON Web Token (JWT)

Key features

Type-safety

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 GnuTLS or OpenSSL. 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.

Installation

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 libjwt with GnuTLS or OpenSSL

Please see the full README or browse the docs for more details.

Author
Marcin Rzeźnicki
Bug reports
https://github.com/marcin-rzeznicki/libjwt-typed/issues
Category
Web
Copyright
2020 Marcin Rzeźnicki
Homepage
https://github.com/marcin-rzeznicki/libjwt-typed
Maintainer
Marcin Rzeźnicki <marcin.rzeznicki@gmail.com>
Package URL
n/a
Stability
n/a

Components