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 authentication support for API testing.
//!
//! This module provides runtime OAuth2 authentication, enabling API testing
//! with OAuth2-protected endpoints. It integrates with the `oauth2` crate for
//! RFC-compliant token acquisition and management.
//!
//! # Feature Flag
//!
//! This module is only available when the `oauth2` feature is enabled:
//!
//! ```toml
//! [dependencies]
//! clawspec-core = { version = "...", features = ["oauth2"] }
//! ```
//!
//! # Supported Flows
//!
//! - **Client Credentials**: Machine-to-machine authentication (most common for testing)
//! - **Pre-Acquired Token**: Use externally obtained tokens (environment variables, etc.)
//!
//! # Example
//!
//! ```rust,ignore
//! use clawspec_core::{ApiClient, OAuth2Config};
//!
//! let oauth2 = OAuth2Config::client_credentials(
//! "client-id",
//! "client-secret",
//! "https://auth.example.com/token",
//! )
//! .add_scope("read:users")
//! .build();
//!
//! let client = ApiClient::builder()
//! .with_oauth2(oauth2)
//! .build()?;
//!
//! // Token acquired automatically on first request
//! client.get("/users")?.await?.as_json::<Vec<User>>().await?;
//! ```
pub use ;
pub use OAuth2Error;
pub use OAuth2Token;