[package] name = "jwt-compact" version = "0.9.0-beta.1" authors = [ "Alex Ostrovski ", "Akhil Velagapudi ", "Frank Denis ", "Maximilian Münchow ", "Eran Rundstein ", "Bruno Green", ] edition = "2021" rust-version = "1.70" readme = "README.md" license = "Apache-2.0" keywords = ["JWT", "token", "authorization"] categories = ["web-programming", "cryptography", "no-std"] description = "Minimalistic JWT implementation with focus on type safety and secure cryptographic primitives" repository = "https://github.com/slowli/jwt-compact" exclude = ["e2e-tests"] [package.metadata.docs.rs] # Enable non-conflicting additional algorithms in documentation on `docs.rs`. features = ["exonum-crypto", "es256k", "p256", "rsa"] # Set `docsrs` to enable unstable `doc(cfg(...))` attributes. rustdoc-args = ["--cfg", "docsrs"] [dependencies] # Public dependencies (present in the public API). anyhow = { version = "1.0.89", default-features = false } base64ct = { version = "1.5.2", features = ["alloc"] } ciborium = { version = "0.2.2", default-features = false, optional = true } chrono = { version = "0.4.38", default-features = false } rand_core = "0.6.2" serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } # SHA crypto backend (private dependency; re-exported `digest` crate is public). hmac = "0.12.0" sha2 = { version = "0.10", default-features = false } # Private dependencies (not exposed in the public API). lazy_static = { version = "1.5", optional = true } smallvec = "1.13.2" subtle = { version = "2.6.1", default-features = false } zeroize = { version = "1.8", features = ["zeroize_derive"] } # Crypto backends (all public dependencies). secp256k1 = { version = "0.29", optional = true } [dependencies.k256] version = "0.13.4" default-features = false features = ["ecdsa"] optional = true [dependencies.p256] version = "0.13.0" default-features = false features = ["ecdsa"] optional = true [dependencies.exonum-crypto] version = "1.0.0" default-features = false features = ["sodiumoxide-crypto"] optional = true [dependencies.ed25519-dalek] version = "2.1.1" optional = true default-features = false [dependencies.ed25519-compact] version = "2.1.1" optional = true default-features = false features = ["random"] [dependencies.rsa] version = "0.9" optional = true default-features = false [dev-dependencies] assert_matches = "1.3" const-decoder = "0.3.0" criterion = "0.5.1" doc-comment = "0.3.3" hex-buffer-serde = "0.4.0" num-bigint = { package = "num-bigint-dig", version = "0.8.2" } rand = "0.8.3" uuid = { version = "1.10.0", features = ["serde", "v4"] } version-sync = "0.9" [features] default = ["std", "clock", "ciborium"] # Enables `std`-specific functionality (such as error types implementing # the standard `Error` trait). std = ["anyhow/std", "serde_json/std", "ciborium?/std"] # Enables getting the current time using `Utc::now()` from `chrono`. # Without it, some `TimeOptions` constructors, such as the `Default` impl, # are not available. It is still possible to create `TimeOptions` # with an excplicitly specified clock function, or to set / verify # time-related `Claims` fields manually. clock = ["chrono/clock"] # `secp256k1` crypto backend; `lazy_static` is required for internal initialization. es256k = ["secp256k1", "lazy_static"] # RSA algorithm and its dependencies (currently, `getrandom`-based RNG). rsa = ["dep:rsa", "rand_core/getrandom", "sha2/oid"] [[bench]] name = "encoding" harness = false path = "benches/encoding.rs" required-features = ["std", "clock"] [[test]] name = "rsa" path = "tests/rsa.rs" required-features = ["rsa/pem"] [workspace] members = [".", "e2e-tests/no-std", "e2e-tests/wasm"]