Documentation
¶
Overview ¶
Package localmost is a clean-room, behaviourally-compatible reimplementation of the federicotdn/localmost rule engine. It evaluates a shell command against allow/deny rules loaded from a localmost-format config.json and returns one of three policies: allow, ask, or deny.
It is written from localmost's public documentation (its README and docs/examples.md), NOT from its GPL-3.0 Haskell source. Behavioural parity is validated by a conformance corpus rather than bit-identical parsing (graith uses mvdan.cc/sh where localmost uses ShellCheck). Known divergences are tracked in docs/design/2026-07-03-pluggable-approvals-backends-design.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine evaluates commands against compiled allow/deny rules.
func (*Engine) AskNoninteractive ¶
AskNoninteractive reports the config's askNoninteractive setting (default true). When false, callers should turn an "ask" into a "deny" in non-interactive contexts.
type Rule ¶
Rule is a single allow/deny rule from the config.
func (*Rule) UnmarshalJSON ¶
UnmarshalJSON parses a rule, applying localmost's defaults (redirect="safe", pipe=true) and accepting the bool/string forms of the redirect and pipe keys. A rule may be given either as an object ({"rule":"..."}) or, as a convenience, as a bare string ("...").