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

Function ip_requirement

nodedb/src/control/security/conditional.rs:303–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301
302 #[test]
303 fn ip_requirement() {
304 let auth = test_auth();
305 let cond = GrantCondition::RequireIp {
306 allowed_cidrs: vec!["10.0.0.0/8".into()],
307 };
308 assert!(evaluate_conditions(std::slice::from_ref(&cond), &auth, "10.0.0.5").is_ok());
309 assert!(evaluate_conditions(std::slice::from_ref(&cond), &auth, "192.168.1.1").is_err());
310 }
311
312 #[test]
313 fn step_up_auth() {

Callers

nothing calls this directly

Calls 1

test_authFunction · 0.85

Tested by

no test coverage detected