()
| 441 | |
| 442 | #[test] |
| 443 | fn 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] |
| 454 | fn test_allow_by_default_with_mcp_wildcard_deny() { |