Watch
0
0
Fork
You've already forked hyperhive
0

swarm-logs-auth, swarm-metrics-auth: say which requests each one is sent

swarm-logs-auth's module doc said nginx sends it every /select/logsql/
request. The log store's nginx map sends it only `Bearer swarm-agent.`
requests; Grafana's 64-hex bearer goes to swarm-metrics-auth and everything
else to authelia. swarm-metrics-auth's said it was the metrics store's
responder for Grafana, but the same binary also guards the log store. Both
docs now describe the routing the nginx maps in swarm-victorialogs.nix and
swarm-victoriametrics.nix do.
This commit is contained in:
maia 2026-11-30 14:48:28 +01:00 • committed by mara
commit 071e4b1717
2 changed files with 15 additions and 11 deletions

View file

@ -1,9 +1,11 @@
//! The log and metrics stores' gateway `auth_request` responder for agents.
//!
//! nginx sends it every `/select/logsql/` request (`swarm-victorialogs.nix`),
//! and every metrics read API request (`swarm-victoriametrics.nix`, as
//! `swarm-metrics-agent-auth`), whose `Authorization` is
//! `Bearer swarm-agent.<agent>.<secret>`. `--surface` says which store this
//! nginx sends it the `/select/logsql/` requests (`swarm-victorialogs.nix`)
//! and the metrics read API requests (`swarm-victoriametrics.nix`, as
//! `swarm-metrics-agent-auth`) whose `Authorization` is
//! `Bearer swarm-agent.<agent>.<secret>`, and only those: Grafana's bearer
//! goes to `swarm-metrics-auth`, and every other request to authelia.
//! `--surface` says which store this
//! instance guards. It answers 200 when the secret is the one stored at
//! `swarm/agents/<agent>/queue` and the agent holds the permission for that
//! surface (`logs` or `metrics`), 401 when the secret does not verify, and 403

View file

@ -1,11 +1,13 @@
//! The metrics store gateway's `auth_request` responder for Grafana.
//! The `auth_request` responder for Grafana's bearer, on both stores' gateways.
//!
//! nginx sends it every request to the store's query API that carries a
//! `Bearer` (`swarm-victoriametrics.nix`). It answers 200 when the bearer is
//! the value stored at `--store-path`, which Grafana's host creates and its
//! datasource presents, and 401 otherwise: `auth_request` turns any other
//! status into a 500 for the caller. A store that does not answer is a 401
//! only until a value has been read; see below.
//! nginx sends it the query API requests whose `Bearer` is not an agent's
//! `swarm-agent.` one (`swarm-logs-auth` takes those): on the metrics store
//! (`swarm-victoriametrics.nix`) any other bearer, on the log store
//! (`swarm-victorialogs.nix`, which runs this binary too) a 64-hex one. It
//! answers 200 when the bearer is the value stored at `--store-path`, which
//! Grafana's host creates and its datasource presents, and 401 otherwise:
//! `auth_request` turns any other status into a 500 for the caller. A store
//! that does not answer is a 401 only until a value has been read; see below.
//!
//! It reads the store under its own certificate, whose policy reaches that one
//! path. It serves a unix socket whose directory only the gateway's nginx may