cultmesh-rs: a sink's refusal of a put is a typed write_not_authorized #35
Loading…
Reference in a new issue
No description provided.
Delete branch "libby/cultmesh-rs-typed-refusal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A host sink refusal in
rudp_document_server.rsreached the peer as an untypedError(codeNone). It now sendswrite_not_authorizedwithdetails {field: recordKey, value: <key>}, as C#, TS and Python do. The text is still the fixed variant text (write_not_authorized: the catalog refused the document), never the sink's own.CultMeshRudpApplicationRejectiongainsrecord_key: Option<String>(set for put rejections). Other rejections stay untyped; the client-siderecognised_refusalstrips the new prefix so its quoting still works.Tests: unit test pins
write_refused_message("some:key", "not granted")to thewrite_not_authorizedbytes oferror-vectors.json; integration tests assert code, details and text on the wire and that a refused put reaches no sink (receipts == 0). With the typed branch disabled, two integration tests fail.cargo testfor the crate: 23 + 12 + 19 pass.Follow-ups (not in this PR): delete handling (this server has no delete path; ~40 lines + tests); a deny-by-default authority port so a sink refusal is the authority's decision, with a grant-all opt-in as in C#/Py (~120 lines + tests, breaking for embedders).
🤖 Generated with Claude Code