fix(keystone): fail closed on EC2 auth and apply configured timeout (#4464)

This commit is contained in:
Zhengchao An
2026-07-08 18:31:48 +08:00
committed by GitHub
parent 7a33ba5e21
commit 9ffedc0e2b
9 changed files with 94 additions and 78 deletions
+1 -15
View File
@@ -40,6 +40,7 @@
//! config.admin_project.clone(),
//! config.get_admin_domain(),
//! config.verify_ssl,
//! config.get_timeout(),
//! );
//!
//! let auth_provider = KeystoneAuthProvider::new(
@@ -141,21 +142,6 @@ pub struct EC2Credential {
pub trust_id: Option<String>,
}
impl EC2Credential {
/// Parse access key to extract user_id and project_id
///
/// Format: "user_id:project_id" or "user_id"
pub fn parse_access_key(access_key: &str) -> Option<(String, Option<String>)> {
if access_key.contains(':') {
let parts: Vec<&str> = access_key.split(':').collect();
if parts.len() == 2 {
return Some((parts[0].to_string(), Some(parts[1].to_string())));
}
}
Some((access_key.to_string(), None))
}
}
/// Token cache for performance optimization
#[derive(Clone)]
pub struct TokenCache {