The store gets a listener for the pods that asks for no client certificate,
open on the pod network's interfaces only, and a jwt auth mount with one
role per in-cluster service. The rendered pods run under a ServiceAccount
with a projected token in place of their client certificate.
services.hyperhive.k8s.enable renders a Deployment (swarm-controller,
swarm-notify-router) or CronJob (swarm-ci-metrics) per service this host
deploys into system.build.k8sManifests. The renderer reads each evaluated
unit: its environment, LoadCredential ids, state and runtime directories,
ExecStart and timer. Files the unit names are mounted at the same paths, so
the environment carries over as it is. Secrets are referenced by name only.
No unit changes. checks: k8s-manifests-all-local (kubeconform -strict,
offline schemas) and module-eval-k8s; the allLocal fixture turns the
rendering on.
A retry or backoff policy written out by hand (a capped doubling wait, a
jitter from the clock, a try count with a sleep) goes against the workspace's
own dependency on backon. The rule flags a diff that adds one; the controller
test lists the rule name.
publish -> render_yaml -> validate re-checked validate_username on every user
in the file, humans included. authelia accepts names the charset refuses
(first.last@corp), so one hand-added user made every EnsureAgentIdentity fail
with a 500 until it was removed, while readiness (which only parsed the file)
stayed green. The reserved-name guard already avoids this hazard.
validate now checks only what a write would emit wrong (control characters),
for every user. The charset check stays on the name a request writes, in
handle. A user outside the charset is passed through unchanged and named in a
warn line on each write. Readiness now also runs that check, so a file the
bridge cannot render is not ready.
The handler took `Json<BridgeRequest>`, which axum runs before the handler
body. A caller with no token and a malformed body got axum's rejection
(415/400/422), whose text is serde's ("unknown variant ..., expected one of
..."), and not the one generic 401 an unauthenticated caller is meant to see.
Take the body as bytes, authorize, then parse. A caller that is let in and
sends a body that doesn't parse gets a 400 with the parse error, as before in
substance. The request's content type is no longer checked.
- request.rs pointed at module docs on main.rs for why the request signature
is not verified; they said nothing. It now says why, here and in
docs/4-implementation/swarm/credentials.md ("What authenticates a callout
request"), and so do xkey::open and main.rs's module docs: only the
responder's own key can publish to the request subject, a forger with a
valid bearer gets what a normal connect gets, and nats-server makes a new
xkey at each start and has no option to set it, so there is no key to pin.
The guard is the module-eval case "the callout account has exactly one member
and no system account is configured"; the docs say to revisit this if that
changes.
- request.rs said base64url is written out rather than pulled in; it calls
data_encoding, a direct dependency.
- respond.rs said `now` is injected into sign(); sign() takes no clock.
- oidc_secret.rs named swarm-bao.nix for natsAuthReaders; it is in
swarm-bao-readers.nix.