hyperhive/swarm-authelia-bridge-sock
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas d58be6834b fix(#3344): type the roster entry's name as Ident, per review
A bare String in a crate whose whole suite types validated names as
hive_types::Ident, so a consumer had to re-derive at the boundary what every
sibling field gets checked for free.

Ident is strictly narrower than the store's charset — [a-z0-9-] against the
[A-Za-z0-9._-] the users database allows, because that file holds humans too.
Every agent name is a legal Ident by construction (creation parses one before
the job is queued), so the narrowing costs real agents nothing. What it does
mean is that a human hand-added to the agent group cannot be described as an
agent: the reader omits that row and logs it, rather than failing the whole
roster or quietly shrinking the answer.

The REQUEST keeps its String. That side carries what a caller asked for, and
validating it server-side is what lets a bad name be refused with a message
instead of failing to deserialise.
2026-08-20 00:15:48 +02:00
..
src fix(#3344): type the roster entry's name as Ident, per review 2026-08-20 00:15:48 +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.