[roads] QA F-04: a dangling owner or group member drops only itself, not every plan
Deleting a person from directory.json without editing devices.json left a dangling owner, a snapshot error, and so no plans for anybody. A well-formed owner or member id that is not a person is now reported on its own codes (devices.owner-unknown, directory.member-unknown) and removed: the device is ownerless, the member leaves the group. Malformed ids, duplicates and bad JSON still stop every plan. Two new structural fixtures keep devices.owner and directory.member covered.
This commit is contained in:
+9
-2
@@ -144,10 +144,17 @@ Valid roads that grant nothing right now, reported with their reason (not errors
|
||||
| `people[].name` | 1–100 characters, no leading or trailing space, and none of: control characters (CR, LF, U+0085 included), U+2028, U+2029, zero-width characters U+200B–U+200F and U+2060–U+2069, bidi controls U+202A–U+202E, U+FEFF (`directory.name`) — so a name can never carry a line into an exported config |
|
||||
| `groups[].id` | a group id, unique among groups |
|
||||
| `groups[].name` | as a person's name |
|
||||
| `groups[].members` | person ids that exist, no repeats (`directory.member`) |
|
||||
| `groups[].members` | person ids, no repeats (`directory.member`); a well-formed id that is not a person in `people` is left out of the group (`directory.member-unknown`) |
|
||||
|
||||
Unknown fields, bad JSON and a missing file are `snapshot.json`.
|
||||
|
||||
**Structural errors and dangling references (QA F-04).** Any error in either snapshot means no plan at all,
|
||||
with two exceptions: a group member and a device owner that are well-formed ids but not people in the
|
||||
directory. That is what deleting a person upstream leaves behind, before anybody edits `devices.json`. Each
|
||||
is still an error and is reported, but it removes only itself: the member leaves the group, and the device
|
||||
becomes ownerless, so only `device:` roads reach it. Everybody else keeps their plans. "No plans" is kept for
|
||||
what makes the snapshot unreadable: bad JSON, a wrong format, a malformed or duplicate id, key or address.
|
||||
|
||||
## `devices.json` — the device list
|
||||
|
||||
```json
|
||||
@@ -167,7 +174,7 @@ Unknown fields, bad JSON and a missing file are `snapshot.json`.
|
||||
| `format` | — | `1` |
|
||||
| `key` | — | a device key (`devices.key`), unique (`devices.duplicate`) |
|
||||
| `name` | — | 1–64 characters of `[a-z0-9-]`, unique (`devices.name`) |
|
||||
| `owner` | none | a person id in the directory (`devices.owner`); a device with no owner is reached only by `device:` roads |
|
||||
| `owner` | none | a person id (`devices.owner`). One that is not in the directory leaves the device ownerless (`devices.owner-unknown`, reported). A device with no owner is reached only by `device:` roads |
|
||||
| `address` | — | the device's mesh address, one IPv4 or IPv6 address, unique, not inside any device's routes, not loopback, link-local, multicast or IPv4-embedding IPv6 (`devices.address`) |
|
||||
| `classic` | `false` | a classic WireGuard peer, **not post-quantum** |
|
||||
| `exit` | `false` | offers itself as an exit |
|
||||
|
||||
Reference in New Issue
Block a user