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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! ONES OpenID Connect client for Rust
//!
//! This library provides authentication with ONES using OpenID Connect (OIDC)
//! and Client Initiated Backchannel Authentication (CIBA).
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use ones_oidc::{OpenIdconnectClient, OnesOidcConfig, load_device_config, read_private_key};
//! use openidconnect::{core::CoreProviderMetadata, reqwest::async_http_client};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Load device configuration
//! let device_config = load_device_config("device_config.yml")?;
//! let private_key = read_private_key("private_key.pem")?;
//!
//! // Get issuer URL and discover metadata
//! let issuer_url = device_config.get_issuer_url()?;
//! let provider_metadata = CoreProviderMetadata::discover_async(
//! issuer_url.clone(),
//! async_http_client,
//! ).await?;
//!
//! // Create client with configuration
//! let config = OnesOidcConfig::default()
//! .timeout(std::time::Duration::from_secs(10));
//!
//! let client = OpenIdconnectClient::with_config(
//! device_config.client_id,
//! issuer_url,
//! provider_metadata,
//! private_key,
//! config,
//! );
//! # Ok(())
//! # }
//! ```
// Private implementation modules
// Optional public modules for advanced usage
// === Core API ===
/// Main OIDC client for authentication operations
pub use OpenIdconnectClient;
/// Configuration for the OIDC client
pub use OnesOidcConfig;
/// Device configuration loading utilities
pub use ;
/// Private key utilities
pub use read_private_key;
// === Error Types ===
pub use ;
// === Authentication Types ===
pub use ;
// === Well-Known Application Discovery ===
pub use ;
// === OIDC Backend Types (for advanced users) ===
pub use ;
// === Default Configuration Paths ===
/// Default path for device configuration file
pub const DEFAULT_DEVICE_CONFIG_PATH: &str = "/etc/px-device-identity/device.yml";
/// Default path for device private key file
pub const DEFAULT_PRIVATE_KEY_PATH: &str = "/root/.local/share/px-device-identity/private.pem";
// === Re-exported OpenIDConnect Types ===
/// Re-exported types from the `openidconnect` crate for convenience
pub use ;