Registry / auth / frank-jwt

frank-jwt

JSON →
library3.1.4rscratesunverified

Implementation of JSON Web Tokens (JWT) for encoding and decoding.

# Cargo.toml [dependencies] frank_jwt = "3.1.4"
INSTALL
IMPORT
SIG · FRANK-JWT
F
frank-jwt
authrustv3.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

encode
use frank_jwt::{encode, decode};

Creates a JWT token with HS256 signing.

use frank_jwt::{encode, Algorithm, default_header}; fn main() { let payload = serde_json::json!({ "sub": "1234567890" }); let secret = "secret"; let header = default_header(); let token = encode(header, &payload, secret, Algorithm::HS256).unwrap(); println!("Token: {}", token); }
Debug
Known issues
gotchaThe crate uses a custom `Algorithm` enum that may not cover all JWT algorithms.
fix
Check the documentation for supported algorithms before use.
affects: <=3.1.4
Upgrade
Version history
3.1.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
Resources
frank-jwt — cargo add frank-jwt · libregistry