aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/store.rs
Commit message (Collapse)AuthorAgeFilesLines
* signed values: one reading of an envelope, everywheretv4 days1-25/+17
| | | | | | | | | | | | | | | | Three parts read an envelope three ways: the store's order took any string with the prefix whose meta held a `seq`, its reads any whose value decoded, the checks only one with four parts and a meta of exactly its fields. A string that the first two took and the checks refused was read first, read as the registry's or the policy's value, and treated as nothing by the check of the next write there. `document::signed` reads an envelope the one way: four parts, the value JSON, the meta exactly its six fields (one more, or one twice, and it isn't one), no newline in either, the signature decoding. The store's order, its plain reads, the checks, the API and the users API all go by it. What isn't one in every respect is a plain string, wherever it is read.
* signed values: value and meta apart, numbered; the highest seq is readtv4 days1-15/+94
| | | | | | | | | | | | | | | | | | | | | | | | | A member could put a user's older signed value back beside a newer one: a change made with dependencies from before both is judged where the place was empty, so the older envelope (`prev` empty) is taken; and of values written at once, the one read was the one with the highest operation, which whoever writes the change steers. A revoked capability, a lifted ban or an earlier policy came back that way, signed by whoever signed it then. An envelope is now `cv2.<value>.<meta>.<signature>`: the value as its user wrote it, and apart from it what continuum adds (swarm, path, user, at, seq, prev), the signature over the value's line and the meta's. `seq` is one more than that of the envelope it replaces, 0 where it replaces none; every node checks it with `prev`. Of the values a place holds, written at once, signed ones are read before any other, the highest `seq` first, of equal ones the lower digest (`store::candidates`): reads, snapshots and writes all go by it. An older envelope beside a newer one changes nothing. `application/continuum-signed` is the value's line, the meta's, then the signature; `scripts/continuum-signed` writes and checks it so. The wire version goes up: nodes must agree on what a place's value is.
* state: limit refused writes per usertv11 days1-0/+3
| | | | | | | | | | A write every node would refuse is rolled back by forking the document at the heads before it, under the write lock, at a cost that grows with the document's history. A user could ask for such writes in a loop. Count each user's refused writes over the last minute. Past --refused-writes-per-minute (default 10), its writes are answered 429 without being tried, until the oldest refusal leaves the minute.
* envelope: a signed value names its swarmtv11 days1-2/+1
| | | | | | | | | | | | Review 3.1, part of finding 12: a signed value's payload bound path, user, time and prev, but not the swarm. A user with the same name and key in two swarms could have an envelope replayed from one into the other, wherever the path holds no envelope yet (prev ""). The payload now names the swarm (`swarm`), and a node takes an envelope only for its own. /auth/whoami says the swarm, and continuum-signed and the example in api.md sign it. Wire version 44: nodes before this refuse such envelopes, and those after refuse the old ones.
* access: a node judges its own changes before they leavetv11 days1-0/+4
| | | | | | | | | | | | | | | | | | | | The API checks the path a request asks for; the rules judge everything the change does. Where they disagreed, the honest node's change was refused by every other node, and with signatures required the node was refused as a whole. The plan had both gates run the same judgement. Under a policy, each change a node makes (its own writes and those through the API) is now judged by rules::judge as receivers will judge it, before it is signed or sent; one every node would refuse is rolled back (the document forked at the heads before it, same actor: the change never left) and the request refused with 403 (StoreError:: Refused). rules::judge_held, judging a change the document holds, moves from swarm::refusals to access::rules for both. The simulations that play a member past its own checks write with a helper that bypasses them (forge). Review finding 3 (the same judgement at both gates).
* access: strict policy, signed pathstv12 days1-0/+53
| | | | | | | | | "values": "signed" (strict, requiring signatures too): the registry, _continuum/access, bans and the paths in _continuum/access/userSigned (* for any key) hold values their users signed. Envelopes read as the values they hold where the node reads protocol data. Auth plan M7.
* access: the policy enforcedtv12 days1-0/+6
| | | | | | | | _continuum/access/policy ({"version": 1}) has every node screen every change it receives, on every path changes come in. A policy a node doesn't know stops its writes through the API. GET /admin/refused. Auth plan M6.
* bench: change pathstv12 days1-2/+13
| | | | | | | Finding the paths changes touch, from documents and from raw change bytes, measured before M6 is built. Auth plan M6 (measure first).
* store: keys_at tells no map from an empty onetv12 days1-9/+8
| | | | | | | | registry::exists counted any value at _continuum/users as a registry; keys_at answers None where there is no map, and its users (records, members, forget records, remakes) say what they make of it. Auth plan M1 (fix).
* access: authorization at the APItv12 days1-2/+12
| | | | | | | | | Every request is judged by the registry the node holds: store reads pruned to what the user may read, writes refused where it may not, admin endpoints by protocol capabilities. Without a registry, as before (--protocol-writers for protocol data). Auth plan M1.
* access: the user registrytv12 days1-0/+5
| | | | | | | | | _continuum/users/<name>: one entry per user, with capabilities by path (read, write) granted by whom and when, and a disabled flag. Read leniently: a damaged entry gives less, never more. Protocol data stays apart: a capability outside _continuum never covers it. Auth plan M1.
* api: /admin/changes read ops, not diffstv2026-11-021-0/+86
| | | | | | | | | | | | The new store::changed_by reads each change's own operations instead of diffing the document before and after it. Each object's path is found once per change, as it was right after that change. So the cost now grows with the size of the change, not the size of the map it touched. - It names paths the same way the diff did: a map entry by its key, and list and text edits by the list or text. - It relies on import_obj, which Automerge marks as hidden from its docs, to turn an operation's object ID back into an object.
* api: drop $float as JSON number is OKtv2026-11-021-16/+37
|
* api: add type caststv2026-11-021-0/+31
|
* api: types are stickytv2026-11-021-33/+216
|
* api: add application/vnd.continuum.typed+jsontv2026-11-021-130/+82
|
* api: add application/vnd.continuum.* scalar typestv2026-11-021-45/+155
|
* document: create new compound values at oncetv2026-11-011-11/+29
| | | | | This speeds up large writes as new maps and lists are created in one batch operation instead of one operation per value.
* document: introduce patch logtv2026-11-011-1/+6
|
* api: add support for counterstv2026-11-011-0/+57
|
* api: allow reading past versionstv2026-11-011-0/+3
|
* api: PUT changes only what differstv2026-11-011-23/+148
|
* document: reject writes during rejointv2026-11-011-0/+4
|
* use Automerge as Document instead of AutoCommittv2026-10-311-5/+5
| | | | This allows a lot of operations to drop mut.
* store function accept any documenttv2026-10-311-42/+50
|
* tests write through document::testing helperstv2026-10-311-16/+54
|
* one function for changed pathstv2026-10-311-0/+61
|
* move ChangeSet from swarm to documenttv2026-10-311-0/+11
|
* store reads go through resolve_loggedtv2026-10-311-21/+25
|
* consistently use resolve_throughtv2026-10-311-15/+7
|
* unify path deleterstv2026-10-311-50/+30
|
* unify path walkerstv2026-10-311-32/+7
|
* api: support list indexes in pathtv2026-10-301-39/+294
|
* add support to insert values at list indextv2026-10-301-0/+77
|
* api: add support for shallow store readstv2026-10-301-0/+72
|
* make clippy happy againtv2026-10-261-8/+8
|
* turn all pub into pub(crate)tv2026-10-261-17/+24
|
* add votes registertv2026-10-241-0/+23
|
* add store::copy_path_to(src, from, dst, to)tv2026-10-211-4/+14
|
* reorganize all the modulestv2026-10-211-0/+696