mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 19:42:17 +00:00
fix(keystone): fail closed on EC2 auth and apply configured timeout (#4464)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user