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
+4 -5
View File
@@ -50,7 +50,6 @@ certificate = "server-1.crt"
key = "server-1.key"
crl = "ca.crl" # optional; a missing file is fine, it's watched
database = "bakashrot.sqlite"
topics = ["lab.temps", "lab.events"]
[retention]
"*" = "7d"
@@ -71,8 +70,8 @@ send_topics = ["lab.*"]
accept_topics = ["lab.*"]
```
- `topics` are names, not patterns (`"lab.*"` there is refused, with its
line); the roles take patterns.
- The roles are the only lists of topics, names or patterns: a topic
exists from its first message.
- Every setting, with its default: `server.example.toml` (`config.md`).
- Open the port: `New-NetFirewallRule -DisplayName BakaShrot -Direction
Inbound -Protocol TCP -LocalPort 7000 -Action Allow` on Windows, the
@@ -139,11 +138,11 @@ Saved 6 bytes as got.txt
{"columns":["topic","node","message_id","c"],"rows":[["lab.events","kitchen","1",null],["lab.temps","kitchen","1","21.5"]]}
```
**Refusals.** A topic not in the config:
**Refusals.** A topic none of its roles names:
```
> bakashrot push other "{}"
Refused by the server (UnknownName): unknown topic 'other'
Refused by the server (NotAllowed): kitchen may not push to 'other'
```
A certificate whose roles aren't in the config