Watch
0
0
Fork
You've already forked hyperhive
0

swarm-authelia-bridge: bound the identity path and answer errors the controller can act on

This commit is contained in:
atlas 2026-11-30 18:32:13 +01:00 • committed by mara
commit 57b071cc34

View file

@ -25,10 +25,9 @@ use swarm_authelia_bridge_sock::{BridgeRequest, BridgeResponse};
/// Bound on reaching the bridge.
const HTTP_CONNECT_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(5);
/// Bound on one whole bridge call, body included. Ensuring an identity has
/// the bridge shell out to `authelia` for an argon2 hash before it answers,
/// so this is looser than a plain API call needs.
const HTTP_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(30);
/// Bound on one whole bridge call, body included. Shared with the bridge,
/// whose worst case is held below it.
const HTTP_TIMEOUT: std::time::Duration = swarm_authelia_bridge_sock::BRIDGE_CALL_TIMEOUT;
/// A configured connection to `swarm-authelia-bridge`.
#[derive(Clone)]
@ -140,9 +139,13 @@ const RETRY_BACKOFF: &[std::time::Duration] = &[
/// POST `req` to the bridge, retrying a `503` or a failure to connect after
/// each wait in `backoff`.
///
/// `503` is the bridge saying it could not get an answer out of authelia, so
/// the token was never evaluated; the same call usually succeeds once
/// authelia recovers. `401` and `403` are verdicts on the token and are
/// `503` is the bridge saying the call is worth repeating, for one of three
/// reasons: it could not get an answer out of authelia, so the token was never
/// evaluated; or, after the token was admitted, a lock stayed held past the
/// bridge's wait, or the password hash outlived its bound. The first usually
/// clears once authelia recovers. The other two act on an admitted request, so
/// the retry may find the identity already created, which the idempotent
/// ensure answers. `401` and `403` are verdicts on the token and are
/// final, as is any other status. A timeout after the connection was made
/// is not retried: the request may have been acted on, and a whole attempt
/// already took [`HTTP_TIMEOUT`]. Every bridge request is safe to repeat