1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Static token authorization state for bearer token gates.
//!
//! This module provides the [`StaticTokenAuthorized`] type, which represents
//! the authorization state when using static bearer tokens. It's used internally
//! by the bearer token gate system to track whether a request has been authorized
//! via a valid static token.
//!
//! # Usage
//!
//! This type is typically used as an axum extension to indicate authorization status:
//!
//! ```rust
//! use axum::extract::Extension;
//! use axum_gate::gate::bearer::StaticTokenAuthorized;
//!
//! async fn handler(Extension(auth): Extension<StaticTokenAuthorized>) -> String {
//! if auth.is_authorized() {
//! "Access granted".to_string()
//! } else {
//! "Access denied".to_string()
//! }
//! }
//! ```
/// Extension wrapper for static token optional/strict modes.
;