MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / kill_sessions_for_user

Method kill_sessions_for_user

nodedb/src/control/security/session_registry.rs:79–89  ·  view source on GitHub ↗

Kill all sessions for a specific user. Returns the number of sessions killed.

(&self, user_id: &str)

Source from the content-addressed store, hash-verified

77 /// Kill all sessions for a specific user.
78 /// Returns the number of sessions killed.
79 pub fn kill_sessions_for_user(&self, user_id: &str) -> usize {
80 let sessions = self.sessions.read().unwrap_or_else(|p| p.into_inner());
81 let mut killed = 0;
82 for session in sessions.values() {
83 if session.user_id == user_id {
84 let _ = session.kill_tx.send(true);
85 killed += 1;
86 }
87 }
88 killed
89 }
90
91 /// Kill all sessions matching a peer address (for IP blacklist).
92 pub fn kill_sessions_for_ip(&self, peer_addr: &str) -> usize {

Callers 4

register_and_killFunction · 0.45
different_users_isolatedFunction · 0.45
kill_user_sessionsFunction · 0.45

Calls 2

readMethod · 0.45
sendMethod · 0.45

Tested by 3

register_and_killFunction · 0.36
different_users_isolatedFunction · 0.36