terok_clearance
terok_clearance
¶
Clearance hub + desktop notification library for terok.
The operator-UI plane for terok-shield: turns shield's blocked- connection events into Allow/Deny prompts and routes the operator's verdict back to shield for enforcement. Two axes of pluggability apply:
- Producer (event source) — closed. Shield is the only
producer. The wire vocabulary (
shield_up,connection_blocked, …) names shield's state machine, and the verdict path execsterok-shield allow|deny. A non-shield "clearance" wouldn't work end-to-end; the package is shield's UI plane, not a generic firewall console. - Operator UI (consumer) — open. Anything that subscribes to
the hub's varlink stream and implements the
Notifierprotocol on the verdict-routing side is a valid UI: today the D-Bus desktop notifier (DbusNotifier), the standalone Textualterok clearanceapp, and the embeddedterok-tuiscreen all ride on this seam.
Container-runtime inspection is no longer a clearance concern: the
shield reader resolves the orchestrator-supplied dossier at emit
time and ships it on the wire (ClearanceEvent.dossier), so
clearance has no Python-level coupling to any runtime.
Two unrelated wire formats live under this one package as a result:
org.terok.Clearance1over a unix-socket varlink transport — the hub (ClearanceHub) and the client library (ClearanceClient,EventSubscriber) that drive the per-container block / verdict / lifecycle flow.org.freedesktop.Notificationsover D-Bus — theDbusNotifierwrapper that renders those events as desktop popups. Kept because that's the OS API; the in-package transport is varlink.
The supervisor (in terok-sandbox) composes one
ClearanceHub and one
VerdictServer in-process per
container. Each container has its own hub socket, so operator UIs
multiplex across the per-container sockets via
MultiSocketSubscriber.
__all__ = ['ALL_NOTIFY_CATEGORIES', 'COMMANDS', 'CallbackNotifier', 'ClearanceClient', 'set_container_mute', 'container_mutes', 'ClearanceEvent', 'ClearanceHub', 'EventSubscriber', 'MultiSocketSubscriber', 'NOTIFY_BLOCKED', 'NOTIFY_VERDICT', 'Notification', 'RawClearanceSection', 'VerdictClient', 'VerdictServer', 'create_notifier', 'default_clearance_socket_path', 'parse_verdict_ttl']
module-attribute
¶
ALL_NOTIFY_CATEGORIES = frozenset({NOTIFY_BLOCKED, NOTIFY_VERDICT, NOTIFY_SHIELD_UP, NOTIFY_SHIELD_DOWN, NOTIFY_CONTAINER_STARTED, NOTIFY_CONTAINER_EXITED})
module-attribute
¶
Every category the subscriber recognises — the default opt-in set.
NOTIFY_BLOCKED = 'blocked'
module-attribute
¶
Category for connection_blocked Allow/Deny prompts (interactive).
NOTIFY_VERDICT = 'verdict'
module-attribute
¶
Category for verdict_applied resolution popups (ack of a verdict).
COMMANDS = (CommandDef(name='notify', help='Send a one-shot desktop notification', source='terok_clearance.cli.verbs.notify:COMMAND'), CommandDef(name='serve', help='Run the clearance hub (serves org.terok.Clearance1 varlink on a unix socket)', source='terok_clearance.cli.verbs.serve:COMMAND'), CommandDef(name='serve-verdict', help='Run the verdict helper (serves org.terok.ClearanceVerdict1 for shield exec)', source='terok_clearance.cli.verbs.serve_verdict:COMMAND'), CommandDef(name='clearance', help='Interactive terminal tool for shield clearance verdicts', source='terok_clearance.cli.verbs.clearance:COMMAND'))
module-attribute
¶
__version__ = '0.0.0'
module-attribute
¶
ClearanceClient(*, socket_path=None)
¶
Thin async client for the Clearance1 varlink service.
Two async coroutines to drive:
start— open the subscribe + RPC connections and begin relaying events to the user-supplied callback. Returns once both channels are live; events arrive viaon_eventfrom then on.verdict— RPC call; returnsTrueifterok-shieldapplied the action,Falseon any refusal or shield failure. The refusal reason is logged at WARNING.
set_mute and
mutes ride the
same RPC connection. Both answer None when the call did not land,
so a UI can say "unknown" instead of repeating what it asked for.
The callback runs on the same event loop as the rest of the client; exceptions it raises are logged and swallowed so one bad handler can't kill the stream for every subsequent event.
Remember the target socket; defaults to default_clearance_socket_path.
Source code in src/terok_clearance/client/client.py
start(on_event)
async
¶
Open both connections and begin relaying events to on_event.
The initial connect is awaited synchronously so callers see
start() return only after the subscription is live — a
hub that's down at startup still propagates as an exception.
Subsequent drops are handled by _run_stream's internal
reconnect loop so long-running consumers (TUI, notifier)
survive a systemctl restart terok-clearance without
restarting themselves.
Source code in src/terok_clearance/client/client.py
stop()
async
¶
Close both connections and await the stream task.
Source code in src/terok_clearance/client/client.py
poke_reconnect()
¶
Skip any in-flight reconnect back-off and retry immediately.
Idempotent; a no-op when the stream is healthy because the
event is only awaited inside _run_stream's back-off
window.
Source code in src/terok_clearance/client/client.py
verdict(container, request_id, dest, action)
async
¶
Apply action (allow / deny) to dest via the hub's Verdict RPC.
Returns True when the hub accepted and applied the verdict,
False for any refusal (unknown request_id, tuple mismatch,
invalid action, shield-exec failure). Callers typically ignore
the return value and let the subsequent verdict_applied
event drive UI updates; refusal reasons are logged at WARNING.
For a shield-exec failure, the event carries shield's stderr as
reason, so a popup can explain the failure without this
method's return value.
Source code in src/terok_clearance/client/client.py
set_mute(container, muted)
async
¶
Mute or unmute container's prompts via the hub's SetMute RPC.
container is the key the hub's events carry in
ClearanceEvent.container — the 12-char short id under the terok
supervisor, never a podman or task name.
Returns the mute state the hub now holds, or None when the call
did not land: no live connection, a connection that dropped under
the call, or a refusal such as UnknownContainer. None means
the state is unknown — the reason is logged at WARNING — and a UI
must say so rather than claim either state.
Source code in src/terok_clearance/client/client.py
mutes()
async
¶
Read back which containers the hub is not prompting about, via Mutes().
Returns the set in the keys events carry — empty when nothing is
muted — or None when it cannot be known: no live connection, a
dropped connection, or a hub that predates Mutes() and answers
org.varlink.service.MethodNotFound. None must read as
"unknown", never as "not muted"; the reason is logged at WARNING.
Source code in src/terok_clearance/client/client.py
EventSubscriber(notifier, client=None, *, socket_path=None, enabled_categories=None)
¶
Bridge clearance-hub events into desktop notifications.
Owns the presentation-layer state a rendering client needs: live-block
dedup keyed on (container, target), the tracked ShieldDown
popup per container so ShieldUp can retire it, and verdict routing
through notifier action callbacks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
notifier
|
Notifier
|
Desktop notification backend (any |
required |
client
|
ClearanceClient | None
|
Pre-configured |
None
|
socket_path
|
Path | None
|
Clearance-socket override when client isn't supplied (tests). |
None
|
enabled_categories
|
Set[str] | None
|
Subset of |
None
|
Initialise the subscriber with a notifier and transport.
Source code in src/terok_clearance/client/subscriber.py
start()
async
¶
Connect to the clearance hub and begin rendering its event stream.
stop()
async
¶
Drain pending tasks and close the transport.
Closes the client first so no new handler tasks are scheduled,
then awaits the currently-tracked tasks to settle (with their
own CancelledError suppressed). A bare sleep(0) would
yield only one loop turn — not enough for cancellation to
propagate through chained awaits — and tasks.clear() on its
own would drop references to tasks still writing to handles we
then close.
Source code in src/terok_clearance/client/subscriber.py
poke_reconnect()
¶
set_mute(container, muted)
async
¶
Mute or unmute container's prompts on this subscriber's hub.
container is the key the events carry (ClearanceEvent.container,
the 12-char short id under the terok supervisor). Returns the state
in force, or None when the call did not land and the state is
unknown. Muting drops the prompt only: the connection was already
refused. The reader writes it to the audit log only while the
task's shield audit is enabled. With audit off, a muted refusal
leaves no record at all.
Source code in src/terok_clearance/client/subscriber.py
mutes()
async
¶
Read back which containers this subscriber's hub is not prompting about.
None when the hub could not answer — unknown, not "nothing muted".
Source code in src/terok_clearance/client/subscriber.py
MultiSocketSubscriber(notifier, *, socket_glob=None, enabled_categories=None, rescan_interval_s=2.0)
¶
Subscribe to every per-container clearance hub socket under a glob.
The per-container-supervisor model gives every container its own
hub socket at
$XDG_RUNTIME_DIR/terok/clearance/<short_id>/hub.sock,
so an operator UI that wants the union of every supervisor's
event stream must multiplex across the set. This class watches
socket_glob (default
$XDG_RUNTIME_DIR/terok/clearance/*/hub.sock), opens an
EventSubscriber against each
matching path on start,
re-scans every rescan_interval_s seconds to pick up sockets that
appeared after start, and tears down child subscribers whose
sockets vanish. All events fan into the same notifier.
A simple poll loop drives the rescan — no inotify dependency. The
overhead is one glob.glob call per interval, which is cheap
compared to the cost of carrying a fanotify watch fd for what is
effectively a directory that mutates only at container start /
stop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
notifier
|
Notifier
|
Desktop notification backend (any |
required |
socket_glob
|
str | None
|
Filesystem glob of clearance hub sockets to track.
|
None
|
enabled_categories
|
Set[str] | None
|
Subset of
|
None
|
rescan_interval_s
|
float
|
Seconds between glob rescans. Must be strictly positive. The default (2.0) balances startup latency for a freshly-spawned supervisor against background polling cost when the host is idle. |
2.0
|
Capture notifier + scan parameters; sockets are discovered in start.
Raises:
| Type | Description |
|---|---|
ValueError
|
If rescan_interval_s is not strictly positive.
|
Source code in src/terok_clearance/client/subscriber.py
start()
async
¶
Connect to every currently-matching socket and start the rescan loop.
Sockets that fail to connect at start are logged and skipped — a flaky supervisor doesn't stop the rest from coming online. The rescan loop runs as a background task so newly-spawned supervisors join the merged stream without a manual restart.
Idempotent: a second start() while the rescan loop is still
live is a no-op (the alternative would orphan the existing task
and leak a loop that keeps reconciling).
Source code in src/terok_clearance/client/subscriber.py
stop()
async
¶
Cancel the rescan loop and stop every child subscriber.
Stops are awaited in parallel because each child holds its own transports — serialising would extend shutdown latency by the sum of every disconnect timeout instead of the worst-case one.
Source code in src/terok_clearance/client/subscriber.py
set_mute(container_id, muted)
async
¶
Mute or unmute one container's prompts.
container_id is the 12-char short id, and it does both jobs: the
supervisor names each hub's socket directory after it, and the hub's
events carry it in ClearanceEvent.container — so a UI already
holds it for every prompt it shows (Notification.container_id).
A display name, such as the dossier's task name, addresses nothing.
Returns the state in force, or None when it is unknown: no live
hub for this container (its supervisor may simply have exited), or a
call that did not land. The reason is logged at WARNING.
Source code in src/terok_clearance/client/subscriber.py
is_muted(container_id)
async
¶
Ask container_id's hub whether its prompts are muted.
Same addressing as set_mute.
None when the hub is gone or cannot answer (one that predates
Mutes() included): unknown, which a UI must not show as audible.
Source code in src/terok_clearance/client/subscriber.py
RawClearanceSection
¶
Bases: BaseModel
The clearance: section — what the clearance hub reads.
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
¶
verdict_ttl = Field(default=None, description='How long an unanswered Allow/Deny prompt can still be answered: seconds, or a count with a unit, such as ``30m``, ``24h`` or ``7d``. ``never`` keeps a prompt until its container ends. Unset means 24 hours')
class-attribute
instance-attribute
¶
ClearanceEvent(type, container, request_id='', dest='', port=0, proto=0, domain='', action='', ok=False, reason='', dossier=dict())
dataclass
¶
One event fanned out to every Subscribe() caller.
type + container are always populated; the remaining fields
are filled in per-kind and default to zero-values otherwise.
container is the hub's key for the container — what SetMute
and Verdict take and Mutes() returns: under the terok
supervisor, the 12-char short container id the shield reader stamps
on everything it emits. It is never the podman name and never a task
name — those live in dossier for display, and addressing a mute by
them silences nothing.
Known values of type (additional fields beyond container):
connection_blocked—request_id,dest,port,proto,domain,dossier. Requires an operator verdict.verdict_applied—request_id,action,ok; whenokis false,reasoncarries whatterok-shieldsaid (sanitised), such as the security tier's "break-glass only" line naming the override.container_started—dossier.container_exited—reason,dossier.shield_up/shield_down/shield_disengaged—dossier.
Unknown values are forwarded unchanged so the wire format can grow without breaking clients pinned to older schemas.
type
instance-attribute
¶
container
instance-attribute
¶
request_id = ''
class-attribute
instance-attribute
¶
dest = ''
class-attribute
instance-attribute
¶
port = 0
class-attribute
instance-attribute
¶
proto = 0
class-attribute
instance-attribute
¶
domain = ''
class-attribute
instance-attribute
¶
action = ''
class-attribute
instance-attribute
¶
ok = False
class-attribute
instance-attribute
¶
reason = ''
class-attribute
instance-attribute
¶
dossier = field(default_factory=dict)
class-attribute
instance-attribute
¶
ClearanceHub(*, clearance_socket=None, reader_socket=None, verdict_client=None, socket_context=None, verdict_ttl=_UNSET, container=None, aliases=(), muted=())
¶
Server for the org.terok.Clearance1 interface.
Owns four pieces of state:
_subscribers— a set of bounded per-connection queues; the hub puts aClearanceEventon each one every time the reader ingester delivers an event. Slow clients see their oldest events dropped; fast clients aren't affected._live_verdicts— therequest_id → (container, dest)map theVerdictmethod checks for the authz binding._muted— the containers whose prompts are dropped, seeded from the launch default and changed bySetMute.- An
EventIngesterbound to the canonical reader socket.
Wherever the hub keys a container — bindings, mutes, the events it fans out — it uses the key the events carry: the 12-char short id the shield reader stamps on what it emits. A hub built for one container makes that the only key it holds (see the container argument), so a name can never be mistaken for it.
Lifecycle: start brings everything up; stop tears
it down under individual timeouts so a flaky bus or a stuck
subscriber can't stall the per-container supervisor's teardown.
Configure the two sockets, the verdict-helper client and the mute state.
verdict_client is injected so tests can stub out shield exec
without spawning the helper process. Production callers leave
it defaulted — a fresh VerdictClient pointing at the
canonical helper socket.
socket_context — optional zero-arg callable returning a context
manager around the varlink bind() (forwarded to
bind_hardened).
terok-sandbox passes its SELinux setsockcreatecon helper here
so the hub socket is labelled terok_socket_t and confined
containers can connectto it.
verdict_ttl — seconds after which a pending connection_blocked
entry is expired from the authz-binding map. None means no
expiry (backward-compatible). When not passed explicitly, the
value is read from the clearance.verdict_ttl key in the
layered terok config (~/.config/terok/config.yml); absent
falls back to a 24-hour default so long-running containers
don't accumulate unbounded state. Pass verdict_ttl=None
explicitly to disable expiry regardless of the config file.
Config file example::
clearance:
verdict_ttl: 24h # or "never" to disable
container — the one container this hub serves, under the key the
shield reader stamps on its events: the 12-char short id. Pass it
only when reader_socket is per-container, as in the supervisor's
events/<short_id>/ingester.sock layout: every event arriving
there is about this container by construction, so the hub stamps
each one with this key. That matters because producers disagree —
the reader sends the short id while host-side shield_up /
shield_down events arrive under the podman name — and a split
identity lets a shield drop miss the very prompts it should retire.
It also confines every verdict this hub can issue to its own
container. None (the default) keeps a multi-container hub that
relays each event's key as sent. Anything but 12 hex characters
raises ValueError. A podman name or the full id would be
accepted and then become the key on every event, which no
short-id caller could address. The launcher would see nothing
wrong while every mute did nothing.
aliases — other spellings of container that a SetMute
caller or the launch default may use: the full id, the podman name.
They resolve to container; with container set, any other key is
refused with UnknownContainer.
Meaningless without container, so passing them alone raises
ValueError.
muted — containers whose prompts start muted: the launch default.
A launcher that passes it on every construction (the per-container
supervisor builds a fresh hub on each container start) gets a
default that holds across hub restarts, where a runtime SetMute
deliberately does not. It is applied here, before
start binds the
ingester, so no prompt can slip out ahead of it. A key this hub
does not serve is logged and ignored: the container stays audible,
the safe direction for a default that cannot be honoured.
aliases and muted take collections of keys. Passing a single
string raises TypeError: a string is itself iterable, so it
would be split into one key per character and the intended key
would never be used.
Source code in src/terok_clearance/hub/server.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
verdict_ttl
property
¶
Pending-verdict TTL in seconds, or None when expiry is disabled.
start()
async
¶
Bring the ingester + varlink server online and accept clients.
Transactional: if the varlink bind fails after the ingester is already listening, the ingester is stopped before the exception propagates so a half-started hub doesn't leak a live reader-side socket on systemd restart paths.
Source code in src/terok_clearance/hub/server.py
stop()
async
¶
Close the varlink server + ingester; drain subscriber queues.
Source code in src/terok_clearance/hub/server.py
CallbackNotifier(on_notify=None, *, on_container_started=None, on_container_exited=None, on_shield_up=None, on_shield_down=None, on_shield_disengaged=None)
¶
Notifier backend that delegates rendering to caller-supplied hooks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_notify
|
Callable[[Notification], None] | None
|
Called for every |
None
|
on_container_started
|
Callable[[str], None] | None
|
Called for every |
None
|
on_container_exited
|
Callable[[str, str], None] | None
|
Called for every |
None
|
on_shield_up
|
Callable[[str], None] | None
|
Called for every |
None
|
on_shield_down
|
Callable[[str], None] | None
|
Called for every |
None
|
on_shield_disengaged
|
Callable[[str], None] | None
|
Called for every |
None
|
Bind optional notify and lifecycle callbacks.
Source code in src/terok_clearance/notifications/callback.py
notify(summary, body='', *, actions=(), timeout_ms=-1, hints=None, replaces_id=0, app_icon='', container_id='', container_name='', project='', task_id='', task_name='')
async
¶
Record the notification and invoke the on_notify hook.
Returns a monotonically increasing ID, or replaces_id for updates.
Source code in src/terok_clearance/notifications/callback.py
on_action(notification_id, callback)
async
¶
Store the action callback for later invocation.
close(notification_id)
async
¶
disconnect()
async
¶
invoke_action(notification_id, action_key)
¶
Invoke the stored callback for a user verdict.
This is the entry point for consumers that handle user input
(Allow/Deny) and need to route the decision back through
EventSubscriber to the D-Bus Verdict/Resolve method.
Source code in src/terok_clearance/notifications/callback.py
on_container_started(container)
¶
Forward a ContainerStarted lifecycle event to the consumer hook.
on_container_exited(container, reason)
¶
Forward a ContainerExited lifecycle event to the consumer hook.
on_shield_up(container)
¶
on_shield_down(container)
¶
Forward a ShieldDown signal (partial bypass) to the consumer hook.
on_shield_disengaged(container)
¶
Forward a ShieldDisengaged signal (full bypass) to the consumer hook.
Notification(nid, summary, body, actions, replaces_id, timeout_ms, container_id='', container_name='', project='', task_id='', task_name='')
dataclass
¶
Snapshot of a single notification posted by the subscriber.
The identity fields (container_id, container_name,
project, task_id, task_name) are presentation-layer
context the subscriber's identity_resolver produced — empty
strings when unresolved. The desktop
DbusNotifier
discards all of them; the TUI uses the task triple to render a
Task column for terok-managed containers and falls back to the
container name for standalone ones.
Only container_id identifies the container to the hub — it is the
short id the events carry, so it is what a mute call takes. The
others are labels: container_name falls back to the dossier's
name, which under terok is the task name.
nid
instance-attribute
¶
summary
instance-attribute
¶
body
instance-attribute
¶
actions
instance-attribute
¶
replaces_id
instance-attribute
¶
timeout_ms
instance-attribute
¶
container_id = ''
class-attribute
instance-attribute
¶
container_name = ''
class-attribute
instance-attribute
¶
project = ''
class-attribute
instance-attribute
¶
task_id = ''
class-attribute
instance-attribute
¶
task_name = ''
class-attribute
instance-attribute
¶
VerdictClient(*, socket_path=None)
¶
Call Apply on the verdict helper over its unix varlink socket.
Lazy-connecting: the first apply opens the transport; a
dropped connection reconnects on the next call. Safe under
concurrent verdicts on one instance — asyncvarlink serialises
per-connection replies anyway, and the reconnect lock keeps two
callers from racing into the helper socket together.
Remember the socket; default to default_verdict_socket_path.
Source code in src/terok_clearance/verdict/client.py
apply(container, dest, action)
async
¶
Run one verdict via the helper; return (ok, stderr_snippet).
Returns (False, reason) if the helper is unreachable,
matching the shape callers used to get from the inline shield
exec. Upstream error translation (ShieldCliFailed) still
happens in the hub.
Source code in src/terok_clearance/verdict/client.py
VerdictServer(*, socket_path=None, shield_binary=None, socket_context=None)
¶
Per-process wrapper around the Apply varlink interface.
The hub is the only legitimate client; SO_PEERCRED on the unix
socket rejects peers with a different UID, and
bind_hardened leaves the
socket mode 0600 for the lifetime of the server.
Configure the socket + shield executable path.
socket_context — see
ClearanceHub;
forwarded to
bind_hardened so
the verdict socket can carry a custom SELinux type.
Source code in src/terok_clearance/verdict/server.py
start()
async
¶
Bind the varlink server and start accepting hub verdict calls.
Source code in src/terok_clearance/verdict/server.py
stop()
async
¶
Close the varlink server; existing in-flight Apply calls finish first.
Source code in src/terok_clearance/verdict/server.py
__getattr__(name)
¶
Import and cache a public symbol on first access (PEP 562).
Source code in src/terok_clearance/__init__.py
__dir__()
¶
container_mutes(socket_path)
async
¶
Read back which containers one hub is not prompting about.
The query half of set_container_mute,
over its own short-lived connection, in the keys events carry (the 12-char
short id under the terok supervisor). An empty set is the hub saying
nothing is muted.
Raises when the hub cannot be reached, and when it predates Mutes()
(a varlink org.varlink.service.MethodNotFound error). Either way the
state is unknown, which a caller must show as unknown — never as audible.
Source code in src/terok_clearance/client/client.py
set_container_mute(socket_path, container, muted)
async
¶
Mute or unmute one container's prompts over a single short-lived connection.
For callers with no live subscription — a CLI verb, a one-off action — that
want the RPC without the event stream ClearanceClient.start opens.
container is the key the hub's events carry in ClearanceEvent.container:
under the terok supervisor, the 12-char short container id — never the
podman name, and never a task name. The supervisor's per-container hub
sits at $XDG_RUNTIME_DIR/terok/clearance/<short id>/hub.sock, so the
same id addresses both the socket and the mute.
Returns the state the hub now holds. Raises when the hub cannot be
reached or refuses the call (UnknownContainer for a key it does not
serve): a one-shot caller has nothing else to tell the operator, and a
guess would put a mute on screen that the hub never applied.
Source code in src/terok_clearance/client/client.py
parse_verdict_ttl(value)
¶
Parse a TTL into seconds, or None for "no expiry".
Accepts plain seconds (3600, as text or as the number YAML makes
of it), unit-suffixed (24h, 30m, 7d), and the special
values never / none (both meaning "no expiry"). A zero
duration (0, 0.0, 0s) also means "no expiry": a pending
verdict that expires at once is never what an operator asks for.
None input returns the default (24h).
Raises ValueError on malformed input.
Source code in src/terok_clearance/domain/verdict_ttl.py
create_notifier(app_name='terok')
async
¶
Return a connected DbusNotifier, or a NullNotifier on failure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name
|
str
|
Application name sent with every notification. |
'terok'
|
Returns:
| Type | Description |
|---|---|
Notifier
|
A |
Source code in src/terok_clearance/notifications/factory.py
default_clearance_socket_path()
¶
Return the canonical clearance-socket path under $XDG_RUNTIME_DIR.