1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00

Added the list_topics and list_nodes role flags, Filtered the nodes listed by the roles

- `list_topics` / `list_nodes`: listing answers every topic, every node
  with messages, without reading any (`query` gives both).
- Without them, listing nodes only answers those with messages in the
  topics the roles may read (every node until now).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 01:40:01 +01:00
parent cf8264b21d
commit c86dc8798e
14 changed files with 122 additions and 31 deletions
+6
View File
@@ -37,11 +37,17 @@ What a role gives:
| `push_topics` | none | pushing to these topics, always as its own node |
| `read_topics` | none | reading these topics' messages |
| `query` | `false` | read-only SQL, which reads every topic |
| `list_topics` | `false` | listing topics answers every one with messages, not only those it may push to or read |
| `list_nodes` | `false` | listing nodes answers every one with messages, not only those of the topics it may read |
| `send_topics` | none | replication: these topics sent to it |
| `accept_topics` | none | replication: these topics taken from it |
| `send_nodes` | `["*"]` | replication: only these nodes' messages sent |
| `accept_nodes` | `["*"]` | replication: only these nodes' messages taken |
`list_topics` and `list_nodes` (2026-11-16) only give names, for a tool
that browses a server: reading a topic is still `read_topics`. `query`
gives both, it reads everything anyway.
No `AllowRead` / `AllowWrite`: a list that's empty allows nothing. No
default topic: a push always names its topic (protocol 7 has none).
+5 -5
View File
@@ -120,11 +120,11 @@ Reproduce one before fixing it, and move it up (or drop it) once known.
taken from anyone. Listing topics also only shows those with
messages: a client can't ask what it may push to. Fine for the
threat model; names in `push_topics` where the set is closed.
- **Every client sees every node's name.** `ListNames` for nodes
answers every node with messages (`list_names`, `reader.nodes()`),
whatever the client's roles read, to push-only clients too. Topics
are filtered by the roles. Fix: only the nodes of the topics it may read, or none
without `read_topics` or `query`.
- **Whether a node exists can still be probed.** Listing nodes is
filtered by the roles since 2026-11-16 (`list_nodes`), but
`GetMessages` answers `UnknownName` for a node without messages
anywhere and none for one with messages in another topic
(`reader.rs`, `messages`). Fix: none in both cases.
- **A CRL file that isn't there.** The server takes it as nothing
revoked (`load_revocations`, `bakashrot-server/src/lib.rs`), the
`bakashrot` tool refuses to start when `client.toml`'s `crl` names a
+2 -2
View File
@@ -201,8 +201,8 @@ the same ids with different messages, undetected.
(`MESSAGES_BYTES`, a bigger message alone), `more` if others follow.
- **`ListNames`:** topics are those with messages (pushed here or
replicated), those the roles may push to or read (every one with
`query`, which reads them all anyway); nodes are every one with
messages. `truncated` past 65,536.
`list_topics` or `query`); nodes are those with messages in the
topics the roles may read (every one with `list_nodes` or `query`). `truncated` past 65,536.
- **`Query`:** the roles must allow it (`NotAllowed`); read-only SQL,
refused with SQLite's message (`QueryFailed`, with a hint to add
`is_json = 1` on "malformed JSON"), over 10,000 rows or 16 MB