diff options
| author | tv <tv@krebsco.de> | 2026-10-25 11:30:15 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-25 11:30:15 +0100 |
| commit | 680097c9e82d9140ca7e2421113d23cc644b0cc2 (patch) | |
| tree | 3acfb80e80e19b53c76feb0b0df6eb570fb312cf /src/api/mod.rs | |
| parent | 65e0069baeb42deb69dd0616e97484bc5a568d7d (diff) | |
put swarm ID into the document
Diffstat (limited to 'src/api/mod.rs')
| -rw-r--r-- | src/api/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs index 1fba48b..affb9ef 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -120,8 +120,11 @@ fn parse_write_path( if path.first().map(String::as_str) != Some(crate::remake::snapshot::META_ROOT) { return Ok(path); } - let epochs = path.len() < 2 || path[1] == crate::remake::snapshot::EPOCHS; - if epochs || !state.protocol_writers.contains(&user.0) { + // `_continuum` itself, epoch metadata and the swarm ID: nobody. + let fixed = path.len() < 2 + || path[1] == crate::remake::snapshot::EPOCHS + || path[1] == crate::remake::snapshot::SWARM; + if fixed || !state.protocol_writers.contains(&user.0) { warn!(user = %user.0, method, path = %key, "Refused a write to protocol data"); return Err(StatusCode::FORBIDDEN); } |
