interface
interface
¶
The org.terok.ClearanceVerdict1 varlink interface.
One method — Apply(container, dest, action) returning
(ok, stderr) — bridging the hardened hub to the unhardened
verdict helper that actually execs terok-shield allow|deny.
The interface is dumb on purpose: the hub already did the authz
check (request_id matches the emitted connection_blocked
triple); the helper just forwards to shield and passes the outcome
back. Security-critical invariants stay on the hub side where
their caller-trust story is easiest to audit.
VERDICT_INTERFACE_NAME = 'org.terok.ClearanceVerdict1'
module-attribute
¶
VerdictReply
¶
Verdict1Interface(apply_verdict)
¶
Bases: VarlinkInterface
Minimal varlink interface served by the verdict helper.
apply_verdict is injected so the interface stays testable
without a live shield subprocess. Async because the hub client
awaits on it; the helper's implementation is async anyway.
Bind the verdict-dispatch callable.
Source code in src/terok_clearance/verdict/interface.py
Apply(*, container, dest, action)
async
¶
Run terok-shield <action> <container> <dest> and report the outcome.
The helper never raises — spawn failure, non-zero exit, and
timeout all fold into ok=False with a reason string the
hub re-raises to its own client as
ShieldCliFailed. Any
unexpected exception from the injected helper is caught here
too so it surfaces as a structured reply instead of a varlink
transport error on the hub side; CancelledError is always
re-raised so shutdown propagates cleanly.