jtai-access (0.3.0)

Published 2025-04-01 10:27:21 -07:00 by jtai

Installation

[registry]
default = "forgejo"

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add jtai-access@0.3.0

About this package

Super simple library for validating Cloudflare Access JWTs

jtai-access

Simple Cloudflare Access JWT validator.

Usage

You will need:

  • Your team name
  • Your application's AUD tag
# #[tokio::main]
# async fn main() {
use jtai_access::Validator;

let validator = Validator::new("team_name", "aud_tag");

# let mut headers = std::collections::HashMap::new();
# headers.insert("cf-access-jwt-assertion", "...");
if let Some(jwt) = headers.get("cf-access-jwt-assertion") {
    if let Ok(claims) = validator.validate(jwt).await {
        println!("{claims:?}");
    }
}
# }

Dependencies

ID Version
jwtk ^0.4.0
reqwest ^0.12.15
serde ^1.0.219
thiserror ^2.0.12
uuid ^1.16.0
axum ^0.8.3
serde_json ^1.0.140
tokio ^1.44.1
Details
Cargo
2025-04-01 10:27:21 -07:00
9
Jasmine Tai <jtai@jtai.ca>
UNLICENSED
16 KiB
Assets (1)
Versions (1) View all
0.3.0 2025-04-01