(name: &str, host: &str)
| 98 | use openshell_core::proto::{NetworkEndpoint, NetworkPolicyRule, SandboxPolicy}; |
| 99 | |
| 100 | fn rule(name: &str, host: &str) -> NetworkPolicyRule { |
| 101 | NetworkPolicyRule { |
| 102 | name: name.to_string(), |
| 103 | endpoints: vec![NetworkEndpoint { |
| 104 | host: host.to_string(), |
| 105 | port: 443, |
| 106 | protocol: "rest".to_string(), |
| 107 | tls: String::new(), |
| 108 | enforcement: "enforce".to_string(), |
| 109 | access: "read-write".to_string(), |
| 110 | rules: Vec::new(), |
| 111 | allowed_ips: Vec::new(), |
| 112 | ports: Vec::new(), |
| 113 | deny_rules: Vec::new(), |
| 114 | allow_encoded_slash: false, |
| 115 | ..Default::default() |
| 116 | }], |
| 117 | binaries: Vec::new(), |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | #[test] |
| 122 | fn provider_rule_name_sanitizes_provider_names() { |
no outgoing calls