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:
@@ -131,8 +131,8 @@ with kitchen:
|
||||
check("limit 0: ValueError, before asking", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.get_messages("logs", "kitchen", after=-1), ValueError)
|
||||
check("after -1: ValueError", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.push("x", "nothing"), RefusedError, "unknown topic", ErrorCode.UNKNOWN_NAME)
|
||||
check("Push to an unknown topic: RefusedError, UNKNOWN_NAME", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.push("x", "nothing"), RefusedError, "may not push to 'nothing'", ErrorCode.NOT_ALLOWED)
|
||||
check("Push to a topic not in its push_topics: RefusedError, NOT_ALLOWED", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.push("x", "a b"), BakaShrotError, "isn't a topic name", ErrorCode.INVALID_ARGUMENT)
|
||||
check("A topic that isn't a name: refused before sending", ok, detail)
|
||||
ok, detail = raises(lambda: kitchen.push("x" * (bakashrot.MAX_MESSAGE_SIZE + 1), "logs"), BakaShrotError, "too big",
|
||||
|
||||
Reference in New Issue
Block a user