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
40
41
42
43
44
45
46
47
48
49
//! OAuth2 server and personal access tokens for Rust applications.
//!
//! `rustbasic-passport` is a port of [`laravel/passport`](https://github.com/laravel/passport)
//! to the Rust ecosystem. It provides:
//!
//! - `authorization_code` grant with PKCE (S256 / plain)
//! - `password` grant
//! - `client_credentials` grant
//! - `refresh_token` grant with rotation
//! - Device Authorization grant (RFC 8628): `issue_device_code` + `approve_device_code`
//! - `personal_access` grant and `create_personal_access_token`
//! - per-client `grant_types` (Passport 13.x schema)
//! - JWT access tokens signed with RS256 (RFC 7519), revoked via the token store
//! - an optional `axum` integration: routes and auth / scope middleware
//! - an optional `loco` integration: loco.rs `Routes` / `Initializer`
//!
//! ```text
//! let stores = StoreBundle::new(clients, tokens, auth_codes, refresh_tokens, device_codes, users);
//! let server = PassportServer::new(stores, SigningKey::generate("default")?, Config::default());
//!
//! let response = server.issue_token(&TokenRequest {
//! grant_type: Some("password".into()),
//! client_id: Some("web".into()),
//! client_secret: Some("secret".into()),
//! username: Some("user@example.com".into()),
//! password: Some("password".into()),
//! ..Default::default()
//! }).await?;
//! ```
//!
//! Complete working examples: `examples/in_memory.rs` (full flow, no framework) and
//! `examples/axum_server.rs` (axum middleware + routes).
pub use *;
pub use *;
pub use *;
pub use *;