jtai-access (0.4.4)
Published 2025-12-24 12:55:25 -08:00 by jtai
Installation
[registry]
default = "forgejo"
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add jtai-access@0.4.4About 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 |
|---|---|
| js-sys | ^0.3.83 |
| jsonwebtoken | ^10.2.0 |
| reqwest | ^0.12.15 |
| serde | ^1.0.219 |
| thiserror | ^2.0.12 |
| tokio | ^1.44.1 |
| uuid | ^1.16.0 |
| worker | ^0.7.0 |
| axum | ^0.8.3 |
| serde_json | ^1.0.140 |
| tokio | ^1.44.1 |
Details
2025-12-24 12:55:25 -08:00
Assets (1)
Versions (9)
View all
Cargo
11
Jasmine Tai <jtai@jtai.ca>
UNLICENSED
18 KiB
jtai-access-0.4.4.crate
18 KiB