Skip to content

Support disabling some WASIp1 APIs #31

@rockwotj

Description

@rockwotj

At the moment, the runtime unconditionally gives access to the filesystem, as well as all WASI APIs (system clock, etc). It would be good to make those options.

qjs/runtime.go

Lines 123 to 137 in 461716f

if _, err := wsp1.Instantiate(option.Context, runtime.wrt); err != nil {
return nil, fmt.Errorf("failed to instantiate WASI: %w", err)
}
if _, err := runtime.wrt.NewHostModuleBuilder("env").
NewFunctionBuilder().
WithFunc(option.ProxyFunction).
Export("jsFunctionProxy").
Instantiate(option.Context); err != nil {
return nil, fmt.Errorf("failed to setup host module: %w", err)
}
fsConfig := wazero.
NewFSConfig().
WithDirMount(runtime.option.CWD, "/")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions