refactor(#3255): a constant, not a module with an essay
Review call: 46 lines of documentation around a single constant, part of it already stale. The worst paragraph explained why the earlier per-hive shape had been justified wrongly — history of a design that never shipped, written into the file within an hour of that design being dropped. A file is not a changelog; why it was wrong belongs in the PR. The constant moves to lib.rs beside the status bucket name, keeping only the rationale that stays true: three crates must agree on the string, and the one that agrees hardest speaks neither jetstream nor kv, which is why it cannot sit behind a feature gate. status earns a module of its own because it holds a bucket name AND the functions that open it. This held a constant.
This commit is contained in:
parent
9b939f4626
commit
33958d78ae
5 changed files with 12 additions and 62 deletions
|
|
@ -156,18 +156,14 @@ pub fn chain(error: &dyn std::error::Error) -> String {
|
|||
/// which is the disagreement this module exists to prevent.
|
||||
pub mod status;
|
||||
|
||||
/// The *knowledge repository changed* subject — one writer (the controller),
|
||||
/// many readers (the hives).
|
||||
/// The subject the swarm controller publishes on when the hive-wide knowledge
|
||||
/// repository has changed. One writer, many readers — every hive subscribes.
|
||||
///
|
||||
/// Its own category rather than a leaf under a general event namespace: a
|
||||
/// namespace built for events that do not exist yet is a shape decided before
|
||||
/// there is anything to decide it from.
|
||||
///
|
||||
/// Unconditional and NATS-type-free for the same reason the bucket name above
|
||||
/// is: three crates must agree on this string, and the one that agrees hardest
|
||||
/// — the auth-callout responder, which decides whether a publish is even
|
||||
/// permitted — speaks neither `jetstream` nor `kv`.
|
||||
pub mod knowledge;
|
||||
/// Here rather than in a module of its own for the same reason as the bucket
|
||||
/// name above: three crates must agree on the string, and the one that agrees
|
||||
/// hardest — the auth-callout responder, which decides whether a publish is
|
||||
/// permitted at all — speaks neither `jetstream` nor `kv`.
|
||||
pub const KNOWLEDGE_SUBJECT: &str = "$SWARM.knowledge";
|
||||
|
||||
/// Only the fields this needs; authelia returns several.
|
||||
#[derive(serde::Deserialize)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue