Merge pull request 'Test copies of node-uplink, node-resolver and node-display-session byte for byte (design 08 sign-in-page)' (#214) from feat/sign-in-page into main
This commit was merged in pull request #214.
This commit is contained in:
@@ -8,12 +8,14 @@ import (
|
||||
|
||||
// Defends novox/hq ADR 0208: the graphical session is one module per piece, on the mesh's seats.
|
||||
|
||||
// §2: the eleven roles are the mesh's own node seats, each with the verbs it starts with.
|
||||
// §2: the eleven roles are the mesh's own node seats, each with the verbs it starts with. Defends design 08
|
||||
// sign-in-page §3 (novox/hq ADR 0687 §4): the display session gains the required verb `open`, and its decision
|
||||
// gains ADR 0687.
|
||||
func TestTheGraphicalSessionsSeatsAreTheMeshsOwnWithTheirVerbs(t *testing.T) {
|
||||
want := map[string][]string{
|
||||
LoginManagerSeat: {"sessions"},
|
||||
DisplayServerSeat: {"displays", "layout"},
|
||||
DisplaySessionSeat: {"reload", "workspaces", "windows"},
|
||||
DisplaySessionSeat: {"reload", "workspaces", "windows", "open"},
|
||||
TerminalEmulatorSeat: {"open"},
|
||||
LauncherSeat: {"menu", "secret"},
|
||||
NotifierSeat: {"send", "history"},
|
||||
@@ -23,14 +25,19 @@ func TestTheGraphicalSessionsSeatsAreTheMeshsOwnWithTheirVerbs(t *testing.T) {
|
||||
CompositorSeat: nil,
|
||||
SecretServiceSeat: nil,
|
||||
}
|
||||
decisions := map[string]string{DisplaySessionSeat: "novox/hq ADR 0208, ADR 0687"}
|
||||
for name, verbs := range want {
|
||||
s, ok := SeatNamed(name)
|
||||
if !ok {
|
||||
t.Errorf("%s is not in the mesh's set", name)
|
||||
continue
|
||||
}
|
||||
if s.Scope != ScopeNode || s.Decision != "novox/hq ADR 0208" {
|
||||
t.Errorf("%s is %s-scoped under %q", name, s.Scope, s.Decision)
|
||||
wantDecision := decisions[name]
|
||||
if wantDecision == "" {
|
||||
wantDecision = "novox/hq ADR 0208"
|
||||
}
|
||||
if s.Scope != ScopeNode || s.Decision != wantDecision {
|
||||
t.Errorf("%s is %s-scoped under %q, want %q", name, s.Scope, s.Decision, wantDecision)
|
||||
}
|
||||
var got []string
|
||||
for _, v := range s.Serves {
|
||||
|
||||
@@ -7,16 +7,19 @@ import (
|
||||
|
||||
// Defends novox/hq ADR 0247: a machine's own resolver is a node seat, held only where something requires
|
||||
// `split-dns`; where it is held it writes the resolver file and the uplink's holder steps back from it.
|
||||
// Defends design 08 sign-in-page §2 (novox/hq ADR 0687 §2): the seat gains the required verb
|
||||
// `uplink-names`, which replaces nothing of a shell command.
|
||||
|
||||
// The seat: node-scoped, decided by ADR 0247, and its three verbs required of every holder — a holder
|
||||
// exists only once the module serving them does, so nothing has to be optional while it catches up.
|
||||
// The seat: node-scoped, decided by ADR 0247 (gaining ADR 0687), and its four verbs required of every
|
||||
// holder — a holder exists only once the module serving them does, so nothing has to be optional while it
|
||||
// catches up.
|
||||
func TestTheMachinesOwnResolverIsANodeSeatWithItsVerbs(t *testing.T) {
|
||||
s, ok := SeatNamed(ResolverSeat)
|
||||
if !ok {
|
||||
t.Fatalf("%s is not in the mesh's set", ResolverSeat)
|
||||
}
|
||||
if s.Scope != ScopeNode || s.Decision != "novox/hq ADR 0247" || s.Delivers != "" || s.Replicated {
|
||||
t.Errorf("%s is %+v; a node seat under ADR 0247 that delivers nothing", ResolverSeat, s)
|
||||
if s.Scope != ScopeNode || s.Decision != "novox/hq ADR 0247, ADR 0687" || s.Delivers != "" || s.Replicated {
|
||||
t.Errorf("%s is %+v; a node seat under ADR 0247, ADR 0687 that delivers nothing", ResolverSeat, s)
|
||||
}
|
||||
var got []string
|
||||
for _, v := range s.Serves {
|
||||
@@ -24,12 +27,15 @@ func TestTheMachinesOwnResolverIsANodeSeatWithItsVerbs(t *testing.T) {
|
||||
if v.Optional {
|
||||
t.Errorf("%s.%s is optional; its first holder serves it", ResolverSeat, v.Name)
|
||||
}
|
||||
if v.Description == "" || v.Input["type"] != "object" || len(v.Replaces) == 0 {
|
||||
t.Errorf("%s.%s has no description, no object schema or says it replaces nothing", ResolverSeat, v.Name)
|
||||
if v.Description == "" || v.Input["type"] != "object" {
|
||||
t.Errorf("%s.%s has no description or no object schema", ResolverSeat, v.Name)
|
||||
}
|
||||
if v.Name != "uplink-names" && len(v.Replaces) == 0 {
|
||||
t.Errorf("%s.%s says it replaces nothing", ResolverSeat, v.Name)
|
||||
}
|
||||
}
|
||||
if strings.Join(got, " ") != "routes route unroute" {
|
||||
t.Errorf("%s serves %v, not routes, route and unroute", ResolverSeat, got)
|
||||
if strings.Join(got, " ") != "routes route unroute uplink-names" {
|
||||
t.Errorf("%s serves %v, not routes, route, unroute and uplink-names", ResolverSeat, got)
|
||||
}
|
||||
// The verbs name a link, domains and servers, and never a VPN: the resolver knows nothing of one.
|
||||
for _, v := range s.Serves {
|
||||
|
||||
@@ -2,15 +2,83 @@
|
||||
"format": 1,
|
||||
"seat": "node-display-session",
|
||||
"scope": "node",
|
||||
"grain": "seat-list",
|
||||
"grain": "whole",
|
||||
"domain": "Core",
|
||||
"decision": "novox/hq ADR 0208",
|
||||
"decision": "novox/hq ADR 0208, ADR 0687",
|
||||
"verbs": [
|
||||
{
|
||||
"name": "reload",
|
||||
"description": "Reload the session's configuration in place, keeping its windows.",
|
||||
"input": {
|
||||
"properties": {},
|
||||
"properties": {
|
||||
"force": {
|
||||
"description": "reload even if the configuration on disk has errors (optional)",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"reloaded": {
|
||||
"description": "whether the reload ran",
|
||||
"type": "boolean"
|
||||
},
|
||||
"i3": {
|
||||
"description": "the outcome of each command the reload ran, given only once it ran (optional)",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"error": {
|
||||
"description": "why it failed (optional)",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"success"
|
||||
]
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"description": "the configuration's errors on disk, found by the check that ran first",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "the file holding the error (optional)",
|
||||
"type": "string"
|
||||
},
|
||||
"line": {
|
||||
"description": "the line holding the error (optional)",
|
||||
"type": "number"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"text"
|
||||
]
|
||||
}
|
||||
},
|
||||
"watcher": {
|
||||
"description": "the configuration watcher's status, given only once the reload ran (optional)",
|
||||
"type": "object"
|
||||
},
|
||||
"why": {
|
||||
"description": "why it did not reload, given only when it did not (optional)",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"reloaded",
|
||||
"errors"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
@@ -20,6 +88,48 @@
|
||||
"input": {
|
||||
"properties": {},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"workspaces": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"num": {
|
||||
"type": "number"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
},
|
||||
"visible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"focused": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"urgent": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"num",
|
||||
"name",
|
||||
"output",
|
||||
"visible",
|
||||
"focused",
|
||||
"urgent"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"workspaces"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -33,7 +143,130 @@
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"windows": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"con_id": {
|
||||
"type": "number"
|
||||
},
|
||||
"window": {
|
||||
"type": "string"
|
||||
},
|
||||
"class": {
|
||||
"description": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
"instance": {
|
||||
"description": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"description": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
},
|
||||
"focused": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"urgent": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"floating": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"fullscreen": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"scratchpad": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"marks": {
|
||||
"description": "optional",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"con_id",
|
||||
"window",
|
||||
"title",
|
||||
"workspace",
|
||||
"output"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"windows"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"description": "Open an http or https address in the person's default browser, for any caller over the bus (ADR 0687 §4, ADR 0689 §3): any holder of the display session (i3 or sway) serves it the same way. A holder percent-encodes every character outside RFC 3986's unreserved set (letters, digits, -, ., _, ~) and the separators a URL needs (: / ? # [ ] @ & = + %) as the bytes of its UTF-8 form, and passes the address as one argument: nothing is refused for a character, and no shell reads it. Refused, naming the reason: a scheme other than http or https (named), no scheme (a file path), no host, an address over 2048 bytes once encoded, no graphical session running, no default program for the scheme, or the opener ending with a failure (its status named).",
|
||||
"input": {
|
||||
"properties": {
|
||||
"address": {
|
||||
"description": "the http or https address to open",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"address"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"address": {
|
||||
"description": "the address as handed on, encoded",
|
||||
"type": "string"
|
||||
},
|
||||
"program": {
|
||||
"description": "the desktop entry that opened it, as browser.desktop; given only once the opener started (optional)",
|
||||
"type": "string"
|
||||
},
|
||||
"command": {
|
||||
"description": "the first word of that entry's command; given only once the opener started (optional)",
|
||||
"type": "string"
|
||||
},
|
||||
"started": {
|
||||
"description": "opened when the opener ended well within its bound, opening when it still ran at its bound",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"opened",
|
||||
"opening"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"address",
|
||||
"started"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"class": "act"
|
||||
}
|
||||
],
|
||||
"receives": [
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
"format": 1,
|
||||
"seat": "node-resolver",
|
||||
"scope": "node",
|
||||
"grain": "seat-list",
|
||||
"grain": "whole",
|
||||
"domain": "Connectivity",
|
||||
"decision": "novox/hq ADR 0247",
|
||||
"decision": "novox/hq ADR 0247, ADR 0687",
|
||||
"description": "The node seat of the machine's own resolver (ADR 0247), as ADR 0687 §2 changes it: what it sends where (routes), one link given its own servers and taken away (route, unroute), and, from the uplink's check, the host names to resolve over the link carrying the default route (uplink-names), so a working network is rated fully connected again and a network with a sign-in page is rated as one.",
|
||||
"verbs": [
|
||||
{
|
||||
"name": "routes",
|
||||
@@ -17,6 +18,42 @@
|
||||
"input": {
|
||||
"properties": {},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mesh",
|
||||
"links",
|
||||
"uplink_names",
|
||||
"mesh_resolvers",
|
||||
"outside_writes"
|
||||
],
|
||||
"properties": {
|
||||
"mesh": {
|
||||
"$ref": "#/defs/Scope",
|
||||
"description": "the global scope: the mesh's resolvers, which answer every name nothing routes elsewhere"
|
||||
},
|
||||
"links": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/defs/Scope"
|
||||
},
|
||||
"description": "every link given servers of its own"
|
||||
},
|
||||
"uplink_names": {
|
||||
"$ref": "#/defs/UplinkNames"
|
||||
},
|
||||
"mesh_resolvers": {
|
||||
"$ref": "#/defs/MeshResolvers"
|
||||
},
|
||||
"outside_writes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/defs/OutsideWrite"
|
||||
},
|
||||
"description": "the resolver file's outside writes it kept, newest first: when, who wrote it as far as the file says, whether a module took it, and when the resolver's own file was put back"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -48,6 +85,36 @@
|
||||
"servers"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"link",
|
||||
"servers",
|
||||
"domains",
|
||||
"said"
|
||||
],
|
||||
"properties": {
|
||||
"link": {
|
||||
"type": "string"
|
||||
},
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"domains": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"said": {
|
||||
"type": "string",
|
||||
"description": "what was done, in words"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -67,6 +134,70 @@
|
||||
"link"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"link",
|
||||
"said"
|
||||
],
|
||||
"properties": {
|
||||
"link": {
|
||||
"type": "string"
|
||||
},
|
||||
"said": {
|
||||
"type": "string",
|
||||
"description": "what was done, in words"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "uplink-names",
|
||||
"description": "Give the resolver the uplink's check's host names, over the link carrying the default route: the list replaces what was given before, and an empty list takes every name away. Refuses, naming the name and the reason, a name that is not a host name (a wildcard, a trailing dot, a label over 63 bytes), the root, the mesh's own domain or a name under it, or more than 8 names.",
|
||||
"input": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"names": {
|
||||
"type": "array",
|
||||
"minItems": 0,
|
||||
"maxItems": 8,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 253,
|
||||
"description": "a host name, letters, digits, hyphens and dots, taken lower-cased"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"answer": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"names",
|
||||
"link",
|
||||
"set_at"
|
||||
],
|
||||
"properties": {
|
||||
"names": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "the names now given"
|
||||
},
|
||||
"link": {
|
||||
"type": "string",
|
||||
"description": "the link they are answered over now; empty when no link carries a default route"
|
||||
},
|
||||
"set_at": {
|
||||
"type": "string",
|
||||
"description": "when the list was set, RFC 3339"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -74,5 +205,118 @@
|
||||
{
|
||||
"path": "/etc/resolv.conf"
|
||||
}
|
||||
]
|
||||
],
|
||||
"defs": {
|
||||
"Scope": {
|
||||
"type": "object",
|
||||
"description": "one scope of the resolver's answers: the mesh's global one, or one link given servers of its own",
|
||||
"required": [
|
||||
"servers",
|
||||
"domains"
|
||||
],
|
||||
"properties": {
|
||||
"link": {
|
||||
"type": "string",
|
||||
"description": "the link's name; absent for the global scope"
|
||||
},
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"domains": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "the routing domains, without resolved's leading ~: every name under one goes to these servers"
|
||||
},
|
||||
"default_route": {
|
||||
"type": "boolean",
|
||||
"description": "whether names no domain routes may also go here; only the mesh's resolvers are"
|
||||
}
|
||||
}
|
||||
},
|
||||
"UplinkNames": {
|
||||
"type": "object",
|
||||
"description": "the applied uplink-names list that resolved holds on the named link now",
|
||||
"required": [
|
||||
"names",
|
||||
"link",
|
||||
"refused"
|
||||
],
|
||||
"properties": {
|
||||
"names": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "the names of the applied list that resolved holds on that link now"
|
||||
},
|
||||
"link": {
|
||||
"type": "string",
|
||||
"description": "the link the guard gave the names to"
|
||||
},
|
||||
"refused": {
|
||||
"type": "string",
|
||||
"description": "the reason resolved last refused them, or empty"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MeshResolvers": {
|
||||
"type": "object",
|
||||
"description": "whether the mesh's resolvers are silent now, by ADR 0688's guard, and since when",
|
||||
"required": [
|
||||
"silent",
|
||||
"since"
|
||||
],
|
||||
"properties": {
|
||||
"silent": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"since": {
|
||||
"type": "string",
|
||||
"description": "RFC 3339, since when the silent state has held"
|
||||
}
|
||||
}
|
||||
},
|
||||
"OutsideWrite": {
|
||||
"type": "object",
|
||||
"description": "one outside write of the resolver file the guard displaced, never what it held",
|
||||
"required": [
|
||||
"id",
|
||||
"at"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"at": {
|
||||
"type": "string",
|
||||
"description": "RFC 3339"
|
||||
},
|
||||
"writer": {
|
||||
"type": "string",
|
||||
"description": "who the file's own header names, or empty"
|
||||
},
|
||||
"taken_by": {
|
||||
"type": "string",
|
||||
"description": "the module that took it"
|
||||
},
|
||||
"taken_at": {
|
||||
"type": "string",
|
||||
"description": "when it was taken, RFC 3339"
|
||||
},
|
||||
"ended": {
|
||||
"type": "string",
|
||||
"description": "when the resolver's own file stood again, RFC 3339"
|
||||
},
|
||||
"how": {
|
||||
"type": "string",
|
||||
"description": "how it ended"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
"format": 1,
|
||||
"seat": "node-uplink",
|
||||
"scope": "node",
|
||||
"grain": "seat-list",
|
||||
"grain": "whole",
|
||||
"domain": "Connectivity",
|
||||
"decision": "novox/hq ADR 0117",
|
||||
"decision": "novox/hq ADR 0117, ADR 0687, ADR 0689",
|
||||
"description": "The node seat of the machine's uplink (ADR 0117), as ADR 0687 §1 and ADR 0689 change it: the resolver file as it is now and every network link, read by resolvers and links; and the mesh's record of a network's sign-in page, the events sign-in-asked and sign-in-ended, published by the holder on its own machine without the bus and kept in the family node-uplink.events, 7 days. Both events are optional for a holder, and nothing in the mesh consumes them.",
|
||||
"verbs": [
|
||||
{
|
||||
"name": "resolvers",
|
||||
@@ -13,6 +14,78 @@
|
||||
"input": {
|
||||
"properties": {},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"path",
|
||||
"nameservers",
|
||||
"written_by_the_mesh",
|
||||
"changed"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "the resolver file's path"
|
||||
},
|
||||
"link": {
|
||||
"type": "string",
|
||||
"description": "where the file is a link, its target"
|
||||
},
|
||||
"nameservers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "the file's search domains"
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"header": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "the file's leading comment lines, up to four"
|
||||
},
|
||||
"written_by_the_mesh": {
|
||||
"type": "boolean",
|
||||
"description": "the file is the one the uplink holder declares, by its header"
|
||||
},
|
||||
"changed": {
|
||||
"type": "string",
|
||||
"description": "when the file last changed, RFC 3339"
|
||||
},
|
||||
"owner": {
|
||||
"type": "string",
|
||||
"description": "the account that owns the file"
|
||||
},
|
||||
"writer": {
|
||||
"type": "string",
|
||||
"description": "who wrote it when the mesh did not, as far as the machine shows"
|
||||
},
|
||||
"why": {
|
||||
"type": "string",
|
||||
"description": "why writer is named so"
|
||||
},
|
||||
"beside": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/defs/BesideFile"
|
||||
},
|
||||
"description": "every file next to it whose name starts with its own: a backup a writer kept"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -22,13 +95,215 @@
|
||||
"input": {
|
||||
"properties": {},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"links"
|
||||
],
|
||||
"properties": {
|
||||
"links": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/defs/Link"
|
||||
}
|
||||
},
|
||||
"dns_not_read": {
|
||||
"type": "string",
|
||||
"description": "the network manager could not be asked for links' names, said rather than read as no resolvers"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"name": "sign-in-asked",
|
||||
"subject": "sign-in-asked.<node>",
|
||||
"body": {
|
||||
"$ref": "#/defs/SignInAsked"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sign-in-ended",
|
||||
"subject": "sign-in-ended.<node>",
|
||||
"body": {
|
||||
"$ref": "#/defs/SignInEnded"
|
||||
}
|
||||
}
|
||||
],
|
||||
"family": {
|
||||
"name": "node-uplink.events",
|
||||
"max-age-days": 7
|
||||
},
|
||||
"paths": [
|
||||
{
|
||||
"path": "/etc/resolv.conf",
|
||||
"steps-back-for": "node-resolver"
|
||||
}
|
||||
]
|
||||
],
|
||||
"defs": {
|
||||
"BesideFile": {
|
||||
"type": "object",
|
||||
"description": "one file beside the resolver file",
|
||||
"required": [
|
||||
"path",
|
||||
"changed"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"changed": {
|
||||
"type": "string",
|
||||
"description": "RFC 3339"
|
||||
},
|
||||
"mesh": {
|
||||
"type": "boolean",
|
||||
"description": "it begins as the mesh's own file does: the file a writer moved aside"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Link": {
|
||||
"type": "object",
|
||||
"description": "one network link, as the links verb says it",
|
||||
"required": [
|
||||
"name",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string"
|
||||
},
|
||||
"addresses": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"mac": {
|
||||
"type": "string",
|
||||
"description": "the link-layer address as ip says it; left out where the link has none"
|
||||
},
|
||||
"master": {
|
||||
"type": "string",
|
||||
"description": "the bridge or bond the link is enslaved to"
|
||||
},
|
||||
"parent": {
|
||||
"description": "the link it rides on: its name where that link is in this machine's namespace, else its index and namespace id; left out where none"
|
||||
},
|
||||
"default_route": {
|
||||
"type": "boolean",
|
||||
"description": "the default route leaves through it"
|
||||
},
|
||||
"metric": {
|
||||
"type": "integer",
|
||||
"description": "that route's metric"
|
||||
},
|
||||
"dns": {
|
||||
"$ref": "#/defs/LinkDNS"
|
||||
}
|
||||
}
|
||||
},
|
||||
"LinkDNS": {
|
||||
"type": "object",
|
||||
"description": "what the network manager knows of one link's names",
|
||||
"properties": {
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"domains": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"manager": {
|
||||
"type": "string",
|
||||
"description": "the program that said so"
|
||||
},
|
||||
"state": {
|
||||
"type": "string",
|
||||
"description": "its word for the link"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SignInAsked": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"node",
|
||||
"link",
|
||||
"network",
|
||||
"address",
|
||||
"at"
|
||||
],
|
||||
"properties": {
|
||||
"node": {
|
||||
"type": "string",
|
||||
"description": "the node's name"
|
||||
},
|
||||
"link": {
|
||||
"type": "string",
|
||||
"description": "the interface name of the link the default route leaves through"
|
||||
},
|
||||
"network": {
|
||||
"type": "string",
|
||||
"description": "the network's name as the network manager knows it, its connection's name"
|
||||
},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"description": "an http or https address, the one opened"
|
||||
},
|
||||
"at": {
|
||||
"type": "string",
|
||||
"description": "the time of the change it says, never of its publish, RFC 3339 in UTC to the second"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SignInEnded": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"node",
|
||||
"link",
|
||||
"network",
|
||||
"at",
|
||||
"why"
|
||||
],
|
||||
"properties": {
|
||||
"node": {
|
||||
"type": "string",
|
||||
"description": "the node's name"
|
||||
},
|
||||
"link": {
|
||||
"type": "string",
|
||||
"description": "empty only for a no-longer-asked said with no connection active"
|
||||
},
|
||||
"network": {
|
||||
"type": "string",
|
||||
"description": "empty only for a no-longer-asked said with no connection active"
|
||||
},
|
||||
"at": {
|
||||
"type": "string",
|
||||
"description": "the time of the change it says, never of its publish, RFC 3339 in UTC to the second"
|
||||
},
|
||||
"why": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"signed-in",
|
||||
"left",
|
||||
"no-longer-asked"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user