(proto: ProtoSandboxPolicy)
| 100 | type Error = miette::Report; |
| 101 | |
| 102 | fn try_from(proto: ProtoSandboxPolicy) -> Result<Self, Self::Error> { |
| 103 | // In cluster mode we always run with proxy networking so all egress |
| 104 | // can be evaluated by OPA and `inference.local` is always addressable. |
| 105 | let network = NetworkPolicy { |
| 106 | mode: NetworkMode::Proxy, |
| 107 | proxy: Some(ProxyPolicy { http_addr: None }), |
| 108 | }; |
| 109 | |
| 110 | Ok(Self { |
| 111 | version: proto.version, |
| 112 | filesystem: proto |
| 113 | .filesystem |
| 114 | .map(FilesystemPolicy::from) |
| 115 | .unwrap_or_default(), |
| 116 | network, |
| 117 | landlock: proto.landlock.map(LandlockPolicy::from).unwrap_or_default(), |
| 118 | process: proto.process.map(ProcessPolicy::from).unwrap_or_default(), |
| 119 | }) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | impl From<ProtoFilesystemPolicy> for FilesystemPolicy { |
nothing calls this directly
no outgoing calls
no test coverage detected