Validate that the host API address is a vsock address. The host API must only listen on vsock for security reasons. TCP/Unix socket listening is not supported.
(&self)
| 455 | /// The host API must only listen on vsock for security reasons. |
| 456 | /// TCP/Unix socket listening is not supported. |
| 457 | pub fn validate(&self) -> Result<()> { |
| 458 | if !self.address.starts_with("vsock:") { |
| 459 | anyhow::bail!( |
| 460 | "Host API address must be a vsock address (e.g., 'vsock:2'), got: '{}'. \ |
| 461 | TCP/Unix socket listening is not supported for the host API.", |
| 462 | self.address |
| 463 | ); |
| 464 | } |
| 465 | Ok(()) |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | #[derive(Debug, Clone, Deserialize, Serialize)] |