gleamunison/capability

Types

A sandbox policy: the exact set of abilities a program may use, named by their content-addressed keys (“m_” + hash suffix). Anything not listed is denied — deny-by-default, never allow-by-default.

pub type Policy {
  Policy(allow: List(String))
}

Constructors

  • Policy(allow: List(String))

Values

pub fn allow(keys: List(String)) -> Policy
pub fn allows(policy: Policy, key: String) -> Bool
pub fn check(
  policy: Policy,
  frames: List(effects.HandlerFrame),
) -> Result(Nil, List(String))

Pre-flight: which abilities in these frames does the policy deny? Ok(Nil) means every frame is allowed.

✨ Search Document