MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / expand_full_preset

Function expand_full_preset

crates/openshell-supervisor-network/src/l7/mod.rs:2718–2739  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2716
2717 #[test]
2718 fn expand_full_preset() {
2719 let mut data = serde_json::json!({
2720 "network_policies": {
2721 "test": {
2722 "endpoints": [{
2723 "host": "api.example.com",
2724 "port": 80,
2725 "protocol": "rest",
2726 "access": "full"
2727 }],
2728 "binaries": []
2729 }
2730 }
2731 });
2732 expand_access_presets(&mut data);
2733 let rules = data["network_policies"]["test"]["endpoints"][0]["rules"]
2734 .as_array()
2735 .unwrap();
2736 assert_eq!(rules.len(), 1);
2737 assert_eq!(rules[0]["allow"]["method"].as_str().unwrap(), "*");
2738 assert_eq!(rules[0]["allow"]["path"].as_str().unwrap(), "**");
2739 }
2740
2741 #[test]
2742 fn expand_graphql_readonly_preset() {

Callers

nothing calls this directly

Calls 1

expand_access_presetsFunction · 0.85

Tested by

no test coverage detected