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

Made the roles the only lists of topics, Refused PRAGMAs in queries

- Removed `[server] topics` and `[replication] replicated_topics`: a push
  is taken by its roles' `push_topics`, a replicated message by the
  peer's `accept_topics`; a topic exists from its first message.
- Topics that only came from a peer are read and listed like any other;
  `ListNames` lists the topics with messages, filtered by the roles.
- A push to a topic no role names is `NotAllowed`; `UnknownName` is only
  for nodes.
- Clients' queries: every PRAGMA refused as it's prepared (SQLite's
  authorizer), `PRAGMA query_only = 0` used to take effect.
- Noted the leads found by reading the code in `docs/known-issues.md`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 01:28:24 +01:00
parent cef99102f9
commit cf8264b21d
34 changed files with 304 additions and 227 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ macro_rules! error_codes {
error_codes! {
// Refused by the server: the connection is still open.
NotAllowed = 1, "Not allowed to this client: its roles' permissions, or a request only peers may make.";
UnknownName = 2, "A topic or node this server doesn't know.";
UnknownName = 2, "A node this server has no message of.";
NotFound = 3, "No such message or attachment.";
NotReady = 4, "The attachment isn't on this server yet (still being replicated).";
TooBig = 5, "A message, attachment or query result over a limit, or an attachment bigger than this server keeps.";
+1 -1
View File
@@ -12,7 +12,7 @@
//! field names is taken too, `serde`'s derive: nothing writes that form, it
//! isn't part of the format, its values are checked all the same.) Whatever isn't right is a
//! [`DecodeError`]: the connection is aborted. What's well-formed but not
//! allowed or not found (a topic this server doesn't have) is the server's
//! allowed or not found (a node without messages) is the server's
//! to refuse, with a `RequestRefused`.
//!
//! Topics and nodes are names everywhere, never ids.