| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`--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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, the links of the chains to signed values went in
the order their changes were made, but the other writes were grouped by
time, and a link went before a group only where its time wasn't later.
A write built on what a link grants (a capability in an entry its
manager signed, a ban lifted, a declaration) went first wherever its
clock was behind the link's, was judged where it wasn't granted yet,
and was quarantined, though every node had taken it.
Under a strict policy the other writes now go by where the last change
that wrote them is among those replayed (`between`), with the links,
and keep their times for later replays. Without a strict policy there
are no links, and the groups go by time as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
`--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.
|
| |
|
|
|
|
|
| |
Where the new epoch holds as high a `seq` at a signed place as the old
one reads, the chain isn't replayed: it was counted as superseded and
left out even with `--superseded-writes quarantine`, unlike every other
write a newer one superseded. Now it goes to the quarantine then too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, the links of the chains to signed values were
ordered across places by their changes' timestamps. How a link is
judged in the new epoch depends on what was replayed before it: a key
added to a user's entry, a capability granted. A write signed with a
key added a moment before, through a node whose clock is behind, went
first, was refused and quarantined, though every node had taken it.
The changes replayed (`between`) now come each after those it builds
on, clocks deciding only between changes neither of which saw the
other, then the lower hash; the links follow that order, and an
envelope takes its time from the first change that wrote it there.
remakes.md says so, and what becomes of a place where a link is
refused. Without a strict policy there are no links, and nothing
changes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Where the policy asks for signed values, a place's value is chosen by
`seq`, but conflict reports still called the choice `newestWins`, and
the code and the architecture still said "newest" of what a read
shows. A report names it `highestSeq`; the rest says "the one a read
shows".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, a replay wrote at each path the old document's
merged view: at a place of a value its user signed, the last envelope
alone, whose `prev` names one the new epoch doesn't hold if the value
was written twice since the base. Every node refused it, it went to
the quarantine, and the new epoch kept the base's value: a remake
rolled back every signed value changed twice since its base, and a
rejoining node lost its own the same way. And the replay found what
changed by Automerge's diff, which says nothing of a value that
changed beside Automerge's own choice: where a place held two values
at the base, a write replacing the one read by `seq` wasn't replayed
at all.
Now, under a strict policy, the places of signed values are found from
the changes' operations as well as from the diff, and each is replayed
as the chain that leads to the envelope the old document reads: every
envelope from the one the new document holds there, following `prev`
through the changes since the base, each in a change of its own by its
signer at the time it was made, judged as every node will judge it.
A place is replayed only where the new document holds a lower `seq`
there; where no chain leads from what it holds, it goes to the
quarantine. A path above such places is split into its keys. Without
a strict policy nothing changes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The order by `seq` sat in `store::candidates`, which every swarm reads
through: in a swarm that isn't strict, a string shaped like an
envelope, written at the same time as a plain value or a map, was read
first. What a swarm without a strict policy reads must not change for
signed values.
The order now applies only where the policy asks for signed values
(`"values": "signed"`), as any value at the policy's place says, read
as written (`signs_values`), so the policy's own reading doesn't go
round. Elsewhere `candidates` is newest first, as always. It is looked
at only where a place holds several values and one is an envelope.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A neighbour pulls heads a STATUS listed only if it still lacks them after
a round trip to the sender, as they are usually on their way along a
writer's tree. With no round trip known, or one measured long ago (busy
pairs send no keepalives), it pulled at once; with a short one, a STATUS
sent right after a change can overtake it by more than that round trip,
delays varying per message. Either way the change came twice
(`trees_hold_through_continuous_writes`: c pulled once while every write
reached it along x's tree).
The wait is the round trip, but 50 ms at least (and 1 s at most, as
before).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A node switched to a fresh actor whenever a peer showed it a change of
its own actor that it didn't hold, signed or not. So any peer made a
node start a writer at will, by sending a copy of its last change with
another value: and every writer costs every node memory in proportion
to the document's history.
Copies of a node's data directory hold its key, and sign their
changes with it; a stranger can't. A twin switches the node only where
a signature by the node's own key of it is kept or waiting. Unsigned,
it is refused as forged as before, and nothing switches.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A member one neighbour short asks once per `ONE_SHORT_EVERY` (300 s), and a
member with `k` refused it. When a member most others had as a neighbour
went away, three members ended up each with the other two as neighbours,
one short each; each asked once, was refused by a full member, and waited
five minutes. Changes pass only between neighbours: the three got none of
what was written meanwhile (`active_views_settle_and_heal`, timed out
waiting for the same heads).
NEIGHBOUR says now whether its sender is one short, and a member with `k`
takes such an ask as its `k + 1`th, the most it keeps; one with `k + 1`
still refuses. Asks stay as rare as they were, and one is enough but where
those asked have `k + 1`. Wire version 50.
|
| |
|
|
|
|
|
|
|
|
|
| |
The document file's format names itself in its first line
(continuum-document/2) and each record's kind in its first byte. A
record of a kind the reading version doesn't know makes the file
unusable: the node doesn't start on it unless told to move it aside
(--force badDocumentFile). lifecycle.md says so: a file one version
wrote is read only by versions knowing every kind of record in it. The
format's comment names the Opened record a node appends as it starts on
the file, which undoes the clean stop's mark.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A sync message larger than the threshold for its peer (16 chunks, lower
on a slow link or after a message to it failed whole) goes as a delta:
the peer fetches its changes in chunks, from any node holding them. Its
signatures, each writer's latest with changes in it, went in the
envelope offering it: up to 65536 of them, 6 MiB, in one message, the
size the delta exists to avoid. Nor did an Automerge message count its
signatures (one per writer in a whole document pulled) towards the
threshold.
A delta's signatures are now a blob of their own: the offerer packs and
keeps them (Blobs::keep, the latest 64), and the spec names them by
BLAKE3 hash and size (DeltaSpec::signatures, None where no signature
vouches for its changes). They are served as content (BlobId::Content),
so their hash checks them. The receiver fetches them from the offerer
alone, as another node holding the changes holds signatures of its own,
before the changes, and offers them under the write lock just before
judging the changes, so they wait for them as before. The envelope of a
delta carries none. An Automerge message's signatures count towards its
size: past the threshold, it goes as a delta.
Wire version 49.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With --keep-actor, a node on a document file that ends with a clean stop
writes on as the actor the file names. Two nodes started on copies of
one file (a copied data directory, a restored disk image while the
original runs) both do, and both make that actor's next change number:
peers holding one refuse the other as forged, and everything built on
it.
screen::apply_bytes, the way every received change comes in, now looks
for a change of the actor the node writes as that the node doesn't hold:
only another node can have made it. The node then writes on as a fresh
actor at once, logs a warning, and its callers add the actor to the
node's own (RemakeState::add_own_actor), which the document file's
header follows. The change is judged as any other. lifecycle.md says not
to start a copy of a node's data directory with --keep-actor, and what
the switch leaves: what both wrote before stays refused where the
other's came first.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
At start, a node on a document file appends an Opened record before it
writes anything, so that a Closed record before it no longer says the
file holds every change of the actor it names. It does so now before
deciding which actor to write as, and DocumentFile::open says whether it
could: where the append fails (the disk full, permissions), the file
still ends with Closed, and later appends likely fail too. A crash, or a
clean stop whose last append failed (close then sees the file behind and
writes no mark), would leave that Closed standing for a run the file
never got. So with --keep-actor, the node writes on as the actor of
before only where the file was marked as opened; else it writes as a
fresh actor and warns.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
With the other options of the document file: what it does, what it saves (a writer per
node and per crash or drop, rather than per start), and what it must not meet: two
nodes started from copies of one document file, or a node from an older copy of its
own, which would write as the same actor.
|
| |
|
|
|
|
|
|
|
|
|
| |
How many writers (Automerge actors) the document's changes have matters: a writer is a
node's run (each start, rejoin or drop makes one, a start keeping the one of before with
`--keep-actor` after a clean stop), and every transfer of the whole history carries a
signature for each. `/admin/stats` now says it (`document.writers`, and
`document_writers` for Prometheus), counted from the changes' metadata alongside the
saved size's measurement in the background (at least a minute apart), as that takes
time proportional to the document too; an export, which measures the size alone, keeps
the count of before. The dashboard's figures show it with the rest.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
actor
A node writes as a fresh Automerge actor at each start, so no change number of an actor
comes twice: one sent before a crash but not yet appended to the document file would
otherwise be made again, differently. An epoch thus gathers a writer per start, and
every transfer of its history carries a signature per writer.
The document file now says when it holds everything the node wrote:
* at a clean stop, after the last append, an empty `Closed` record, only where the
file is up to the document's heads (ready, not rejoining);
* as a node starts on the file, before anything is written, an empty `Opened` record,
so a crash from then on leaves a file without the mark;
* the header names the actor the node writes with (`current`).
With `--keep-actor` (off by default; needs `--document-file`), a node starting on a
file that ends with `Closed` writes on as that actor. A crash, a drop, a switch or a
rejoin still starts a fresh one, so an epoch's writers come to one per node plus one
per such event. lifecycle.md says so.
|
| |
|
|
|
|
|
|
|
| |
`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 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a policy requiring signatures, a node takes a change only once a signature
vouches for it: one of the change itself, or of a later change of the same writer. A
writer is a node's run, each start, rejoin or drop making a fresh actor, so an epoch
gathers writers for as long as it lasts, and a transfer of its whole history (a joiner
pulling the document, a delta) must carry a signature for each of them, or the joiner
waits for the rest for good.
A message's signatures are now chosen by what it carries:
* changes, up to 256 signed among them: each one's signature;
* more (a whole document pulled): each writer's latest signed change among them, found
by the document's change metadata (`Signatures::for_changes`), vouching for the rest;
* a delta: each writer with changes in it (`get_changes_meta(from)`), its latest
verified signature (`for_delta`).
A message carries up to 65536 (6 MiB), and as many wait at the receiver for their
changes (a delta's come after it). So a transfer leaves writers unvouched only in an
epoch with more than 65536 runs writing since it began; a remake starts the count again.
Wire version 48.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Review 4, 1269's note: the node challenges for a password (`WWW-Authenticate`) only
what isn't a browser, by `Sec-Fetch-*` or a `Mozilla/…` user agent. A client calling
itself Mozilla that waits for a challenge before sending its password would get none:
api.md says to send the password with the request, as `curl -u` does, and why.
|
| |
|
|
|
|
|
| |
Review 4, 1258's note: the glossary says that a path whose way out broke while the
peer's PINGs still come is found by this node's own unanswered PINGs, which with the
turns come every one to two intervals, up to twice as long as before, and what still
finds it at once.
|
| |
|
|
|
|
|
| |
Review 4, 1257's note: measurements.md now says that no endpoint takes a secret in its
query, but every path read or written is in the request log, and paths are data here,
so the lines go wherever the node's log goes; and that a user who may set the node's
log filter may turn them on.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
Review 4, appendix: api.md's Signed changes said a node passes on each node's latest
signature (true of deltas, not of messages carrying changes) and that every change
arrives vouched for. It now says what a message carries (its changes' signatures, each
run's latest past 4096 and for a delta), that a node signs each of its runs' latest
unvouched change at start and when its document is swapped (1277), and the two cases
that still arrive unvouched (a change vouched for only by a refused one, postponed;
more than 4096 runs writing in an epoch).
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
After "log out" the page went to the login page, and the browser's back button brought
it back as it was (kept whole in its history): the map, the peers and the console went
on updating, by the stream it still had open and the subscriptions' token it still
held, though the session had ended (the document box, reading anew, got 401s).
Now leaving for the login page (`toLogin`: logging out, or the login ending) stops the
page's reading first: its stream, its subscriptions, its timers and tokens. And a page
the browser brings back whole (`pageshow`, `persisted`) loads again instead, so it
reads with the session it has now, and without one goes to the login page.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Going to another member's dashboard showed its login page for a moment: a browser
without a session there was sent from `/admin/dashboard` to `/login` (by
`auth::basic_auth`), which began a session with the token handed over and went on to
the dashboard.
Now the dashboard's page is served without authentication, as the login page is (it
holds nothing: what it shows it reads with the browser's session). Opened with a token
handed over, the page begins the session with it (`POST /auth/session`) before it reads
anything; without a session, `obtainTokens` goes to the login page, as the redirect
did. A request without credentials is refused at once rather than after the 1.5 s
that slow down guessing passwords: nothing is guessed there, and a page without a
session goes to the login page without waiting twice for it.
|