diff --git a/swarm-logs-auth/src/main.rs b/swarm-logs-auth/src/main.rs index 50ab16895..14027fc5f 100644 --- a/swarm-logs-auth/src/main.rs +++ b/swarm-logs-auth/src/main.rs @@ -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..`. `--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..`, 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//queue` and the agent holds the permission for that //! surface (`logs` or `metrics`), 401 when the secret does not verify, and 403 diff --git a/swarm-metrics-auth/src/main.rs b/swarm-metrics-auth/src/main.rs index daecb77a3..b63533219 100644 --- a/swarm-metrics-auth/src/main.rs +++ b/swarm-metrics-auth/src/main.rs @@ -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