Add the cast-allow block to zesdex-entities/src/lib.rs and zesdex-utils/src/lib.rs (which lacked it), then remove from 65 sub-files across all 8 crates. Build and all 223 tests continue to pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
//! Pure OAuth entities — no HTTP or persistence logic.
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
/// An OAuth 2.0 access token with optional refresh token and absolute
|
|
/// expiry time (epoch seconds).
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct OAuthToken {
|
|
pub access_token: String,
|
|
pub refresh_token: Option<String>,
|
|
pub expires_at: u64,
|
|
pub token_type: String,
|
|
}
|
|
|
|
/// Static configuration for an OAuth provider.
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct OAuthConfig {
|
|
pub auth_url: String,
|
|
pub token_url: String,
|
|
pub client_id: String,
|
|
pub client_secret: Option<String>,
|
|
pub scopes: Vec<String>,
|
|
}
|
|
|
|
impl Default for OAuthConfig {
|
|
fn default() -> Self {
|
|
OAuthConfig {
|
|
auth_url: String::new(),
|
|
token_url: String::new(),
|
|
client_id: String::new(),
|
|
client_secret: None,
|
|
scopes: vec![
|
|
"openid".to_string(),
|
|
"profile".to_string(),
|
|
"email".to_string(),
|
|
],
|
|
}
|
|
}
|
|
}
|