token-handler 0.1.1

A library for handling tokens
Documentation
  • Coverage
  • 0%
    0 out of 8 items documented0 out of 0 items with examples
  • Size
  • Source code size: 15.7 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 831.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 34s Average build duration of successful builds.
  • all releases: 32s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • bongkow/token-handler
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bongkow

Token Handler

A Rust library for handling JWT tokens with simple decoding functionality.

Features

  • JWT token decoding with validation
  • Support for standard JWT claims

Installation

Add this to your Cargo.toml:

[dependencies]

token-handler = "0.1.0"

Usage

use token_handler::decode_token;

fn main() {
    let token = "your.jwt.token";
    let secret_key = "your-secret-key";
    
    match decode_token(token, secret_key) {
        Ok(claims) => println!("Token decoded successfully: {:?}", claims),
        Err(err) => println!("Failed to decode token: {}", err),
    }
}

Token Structure

The decoder expects tokens with the following claims:

  • application: The application identifier
  • address: User address
  • iat: Issued at timestamp
  • exp: Expiration timestamp
  • iss: Issuer information

License

MIT