errors
errors
¶
Typed varlink errors the hub can raise from Verdict and SetMute.
Subclasses of asyncvarlink.TypedVarlinkErrorReply — the hub
raises one of these on a refusal path (four for Verdict, one for
SetMute), and clients pattern-match on the error name instead of
stringly-matching a message. All of them share the
org.terok.Clearance1 interface namespace.
UnknownRequest
¶
Bases: TypedVarlinkErrorReply
Verdict referenced a request_id the hub didn't emit.
Fail-closed for the attacker's dream-up case: a peer connecting to the clearance socket synthesises a verdict for a block that was never broadcast. No binding, no action.
VerdictTupleMismatch
¶
Bases: TypedVarlinkErrorReply
(container, dest) don't match the hub's pending record.
Cheap defence against replay attackers who sniffed a request_id
on this connection but try to apply a verdict against a different
destination. expected_* are what the hub recorded when it
emitted connection_blocked; got_* are what the call
carried.
InvalidAction
¶
ShieldCliFailed
¶
Bases: TypedVarlinkErrorReply
terok-shield allow|deny exited non-zero or timed out.
The operator's click reached the hub, but the firewall did not accept
it, so the notification's premise ("you decided X") would be wrong.
This error goes back to the Verdict caller only. The red "Allow
failed" / "Deny failed" popups are drawn from the verdict_applied
event the hub fans out to every subscriber. That event carries the
same text, sanitised, as its reason. stderr is whatever
terok-shield wrote, capped at 512 bytes by the verdict helper.
UnknownContainer
¶
Bases: TypedVarlinkErrorReply
SetMute named a container this hub does not serve.
A per-container hub knows its container by one canonical key — the
12-char short id every event carries — plus the aliases its launcher
registered (the full id, the podman name). Any other key could never
match an event, so accepting it would report a mute while every prompt
kept coming. expected is the canonical key the caller should have
used.