hyperhive/swarm-authelia-bridge-sock
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas a248db1fa2 feat(swarm-authelia-bridge): report a heal as its own outcome
`EnsureAgentIdentity` answered `AlreadyExists` whether it had added the
agent marker to an existing subject or done nothing at all, and the
controller discarded the answer outright. So the one case worth telling
a human about — a subject that was NOT an agent a moment ago — could not
survive the socket, let alone reach a log.

`Healed` is a variant rather than a field on `AlreadyExists` because a
field is ignorable: adding a variant makes every existing match fail to
compile until its author decides what a heal means. That is the property
the old shape lacked.

The store cannot tell a pre-marker agent identity from a human operator
account created without a group — both are `groups: []`. So this is
either the intended migration or an agent joining a person's live SSO
account, and only the caller has the context to tell them apart.

Gated by state/gate-3549-heal.sh (8 arms + mutation): the mutation
collapses Healed back and reddens the discriminating arm while leaving
the anti-noise arm green. The W' control asserts exactly one warn in the
whole run, so a build that warned on every routine ensure would fail.
2026-08-23 19:00:41 +02:00
..
src feat(swarm-authelia-bridge): report a heal as its own outcome 2026-08-23 19:00:41 +02:00
Cargo.toml fix(#3344): type the roster entry's name as Ident, per review 2026-08-20 00:15:48 +02:00
README.md feat(swarm-authelia-bridge): mark agent identities with a group, and answer for the set 2026-08-20 00:15:48 +02:00

swarm-authelia-bridge-sock

Wire types for the swarm-authelia-bridge socket — the contract between swarm-authelia-bridge (server, runs alongside swarm-authelia) and swarm-controller (client).

Why it's its own crate

Same rationale as hive-priv-sock (which this mirrors in spirit, though the transport differs — this bridge is network-facing HTTP, not a unix socket, since it has to reach a possibly-split-host swarm-controller): the bridge is a narrowly-scoped, unprivileged-but-file-owning helper, and splitting the wire contract out of any larger crate keeps both its own dependency footprint and its interface small enough to audit at a glance. No server or client logic here, only the request/response shapes both sides import.

Shape

Two operations: idempotently ensure an agent exists as an authelia subject, and list the ones that do. Deliberately not a wholesale-replace-the-file API — the bridge reads users.yml, changes what the request named, and writes it back; a caller only ever asks for one user to exist, never sends rendered YAML or a file blob. See swarm-authelia-bridge/README.md for the helper itself.