MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / validate

Method validate

vmm/src/config.rs:457–466  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)]

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected