protocol_droid/application/oauth/mod.rs
1//! OAuth 2.1 authorization, as MCP's revisions specify it.
2//!
3//! Which revision requires what is `authorization_model`
4//! in `domain/`. This module holds the decisions that follow from it, and they
5//! are split by who makes them: `token` is the pure logic this crate owns and
6//! can be tested without a socket, while the crypto and HTTP that turn a
7//! presented string into claims live in adapters.
8//!
9//! No scope vocabulary is defined here. The vendored spec names no scope
10//! strings, so any table would be this crate inventing one and presenting it as
11//! policy — see [`token::ScopePolicy`].
12
13// `client`, `callback` and `redeem` read `domain::oauth`, which is gated on the
14// same feature, so they carry the gate too. `token` does not and stays ungated:
15// it is pure claim logic with no dependency on a SHA-256 implementation or a
16// base64url codec.
17#[cfg(feature = "oauth")]
18pub mod authorizer;
19#[cfg(feature = "oauth")]
20pub mod callback;
21#[cfg(feature = "oauth")]
22pub mod client;
23#[cfg(feature = "oauth")]
24pub mod environment;
25#[cfg(feature = "oauth")]
26pub mod flow;
27#[cfg(feature = "oauth")]
28pub mod metadata;
29#[cfg(feature = "oauth")]
30pub mod redeem;
31#[cfg(feature = "oauth")]
32pub mod registration;
33mod token;
34
35pub use token::{
36 Audience, NoScopes, Refusal, ScopePolicy, SourceError, TokenClaims, TokenPolicy, TokenSource,
37 authenticate, verify,
38};