mirror of
https://github.com/telemt/telemt.git
synced 2026-10-09 10:55:57 +03:00
Runtime Ownership hardened
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use super::*;
|
||||
use tracing::warn;
|
||||
|
||||
pub(in crate::api) async fn rotate_secret(
|
||||
user: &str,
|
||||
@@ -108,6 +109,18 @@ pub(in crate::api) async fn delete_user(
|
||||
.map_err(|e| ApiFailure::bad_request(format!("config validation failed: {}", e)))?;
|
||||
let revision =
|
||||
save_access_sections_to_disk(&shared.config_path, &cfg, &touched_sections).await?;
|
||||
let configured_users = cfg.access.users.keys().cloned().collect();
|
||||
if let Err(error) = shared
|
||||
.quota_state
|
||||
.remove_user(&configured_users, user)
|
||||
.await
|
||||
{
|
||||
warn!(
|
||||
user,
|
||||
error = %error,
|
||||
"Deleted user quota checkpoint cleanup will be reconciled on restart"
|
||||
);
|
||||
}
|
||||
drop(_guard);
|
||||
shared.ip_tracker.remove_user_limit(user).await;
|
||||
shared.ip_tracker.clear_user_ips(user).await;
|
||||
|
||||
Reference in New Issue
Block a user