std::permissions::grants
What khora.toml granted, as Khora.
This file is replaced at build time. khora build reads the whole
[permissions] table – fs, env, network, listen and process
alike – and writes this module out with the manifest’s own patterns in
all six functions below; what is on disk is the default, which grants
everything.
It is a file of its own so that the replacement is a whole file rather
than surgery on one: the matcher in std::permissions is real code that
nothing generated should be editing, and a compiler that rewrites a
function body inside a file it does not otherwise understand is a compiler
that breaks the next time somebody reformats it.
A missing [permissions] table grants everything. That is opt-in
tightening rather than a tax on starting, and it is why the defaults here
are wildcards rather than nothing: ** for the two path grants, which
spans separators, and * for env, network, listen and process,
whose subjects are single names.
API at a glance
Section titled “API at a glance”Functions: fs_read · fs_write · env · network · listen · process
Functions
Section titled “Functions”fs_read
Section titled “fs_read”pub fn fs_read() -> List<String>Paths this program may read.
fs_write
Section titled “fs_write”pub fn fs_write() -> List<String>Paths this program may write.
pub fn env() -> List<String>Environment variables this program may read.
network
Section titled “network”pub fn network() -> List<String>Hosts this program may reach, as name or name:port.
listen
Section titled “listen”pub fn listen() -> List<String>Ports this program may bind and listen on: a port, a range, 0, or *.
process
Section titled “process”pub fn process() -> List<String>Programs this program may run, by name.
Khora 0.4.0built fromee766ae43388on 2026-11-26 22:56ZVersioningSecurityContributingReleasesSource