MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_mcp_tool_permissions

Function test_mcp_tool_permissions

core/src/permissions/tests.rs:443–451  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

441
442#[test]
443fn test_mcp_tool_permissions() {
444 let policy = PermissionPolicy::new()
445 .allow("mcp__pencil")
446 .deny("mcp__dangerous");
447
448 assert!(policy.is_allowed("mcp__pencil__batch_design", &json!({})));
449 assert!(policy.is_allowed("mcp__pencil__batch_get", &json!({})));
450 assert!(policy.is_denied("mcp__dangerous__execute", &json!({})));
451}
452
453#[test]
454fn test_allow_by_default_with_mcp_wildcard_deny() {

Callers

nothing calls this directly

Calls 2

denyMethod · 0.80
allowMethod · 0.80

Tested by

no test coverage detected