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

Function kill_by_ip

nodedb/src/control/security/session_registry.rs:223–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221
222 #[test]
223 fn kill_by_ip() {
224 let reg = SessionRegistry::new();
225 let _rx1 = reg.register("s1", &params("u1", "10.0.0.1:5000", "native", "password"));
226 let _rx2 = reg.register("s2", &params("u2", "10.0.0.1:5001", "pgwire", "password"));
227 let _rx3 = reg.register("s3", &params("u3", "192.168.1.1:5000", "http", "api_key"));
228
229 let killed = reg.kill_sessions_for_ip("10.0.0.1");
230 assert_eq!(killed, 2);
231 }
232
233 #[test]
234 fn different_users_isolated() {

Callers

nothing calls this directly

Calls 3

paramsFunction · 0.70
registerMethod · 0.45
kill_sessions_for_ipMethod · 0.45

Tested by

no test coverage detected