WasmtimePreview3ComponentConfig

data class WasmtimePreview3ComponentConfig(val target: String = WasmtimeAutomaticTarget, val precompiledComponentBytes: ByteArray, val preopens: List<WasmtimePreview3Preopen>, val arguments: List<String> = emptyList(), val environment: Map<String, String> = emptyMap(), val networkPolicy: WasmtimePreview3NetworkPolicy = WasmtimePreview3NetworkPolicy(), val maxMemoryBytes: Long = DefaultWasmtimeMaxMemoryBytes, val executionTimeoutMillis: Long = 0, val maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes, val maxTableElements: Long = WasmtimeUnlimitedResourceLimit, val maxInstances: Long = WasmtimeUnlimitedResourceLimit, val maxTables: Long = WasmtimeUnlimitedResourceLimit, val maxMemories: Long = WasmtimeUnlimitedResourceLimit, val maxFuel: Long = WasmtimeUnlimitedResourceLimit)

Configuration for running a precompiled WASI Preview 3 component through the Wasmtime bridge.

Trust boundary for precompiled artifacts

precompiledComponentBytes is a serialized Wasmtime component artifact. The bridge deserializes it with Wasmtime's unsafe deserialization API, so these bytes are equivalent to native code running in the host process: a crafted artifact bypasses maxFuel, maxMemoryBytes, networkPolicy and the filesystem preopens. The bridge has no path that compiles a component from validated .wasm bytes, so the host alone is responsible for producing the artifact with a trusted, pinned Wasmtime toolchain (for example wasmtime compile) from a component it has validated, and for storing it where plugins cannot write. Never accept precompiled component bytes from a plugin bundle or from an untrusted network location.

Constructors

Link copied to clipboard
constructor(target: String = WasmtimeAutomaticTarget, precompiledComponentBytes: ByteArray, preopens: List<WasmtimePreview3Preopen>, arguments: List<String> = emptyList(), environment: Map<String, String> = emptyMap(), networkPolicy: WasmtimePreview3NetworkPolicy = WasmtimePreview3NetworkPolicy(), maxMemoryBytes: Long = DefaultWasmtimeMaxMemoryBytes, executionTimeoutMillis: Long = 0, maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes, maxTableElements: Long = WasmtimeUnlimitedResourceLimit, maxInstances: Long = WasmtimeUnlimitedResourceLimit, maxTables: Long = WasmtimeUnlimitedResourceLimit, maxMemories: Long = WasmtimeUnlimitedResourceLimit, maxFuel: Long = WasmtimeUnlimitedResourceLimit)
constructor(target: String = WasmtimeAutomaticTarget, precompiledComponentBytes: ByteArray, hostPreopenRoot: String, guestPreopenRoot: String = "/", arguments: List<String> = emptyList(), environment: Map<String, String> = emptyMap(), networkPolicy: WasmtimePreview3NetworkPolicy = WasmtimePreview3NetworkPolicy(), maxMemoryBytes: Long = DefaultWasmtimeMaxMemoryBytes, executionTimeoutMillis: Long = 0, maxWasmStackBytes: Long = DefaultWasmtimeMaxWasmStackBytes, maxTableElements: Long = WasmtimeUnlimitedResourceLimit, maxInstances: Long = WasmtimeUnlimitedResourceLimit, maxTables: Long = WasmtimeUnlimitedResourceLimit, maxMemories: Long = WasmtimeUnlimitedResourceLimit, maxFuel: Long = WasmtimeUnlimitedResourceLimit)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard