#cloudflare #jwt #zero #trust #validation #token #applications

rust-cfzt-validator

A library crate for validation of Cloudflare Zero Trust JWTs

4 releases (2 breaking)

new 0.3.1 Dec 19, 2024
0.3.0 Dec 18, 2024
0.2.0 Dec 15, 2024
0.1.0 Jun 11, 2024

#771 in Network programming

Download history 6/week @ 2024-09-19 6/week @ 2024-09-26 6/week @ 2024-10-03 1/week @ 2024-12-05 94/week @ 2024-12-12

95 downloads per month

MIT license

40KB
868 lines

rust-cfzt-validator

This crate provides the basic machinery required to build apps that can integrate with Cloudflare Zero Trust by validating and inspecting Application Token JWTs.

Specifically, this crate provides the following:

  • Parsing/retrieval of signing keys from the Cloudflare Zero Trust API
  • Lazy construction and caching of the jsonwebtoken::DecodingKey structs derived fromt the signing keys
  • Configurable validation of Application Tokens for one or multiple Zero Trust teams
  • Optional convenience struct for validated claims
  • Support for periodic refreshes of the Cloudflare Zero Trust signing keys

By design, this crate does not provide the following:

  • Machinery for retrieving the User Identity data associated with a token.
  • Opinionated patterns for integration into async runtimes

Dependencies

~3–12MB
~152K SLoC