moq_auth/lib.rs
1//! The authorization contract for Media over QUIC.
2//!
3//! A relay asks one question per session, "may this connect?", and this crate holds
4//! every piece of the answer:
5//!
6//! - [`Request`] and [`Grant`]: the JSON a relay POSTs to an auth server on
7//! [`Event::Connect`], [`Event::Revalidate`], and [`Event::End`], and what comes back.
8//! - [`lease::Producer`] / [`lease::Consumer`]: the handle a session holds for its
9//! grant, so whoever runs the accept loop decides how, in process or over HTTP.
10//! - [`Client`]: the HTTP implementation that drives a lease against `--auth-url`.
11//! - [`serve::Server`]: the reference server behind `moq auth serve`, holding the
12//! policy a relay used to: keys, public rules, an mTLS grant, tiers, and limits.
13//! - [`Claims`], [`Key`], and [`KeySet`]: the JWT a client presents in its query, with
14//! the keys that sign and verify it. `moq auth generate|sign|verify` is the CLI.
15//!
16//! Grants and claims name paths with [`Pattern`]s from `moq-pattern`, re-exported here:
17//! `foo` is one broadcast, `foo/**` is a subtree, `**` is everything.
18
19mod algorithm;
20mod claims;
21mod error;
22mod fs;
23mod generate;
24mod grant;
25mod key;
26mod key_id;
27mod path;
28mod request;
29mod set;
30
31pub mod lease;
32#[cfg(feature = "serve")]
33pub mod serve;
34
35#[cfg(feature = "client")]
36mod client;
37
38pub use algorithm::*;
39pub use claims::*;
40#[cfg(feature = "client")]
41pub use client::*;
42pub use error::*;
43pub use grant::*;
44pub use key::*;
45pub use key_id::*;
46pub use moq_pattern::{InvalidPattern, Pattern, Patterns, Segment, Specificity};
47pub use request::*;
48pub use set::*;