aboutsummaryrefslogtreecommitdiffstats
path: root/docs/access.md
Commit message (Collapse)AuthorAgeFilesLines
* api: in a swarm holding a store, a node takes no token another issuedtv21 hours1-1/+2
| | | | | | | | At its API, a node of a swarm holding a store takes no token another node issued (`docs/store.md`, Members): whoever its operator lets in may use it, and its operator lets in nobody through another node. A token every node of a swarm takes would let whoever another operator let in in here too. `token::issued_here` refuses such a token (`ElsewhereIssued`), behind the `federation` feature.
* docs/access: a strict policy given at genesis in the exampletv39 hours1-3/+5
| | | | | | | The example of a strict policy wrote it through the API, which every node refuses where the policy isn't strict: a swarm turns strict only at its start or through a strict remake. It shows the genesis node given the policy, with its first user and their key.
* policy: strict only where its values is a stringtv40 hours1-3/+3
| | | | | | | | | | | | | | | The policy was read in typed JSON, so that an Automerge text spelling "signed" at its `values`, which no operation `rules::turns_strict` asks of writes, turns no swarm strict. But that read every policy anew: a setting that wasn't a string, or a text at `signatures`, made a policy no node knows in swarms that aren't strict, which read it as before. The policy is read in plain JSON again, as it was, and only its strictness asks more (`policy::of`): it reads strict only where its `values` is a string in typed JSON, an envelope read as its payload. A policy that would read strict only through a text, at `values` or holding the policy, is one no node knows. Every policy that doesn't read strict reads as it did.
* policy: read only as continuum writes ittv42 hours1-5/+8
| | | | | | | | | | | | | | | | | | | A swarm turns strict only at its start or through a strict remake, and a change writing a strict policy where the policy isn't strict is refused, found by its operations: `"signed"` put at the policy's `values`, or an envelope asking for it put at its place. But the policy was read in plain JSON, where an Automerge text reads as a string, and writing a text is no such operation: `{"$text": "signed"}` at `values`, through the typed API, turned a swarm strict that nothing refused, with a time before it nothing closes. The policy is read in typed JSON now (`store::read_plain_as`): what continuum writes there reads as it is, plain JSON or an envelope, and a text, a counter or bytes as itself, tagged; a setting that isn't a string makes a policy no node knows (`policy::read`), as a version it doesn't know does. So no text turns a swarm strict, and the operations `rules::turns_strict` asks of are the only ways to. A policy holding none of these reads as before.
* rules: a swarm turns strict only at its start or through a strict remaketv44 hours1-23/+10
| | | | | | | | | | | | | | | | | | | | | | A strict policy written into a running swarm left a time before it: changes written there, beside the turn, were refused by the nodes that took the turn first and taken by the others where they came first (a signed policy that isn't strict, among them, unseated the turn there); and a remake whose base preceded the turn had every switching node replay the turn as one of its own, each refusing the others'. A change writing a strict policy where the policy at its history isn't strict (`"signed"` at its `values`, or an envelope there asking for signed values) is now refused, in every swarm. A swarm turns strict at its start (`--bootstrap-policy`) or through a strict remake, each its epoch's first change: no change of a strict epoch is from before its policy, and the rule for the time before goes, with the walk that found the changes that turned a swarm strict and what kept them (`before_strict`, `turned_strict`, `Reads::strict_now`, `Reads::turned_now`, `store::writers`, `store::made`, `changes::in_history`). The strict swarm's simulation starts strict. access.md says so, and that a strict swarm can't move to a policy its nodes don't know by writing it.
* config: a strict swarm starts emptytv44 hours1-3/+4
| | | | | | | | | | | | `--genesis --remake` writes the content as a change of its own before the one recording the first users and `--bootstrap-policy`. With a strict policy, that content change was a time before the policy, on which any member could build a change judged by none. A strict `--bootstrap-policy` with `--remake` is now refused: a swarm strict from its start starts empty, and one started from content turns strict through a strict remake, which keeps only what an operator looked over. A policy that isn't strict starts from content as before.
* rules: a strict swarm stays stricttv45 hours1-24/+26
| | | | | | | | | | | | | | | | | A strict policy could be written over with one that isn't, or deleted, by a user who may manage the policy. While the swarm was relaxed so, nothing was asked of the time before it turned strict: a change written beside that turn was taken, and once the swarm turned strict again, built on, a node judging that change while strict from the first turn (one back from away, a joiner) refused it, and every node it told dropped it with the second turn and everything after. Under a strict policy, the policy is now written again only as strict: an envelope there whose value isn't a strict policy, a signed `null` among them, is refused. So a strict swarm has one change that turned it, and the time before it stays closed; to leave it, start a new swarm from its content. A swarm that isn't strict writes its policy as it did.
* access: a new swarm's policy where it starts from contenttv47 hours1-1/+3
| | | | | | | | `--bootstrap-policy` records the policy in the genesis change, "no change of it from before the policy". With `--genesis --remake`, the content is a change of its own before the one recording the users and the policy. access.md says so, and that a change built on the content beside that one is refused as from the time before a strict policy.
* rules: the time before strict is the change that turned it, written again or nottv47 hours1-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | A change written under a policy that isn't strict was refused, in a strict document, unless it was in the history of the change that wrote the policy value the document read now. So the policy written again by a node that held a change from before, taken beside the strict policy, put that change in the new writer's history: that node kept it, every other node refused it, and the new policy with it, and the node was cut off. Now the reference is the change that turned the swarm strict: one that wrote a strict policy where the policy at its history wasn't, found by following back the writes of what the policy holds (`store::writers`). A change written under a policy that isn't strict is refused where such a change is beside it, neither in its history nor built on it. A policy written again, strict over strict, names the same change. One turning the swarm strict beside it is refused like any other. Of two at once neither is preferred: any rule choosing one, the lower hash say, would let a change made later to look as old take the place of the one every node took, and every node would drop it with all that was built on it. So two members turning a swarm strict at once split the nodes that took one from those that took the other; access.md says to turn it from one.
* access: what revoking doesn't stop under a strict policytv2 days1-3/+10
| | | | | | | | | | A change is judged as its writer saw the document, and its writer chooses what it saw. So a capability revoked, a user disabled or a key removed holds against members that weren't members before it, but a member that was can still commit, at a history from before, an envelope the user signed then, and the next, as far as it likes; the highest `seq` is the place's value. A remake ends it. access.md says so where it says what signed values keep out.
* rules: nothing added to the time before a swarm turned stricttv2 days1-1/+5
| | | | | | | | | | | | | | | | | | | A swarm turned strict by writing the policy into it kept the time before open: a change whose history lacks the policy's change is judged by the policy then, none or one that isn't strict, needs no signature there, and is taken whenever it comes, from any member. With values read by `seq`, an envelope planted at that time with the highest `seq` there is can never be followed: a ban, a user, a declaration, for good. Once a document's policy is strict, a change written under one that isn't is refused, received or held, unless it is in the history of the change that wrote the policy the document reads (`store::written_by`). A node that holds one beside that change, taken before it came, is told so by any peer that refused it (REFUSALS), judges it again, now refuses it too, and drops it with what builds on it, as for any change it took unjudged. A swarm strict from its genesis change has no such time; one whose policy isn't strict judges as before.
* swarm: a new swarm's policy recorded in its genesis changetv2 days1-3/+5
| | | | | | | | | | | | | | | | A swarm strict from its start had its policy written by its first user in a later change. A change is judged by the policy at its history, so any member could always add a change whose history is from before the policy: judged by none, needing no signature, taken whenever it comes. Since signed values are read by `seq`, an envelope planted there with the highest `seq` there is can never be followed: a ban, a user, a declaration, for good. `--bootstrap-policy JSON`, with `--genesis`, records the policy in the genesis change, with the first users: then no change of the swarm is from before it. It must be a policy this node knows, and a strict one needs `--bootstrap-keys`, or nobody could sign what decides who may do what.
* signed values: value and meta apart, numbered; the highest seq is readtv2 days1-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* changes: no marktv4 days1-13/+13
| | | | | | | | | | | | | Screening took marks in a text, checking that a mark's end comes at its begin or after it, by walking the elements each is inserted after back to the text's head: up to 22 s for one change of 9 KB. And it took a value put at a mark's begin or end, replacing it: sound until an honest node edits that text, then the node panics at its next sync or append, and its save doesn't load. Continuum's store writes no marks. A change with a mark's begin or end is now refused, and the walk is gone. An element written at is one a value or an object was inserted as.
* changes: no tabletv4 days1-2/+3
| | | | | | | | | | Screening took a table for a map. A table made is sound, but Automerge panics applying a change that puts a value into one, made by that change or a later one, and applying isn't caught where it panics. Transactions make a table and can't write into it; continuum's store makes none. A change making a table is refused, and so is one writing into a table the document holds.
* screen: take only the operations transactions writetv5 days1-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Screening asked what an operation isn't: a deletion replacing nothing, a value put at a list's head without inserting, a mark ended but right after its begin. Others pass that Automerge's transactions never write, and Automerge takes them and breaks: an element written over naming as replaced the element inserted after it (an inserted element's key is the element it follows, its place is itself), an insert replacing something, a deletion or an increment inserted, an increment at a list's head, a mark ended ahead of its begin or at the head, a mark in a list. Giving such a change back panics or gives another change under its hash, and the save doesn't load. Each operation is now asked to be one transactions write (`document::changes::unwritten`): inserted, a value, an object or a mark's begin or end into a list or a text, replacing nothing; at a list's element, never its head, without inserting, replacing what is at that element; at a map's key, never inserted, a deletion or an increment replacing something; a mark's begin with its end as the next operation, both inserted. A value replaced at a list's element is the element itself or written at it, not an element inserted after it. Marks are only in a text, and a mark's end is at its begin or at an element after the begin's: their places follow from the elements each is inserted after, back to the text's head, as the change's history holds them. The document the tests write now has counters in a list and a map, an element written over, and marks over a span, the whole text, none of it, and across what was deleted and inserted since; and each case above is a test.
* screen: refuse what Automerge's transactions never writetv5 days1-2/+4
| | | | | | | | | | | Automerge 0.12.0 takes some changes that name nothing wrong, and then can't give them back: a deletion that replaces nothing, a value put at a list's head without being inserted, a mark ended where no mark began right before it. Giving the change back panics, the save doesn't load, and a sync to a peer that lacks it panics: one member stops every node it reaches. Those are refused with the other checks (`changes::Written`).
* screen: a change refused after its checks stands in for nothingtv5 days1-1/+2
| | | | | | | | | | | | | | | | Screening checks that a change is one Automerge writes (`changes::Written`) before it looks for forks and judges the rules, and the checks recorded what a change made as soon as it passed them. A fork of a change the document holds has its actor and counters: if it was checked first in a batch, and refused as forged after, its record stood in for that change's operations, outside the history of the next. An honest change writing into what the real one made was then refused, for good. Anyone could make such a fork, its hash ground to sort first. What a change made is recorded once screening takes it (`Written::taken`), and an operation named is looked for in the batch and in the document, whichever the change's history holds.
* screen: what is asked of a change, asked of its own historytv5 days1-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A change is refused before Automerge sees it unless it is one Automerge writes (`document::changes::Written`). Three things about that, each of which let a crafted change through or parted nodes: * An operation a change names (the object written into, a list's element, an operation replaced) must be made in the change's own history, or before in the change itself, not anywhere in the document. Else a node that holds the operation takes the change and one that doesn't yet refuses it for good: nodes part by the order changes reach them. * And it must be what it is named as: an object of the kind written into, an element of that list, an operation at the place written. A change that replaces an operation elsewhere marks an unrelated value gone, and Automerge then gives back another change under its hash and saves a document that doesn't load; one that writes into an operation that made no object makes it panic. * A change that isn't its actor's first must have the one before it among its dependencies, as a transaction puts it there. A gap in an actor's numbers makes Automerge panic. What the document holds at the changes this one builds on is read there where it can be (a map's key, an object held by a map's key); else the operation's own change is decoded and the history walked back to it, no further than the operation's counter. So operations on a list's elements cost a walk each. Decoding a change can panic too (an operation naming an actor its change doesn't list): caught, and the change refused as one whose bytes aren't Automerge's.
* screen: refuse changes Automerge wouldn't have writtentv5 days1-0/+6
| | | | | | | | | | | | | | | | | | | | | Automerge 0.12.0 applies a change that lists an actor none of its operations names, or whose first operation is numbered below its dependencies' or near 2^32. It then gives back another change than the one it was given and saves a document that doesn't load, or panics at the next write. A member sending one stops the nodes that take it. Every change from elsewhere is looked at before Automerge sees it (`document::changes::Written`, from `access::screen::apply`, with or without a policy), and refused like one breaking a rule unless: * encoded again, it has the hash it came with; * its first operation is numbered one after the highest of its dependencies, 1 without any, as a transaction at the document's heads numbers it; * every operation it names (an object, a list's element, an operation replaced) is its own, or was made before it, in the document or by a change of the batch looked at before.
* access: a token with a limit changes no credentialstv6 days1-3/+5
| | | | | | | | | | | | | | | A token's limit narrows every endpoint but those under /auth, which any registered user may call. Among them, PUT and DELETE /auth/keys/{id} change the keys the user logs in with, and POST /auth/logout ends every token of the user. With the token a dashboard hands to another member's (the member list, read, five minutes), its holder could add a key of its own and log in by it as the user, with everything the user may do. These now take a password or a token without a limit (Need::Credentials, refused where Caps::limited). A narrowed token still refreshes within its limit, says who it is, lists the user's keys and ends its own session (DELETE /auth/session): a dashboard opened from another member's logs out with it.
* auth: whoami says what the request may dotv8 days1-2/+4
| | | | | | | | | `GET /auth/whoami` lists the user's capabilities (`caps`) and its token's `limit`, if any, side by side; what the request may do is what both give, as endpoints decide it. It says so now (`may`): the capabilities, or with a limit each capability met with each of the limit's (`Capability::meet`): at the deeper of the two paths, a `*` of one taking the other's key there, with the rights both name; nothing where the paths part, no right is shared, or the path is protocol data one of them doesn't name.
* docs: what is postponed or rejected stays in its own two filestv8 days1-2/+1
| | | | | | | | | Docs and comments outside future-work.md and review-rejections.md say what the code does, and point nowhere else for what it doesn't: the architecture page's map, the transports' forwarders, keys with `/`, a strict swarm's registry, trust.md's "Not yet" (now saying what isn't protected, in a sentence), the topology bench, and the comments of the change benchmarks, capabilities' grantor, tokens, dissemination, refusals and topology.
* docs: a strict swarm's registry against a minority of members, not a majoritytv8 days1-1/+7
| | | | | | | | | | Review 4, R3 partly: nodes refuse a strict remake of a strict swarm by its kind, a label the proposal and the snapshot's metadata carry. A majority of members labelling one `compact`, its snapshot holding the registry it wants, gets it followed: nodes whose own build differs take the quorum's snapshot. access.md says outright that a strict swarm's registry, policy and bans change by its users' signatures against a minority of members; comparing a downloaded snapshot with the node's own build at the signed places, and refusing the switch where they differ, goes to future-work.md.
* access: a key's comment 256 bytes at mosttv8 days1-1/+1
| | | | | | | Review 4, 1250's note: a key's comment was kept as given, unbounded but by the request limit (2 MiB), in protocol data every node holds and the dashboard shows. It says whose and where the key is: at most 256 bytes now (`sshsig::MAX_COMMENT`), a longer one refused with the key.
* screen: that a policy was held kept across a swap of the documenttv8 days1-2/+2
| | | | | | | | | | | Review 4, F12: `Screening::of` started screening over when the document was swapped (a drop, a switch, a rejoin), the root pin alone carried on, so whether the document had held a policy (`policed`, 1211) was forgotten there too, not only across a restart as documented: after a drop with the policy removed meanwhile, late changes written under it went in unjudged again. It is carried on now, as the root pin is; what belongs to the old document (changes waiting, refusals, drops held) still starts over. access.md says so.
* api: a stream opened by password or a proxy's header ends with its usertv8 days1-1/+2
| | | | | | | | | | | | Review 4, F11: only streams answered to a token ended with it (1273); one opened by password (basic authentication) or a proxy's header went on after its user was disabled or removed. `streams_end` now wraps those too, by the user `basic_auth` leaves on the answer: such a stream ends once the document no longer has its user, enabled (`token::user_taken`, the part of a token's check about its user, which `still_taken` uses too), looked at as the stream begins and as protocol data changes. No expiry: a password has none.
* roots: only the seeds' roots end the wait for themtv8 days1-3/+6
| | | | | | | | | | | | | | Review 4, R2 partly (F8): a joining node waited for "each of its seeds" to name the swarm's root as a count, of every admitted peer that named one. Node identities are self-made and admission is the swarm key: a member answering a joiner under as many identities as it has seeds, naming its own root within the wait, made the joiner pin it before the real seeds answered, and refuse them after as another history. Now the seeds are the nodes proven at the seeds' addresses (`roots::seed_found`, as `bootstrap::resolve_seeds` finds them), and only their roots count toward the wait and start its clock. Another peer naming a root still disputes it (no root while they differ), so such a member can keep a joiner from joining, as any member can, but not hand it another root. access.md says so.
* access: a shallow read shows only the way through where the user reads partlytv8 days1-1/+3
| | | | | | | | | | | | | Review 4, F4: `?shallow=true` kept every entry the user may at least pass through, and a shallow read inlines short scalars' values with their types and sizes. A scalar at a level a `*` passes through (a capability on `data/*/public`, an entry `data/count: 42`) showed its value though no capability covers it; before `*`, only a scalar where a capability expected a map did. Now an entry the user may read only partly is shown only as the way through it is: a map, with no more than its type (not its size, the number of its keys); anything else there (a scalar, a list, which a deep read leaves out too) isn't shown. Entries it may read whole are as they were.
* api: a stream opened with a token ends with ittv8 days1-1/+4
| | | | | | | | | | | | | | | | | | | | A token was checked when a request came, and a stream answered to it (the dashboard's events, a subscription's links and messages, the store's streams) then went on for as long as the client kept it open: past the token's expiry, past its user's tokens being revoked, its user disabled or removed, its session ended. Now a middleware inside `login::bearer` (`login::streams_end`) ends a streaming answer (`text/event-stream`, `application/x-ndjson`) to a request with a token at the token's deadline, its expiry, or as soon as the document no longer takes it (`token::still_taken`, the checks `verify` makes of the document, now its own function): looked at when a change touches protocol data (the root, a switch, among it), and when a session ends on the node itself in a swarm without a registry (`AppState::session_ended`). No polling: a timer for the expiry, and the changes as they come. The client reconnects with the token it has then; a refreshed token is a new one, so a stream lasts a token's lifetime at most (12 hours by default). `futures` is a dependency of every build now (for `take_until`), not only of libp2p's and Tor's.
* access: ending a single sessiontv8 days1-1/+5
| | | | | | | | | | | | | | | | | | | | Logging out of the dashboard (`DELETE /auth/session`) only cleared the cookie: the session's tokens stayed taken until they expired, by every node. Ending them took `POST /auth/logout`, which ends all of a user's sessions. Now `DELETE /auth/session` ends the session of the token it comes with (the cookie, or a bearer token): where the swarm has a registry, it is recorded as `_continuum/sessions/<user>/<session>` (`registry::session_path`), its value until when the session would have lasted, and every node refuses the session's tokens once the change reaches it (`token::Refused::Ended`): the page's own, its narrow tokens, and one handed to another member's dashboard, all refreshed from it and keeping its ID. The rules take the entry from the user itself or one who manages users, as a logout. A remake's snapshot leaves out entries past that time, a user's map where none is left: their tokens are expired anyway. Without a registry the document can't record it: the node ending it refuses the session's tokens itself (`AppState::ended_sessions`, until it restarts), others take them until they expire, as a logout there is refused.
* dashboard: a subscribed node's own figures when it is in focustv9 days1-1/+2
| | | | | | | | | | | | | | | A node in focus showed this node's `/peers` entry for it and the links it reports: what this node knows of it, never what it says of itself, though the page subscribes to it. Now a subscribed node in focus shows its own figures first (`Node:`), as this node's are (its `/admin/stats`), then this node's entry for it (`as this node sees it`) and its links, each a branch. A link in focus shows each end's paths to the other as that end has them: this node's, and a subscribed node's from its `/peers`. The page reads them from the node every 2 s while it is in focus (`readFigures`, `figuresOf`), with its narrow token, which may look at a node as any user with a capability may; pages of other origins may now call `/admin/stats` and `/peers` (`cors::open`), as they do a node's links and messages. Where they can't be read, the box says why.
* dashboard: a subscribed node's message written out, read from it when showntv9 days1-1/+2
| | | | | | | | | | A subscribed node's messages come without being written out (their stream leaves the text out: up to 8 KiB each, 500 at a time), so the figures box said only when, both ends, type and size of one. Now the node answers for one message by its number, `GET /admin/dashboard/messages/own/{seq}` (`{"text": …}`, `404` once it isn't kept), which pages of other origins may call as they do its streams (`cors::open`), and the page reads it when the message is shown, with its narrow token, and keeps it on the message. Where it can't be read, the box says why.
* access: what a node holds alone by `_continuum/local/<node ID>/<name>`tv9 days1-4/+10
| | | | | | | | | | | | | | | | Setting a node's log filter took `write` on `_continuum`, all of the protocol data: whoever could change one node's logging could change the swarm's members, remakes and users too. Now what a node holds alone has paths of its own for capabilities, under `_continuum/local/<node ID>/`: `log` (`/admin/log`), `config` (`/admin/config`) and `debug` (`/debug`, always `write`), `read` to look and `write` to act (`api::access::needed`, which takes the node's ID). So `_continuum/local/<node ID>` is everything on one node, `_continuum/local/*/log` the log filter on every node, and holders of `_continuum` keep it all. Nothing is stored there: the store refuses writes under `_continuum/local`, and the rules refuse a change touching it, as for epoch metadata. The quarantine stays with `_continuum`: its entries are everyone's writes, which a node-local capability mustn't show.
* access: `*` for any one key in a capability's pathtv9 days1-3/+5
| | | | | | | | | | | | | | | | | | A capability's path covered by prefix only, so what is the same at every key of a map (each node's log filter, say, at `_continuum/local/<id>/log` from the next patch on) took a capability per key. Now a `*` segment stands for any one key, as it already does in signed paths and sealed places (`envelope`, `sealed`, which now share one `agree`): * covering (`Capability::covers`): the pattern no longer than the path, and agreeing with it segment by segment; * listings (`reaches`): pattern and path agreeing on the segments both have, so every key on the way shows, nothing past where the pattern differs; * narrowing (`Capability::holds`, for a token's limit narrowed again and a refresh's): at or below, a `*` only under a `*`: a limit naming one key never widens to all. A `*` first is outside protocol data, so it never covers `_continuum`, as `[]` doesn't. A key that is `*` itself can't be named alone. Every node judges changes by capabilities, so all must read them alike: they run the same version.
* access: keep an SSH key's commenttv9 days1-2/+2
| | | | | | | | A key's line was stored as the key alone (`ssh-ed25519 <base64>`), whatever comment it came with, both from `PUT /auth/keys/<name>` and from `--bootstrap-keys`. Now its comment is kept after it (`PublicKey::kept_line`), the spaces between its words made one. The comment checks nothing: every use of a key parses the line, and the parse reads the key alone.
* dashboard: keys edited, the last removed with a password, failures kepttv9 days1-2/+4
| | | | | | | | | | | | | | | | | | | | | The credentials dialog listed a user's keys whole, to add one or remove one but the last, and any failure replaced the dialog with the error, the form lost. * A key is shown short: its type, the first and last four characters of what tells it apart (an Ed25519 key's base64 after the part all of them share), its comment; the whole line in its tooltip. * A key can be edited, its name and its line: saved under the name, a new name written first and the old one removed. * A user with a password on this node (`--htpasswd`) may remove its last key: it logs in by the password. GET /auth/keys says so (`password`), and DELETE /auth/keys/{id} takes it then; the rules no longer keep the last key on every node (no other node can tell who has a password where; under a strict policy the signed entry keeps one still). * What fails says why beside where it was asked (the add form, the edited row, the removed one), which stays as it was, to be set right and tried again.
* docs: signing what is sent, and which --sign-every to choosetv9 days1-3/+3
| | | | | | | | | api.md's Signed changes says what sent, all and none do, what each costs, and which to choose: sent for nearly every swarm, all where each change should carry its own proof, none to save signatures where only protocol data and listed paths need them; and that signatures travel with their changes, a message carrying none taking none. access.md no longer says signatures come on their own within a second.
* roots: a peer contradicting --genesis-root refused at the handshaketv9 days1-2/+3
| | | | | | | | | Review 3, R5: a node given its root (--genesis-root) refused a peer naming another only change by change while its document was empty, each with an entry among the refused; the handshake went through, as there was no root of its own yet to compare with. The root given is now compared too: a peer naming another is refused at the handshake, logged once, as one whose document starts from another root.
* state: refused writes limited for the node tootv9 days1-1/+3
| | | | | | | | | | | | Review 3, R5: --refused-writes-per-minute bounds each user, but the cost it guards, a document copy under the write lock, is the node's: ten users, or ten accounts of one, are ten times the budget. The node now takes six times a user's limit within a minute in all (refused::NODE_FACTOR); past it, every user with a write refused within the minute is answered 429 untried, until the oldest leave it. A user none of whose writes was refused writes on, so honest writers aren't held up by others' refusals.
* screen: judged after the policy is gone, tootv9 days1-1/+4
| | | | | | | | | | | | | | Review 3, R4: whether a batch was judged followed the receiving document's policy now (and whether the batch writes one). After the policy was removed, or replaced by a version the node doesn't know, changes written under it and received late went in unjudged, while nodes that had them earlier judged them; REFUSALS gave up likewise. Screening now remembers that the document held a policy, known or not (Screening::policed), and judges what it receives while it does, each change by the policy at its dependencies; REFUSALS judges then too (not under a policy the node doesn't know, as before). Not across a restart, which access.md says.
* docs: remakes and signed valuestv9 days1-0/+3
| | | | | | | | Review 3, R3, the replace side: a replace or import remake writes its content as it is, at signed places too, so under a strict policy a member majority can put plain values where envelopes were. access.md says that remakes are outside the rule; keeping envelopes at signed places in every kind is postponed to future-work.md.
* remake: a strict remake of a strict swarm isn't followedtv9 days1-1/+2
| | | | | | | | | | | | | | | Review 3, R3: 1186 kept honest nodes from proposing or voting for a strict remake of a swarm strict already, but a majority of members, each with keys of its own, could still commit one, and switch and catchup followed it without asking what kind of remake made the epoch: the registry, policy and bans of a strict swarm changing by a member majority, the honest minority following. A node now refuses to switch to such an epoch (its document's policy strict, the remake's kind strict), and catchup refuses to rejoin one whose chain of epochs holds a strict remake after the swarm was strict (as the old document is, or once a remake since made it so). access.md says so.
* roots: a joiner takes a root once its seeds named ittv9 days1-2/+4
| | | | | | | | | | | | | | | | Review 3, R2: the root pin was set by the first HELLO_REPLY, and the first sync, a round trip later, took that root; a peer naming another afterwards was refused as another history. So the seed that answered first decided, not "none while they disagree", and a malicious seed makes itself fastest. A node joining with an empty document of the first epoch now takes no root (RootPin::Awaiting, roots left for later) until each of its seeds named one, or ROOT_WAIT (10 s) passed since the first did; then the one they name, none while they differ, as before. With --genesis-root it takes that one alone, at once. access.md, the option's help and example.toml say so; switching roots later, while the joiner holds nothing of its own, is postponed.
* screen: signatures required as the policy a change came under saystv9 days1-1/+2
| | | | | | | | | | | | | | | | | | | | | Review 3, R1: what a node received was vouched for only while its own document's policy required signatures. A joiner's first sync, and every node's message bringing `required`, went in by the rules alone: a malicious first peer could plant changes under other members' actors at their next seqs, their real ones then failing as duplicates for good. The signatures a message carries are always offered now, and the screen always has them: a change waits for one where the policy at the heads it is judged at requires it (rules::Reads::required, read once per heads), whatever the receiving document holds. Changes written under a policy not requiring signatures wait for none, as on every other node; the check for forged changes runs always. Changes waiting for a signature are judged again whenever signatures come. The test of signatures required now takes the history into an empty document; a new one takes changes written under a policy not requiring them without any.
* state: limit refused writes per usertv9 days1-1/+4
| | | | | | | | | | 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.
* roots: an epoch's root pinned, and named in every handshaketv9 days1-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Review 2, N7, the care it raised: a joining node's empty document took as the first epoch's root whatever dependency-less change came first, from whichever peer it joined through; the first epoch's ID is all zeros, so nothing pinned it. A remake's epoch has its ID, the snapshot change's hash, which the rules hold its root to. * Every node names its epoch's root in HELLO and HELLO_REPLY (the epoch's ID for a remake's, its genesis change for the first; wire version 45). A node whose document starts from another root of the same epoch refuses the handshake, logging it: another history under the swarm's ID, a forged root or a genesis started again. * A joining node with an empty document takes as its root only the one it was given (--genesis-root, new), else the one its peers name, and none while they name different ones (access::screen::RootPin, kept in Screening across documents): one peer hands it another root only if it is all the joiner hears, or never, with --genesis-root. A root refused is listed with the refused, what builds on it with it. * The genesis node logs the root (`The swarm's root`); GET /admin/epochs shows it (`root`). A genesis started again under a remembered swarm ID used to merge with the nodes of it still running; they now refuse it (another root), and the docs say to join them with seeds instead. The epoch's identity stays as it is (generation 0 all zeros): records and epoch metadata name it so, and every comparison of epochs with them.
* screen: what a node receives judged, policy or nottv9 days1-5/+6
| | | | | | | | | | | | | | | | | | | | | Review 2, N7: a node screened received changes only while its own document had a policy it enforces. A joiner's empty document has none, so its first sync, as much history as the node it joins through chose, was applied unjudged, and under signatures required unvouched; the same for any node while the policy's own change arrived with later ones. Sync messages, deltas and downloaded changes are now always screened, each change judged by the policy at its dependencies (1135), so the verdicts are the swarm's. While neither the document nor the changes hold a policy (none touches a "policy" key: inspect::touch_key), only an epoch's root is judged and nothing is placed: bench_screening, after 1188, measured placing everything at about as much again as applying (564 ms + 543 ms for 100 000 changes), judging by the rules at about five times (+2.5 s), which a document with a policy pays anyway. access.md no longer lists the joiner's first sync, nor nodes agreeing only as the policy reaches them (judged at the dependencies, they agree), as left to do; changes::load_delta is for tests now.
* store: a write inside a list checked where the rules judge ittv9 days1-1/+3
| | | | | | | | | | | | | | Review 2, N9: the API checked a write's capability on the path asked (servers/list/3/name), the rules on the list it is in (servers/list): a user whose capability lay inside a list had every such write pass the API and refused by the node's own judgement (403, after rolling the document back). inspect::placed places a write's path in the document by the rule the inspector places operations by (Place::child: cut after the first list or text on the way), and the store's writes check capabilities there. One rule for both; a test checks placed against the paths the inspector finds in the change such a write makes.
* strict: no strict remake of a swarm strict alreadytv9 days1-1/+3
| | | | | | | | | | | | | Review 2, N2: nothing checked that a strict remake's base wasn't strict already. In a strict swarm the registry, the policy and the bans change only as a user who may change them signs; a strict remake committed by a majority of members, each with keys of its own, could drop any of them (unban, remove managers, empty userSigned and the sealed declarations), and the honest minority would follow. A node now takes a strict remake (proposing or voting) only in a swarm not strict yet: turning strict is done once, by a remake; after it, by signatures.