diff options
| author | tv <tv@krebsco.de> | 2026-11-19 20:06:05 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 21:26:49 +0100 |
| commit | fc6c7101cdb42666c1f79df4206029c7cf7e61c6 (patch) | |
| tree | b9a2f088aedcafa762d552cada23eba134f9e849 /src/config/mod.rs | |
| parent | d93f574d14a2e52a1d7dfd1e256f70c6eb9644ef (diff) | |
federated nodes: users who read the federation alone (--store-readers)
On a federated node, every user its htpasswd or proxy lets in may do
everything: put events, have it drop what it took, vote through it with
its party's key, make fork roots, read the document. An application or
someone watching needn't act for the node.
`--store-readers USER,...` names users who read the federation and do
nothing else (`api::access::federated`, before the registry's checks):
GET and HEAD of the events API (/events and below), checking a fork
(POST /events/fork), and keeping a session (whoami, refresh, logout);
anything else is 403, saying so. Its other users are its operators, as
all were: a node setting nothing changes nothing.
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index ea15e06..0b6a58a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -242,6 +242,14 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ ), #[cfg(feature = "federation")] option( + "store-readers", + Kind::List, + "USER,[USER...]", + None, + "With store-root or store-id: users of this node's HTTP API (htpasswd, user-header) who read the federation here and do nothing else: GET of the events API, and fork checks (docs/guides/federation/running-a-node.md, Its API). Its other users are its operators, who may do everything.", + ), + #[cfg(feature = "federation")] + option( "store-neighbour-parties", Kind::List, "NAME,[NAME...]", @@ -819,6 +827,9 @@ pub(crate) struct Settings { pub(crate) store_party: Option<String>, #[cfg(feature = "federation")] #[serde(default)] + pub(crate) store_readers: Vec<String>, + #[cfg(feature = "federation")] + #[serde(default)] pub(crate) store_neighbour_parties: Vec<String>, #[cfg(feature = "federation")] pub(crate) store_vote_key: Option<PathBuf>, @@ -1340,6 +1351,7 @@ impl Settings { ("store-file", self.store_file.is_some()), ("store-checkpoint", self.store_checkpoint.is_some()), ("store-party", self.store_party.is_some()), + ("store-readers", !self.store_readers.is_empty()), ( "store-neighbour-parties", !self.store_neighbour_parties.is_empty(), @@ -1491,6 +1503,8 @@ impl Settings { #[cfg(feature = "federation")] ("store-party", self.store_party.is_some()), #[cfg(feature = "federation")] + ("store-readers", !self.store_readers.is_empty()), + #[cfg(feature = "federation")] ( "store-neighbour-parties", !self.store_neighbour_parties.is_empty(), |
