@serve.zone/interfaces 32.91.0 → 32.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +14 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/gatewayarearows.d.ts +379 -0
- package/dist_ts/data/gatewayarearows.js +347 -0
- package/dist_ts/data/gatewayareas.d.ts +24 -0
- package/dist_ts/data/gatewayareas.js +41 -1
- package/dist_ts/data/gatewayareas.validation.d.ts +11 -3
- package/dist_ts/data/gatewayareas.validation.js +41 -58
- package/dist_ts/data/gatewayconnector.d.ts +7 -1
- package/dist_ts/data/gatewayconnector.js +1 -1
- package/dist_ts/data/gatewayintent.d.ts +71 -12
- package/dist_ts/data/gatewayintent.js +35 -12
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/requests/gatewayconnector.d.ts +125 -1
- package/package.json +1 -1
- package/readme.md +82 -6
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/gatewayarearows.ts +688 -0
- package/ts/data/gatewayareas.ts +55 -0
- package/ts/data/gatewayareas.validation.ts +43 -59
- package/ts/data/gatewayconnector.ts +7 -1
- package/ts/data/gatewayintent.ts +95 -15
- package/ts/data/index.ts +1 -0
- package/ts/requests/gatewayconnector.ts +151 -1
package/readme.md
CHANGED
|
@@ -4530,24 +4530,100 @@ guard that names roles excludes it by type.
|
|
|
4530
4530
|
`data.TGatewayDryRunReport`: `{ ok: true, passes, dryRun }` with a `data.IGatewayIntentDryRun` (per
|
|
4531
4531
|
area `data.IGatewayAreaDryRun`: whether the tables validate, the exported and compiled digests, the
|
|
4532
4532
|
row ids that differ as `data.IGatewayAreaRowDiff`, unclaimed client rows and held records; the
|
|
4533
|
-
`data.TGatewayLifeline`; the
|
|
4533
|
+
`data.TGatewayLifeline`; `exportedRoutesServeControllerOrigin`, whether the routes table the gateway
|
|
4534
|
+
exports now serves the controller's public origin by the controller's own predicate (`true`,
|
|
4535
|
+
`false`, or `null` when no predicate can judge or no single routes table was exported; `lifeline`
|
|
4536
|
+
answers `unchanged` for equal tables without asking, so only this member tells a guarded origin
|
|
4537
|
+
from an unguarded one); the refusals; and `mailIdentities`, one
|
|
4534
4538
|
`data.IGatewayMailIdentityPasswordReport` `{ key, serviceId, password }` per mail identity the
|
|
4535
4539
|
compile claims, ascending by key, whose `password` is one of
|
|
4536
4540
|
`data.gatewayMailIdentityPasswordStates`: the password Cloudly holds `verifies` against the
|
|
4537
4541
|
verifier the compiled row carries, `does-not-verify`, or is `absent`), or `{ ok: false, code }`
|
|
4538
4542
|
with a `data.TGatewayDryRunRefusal` (one of `data.gatewayIntentRefusals`,
|
|
4539
|
-
`controller-gateway-disconnected`, or a momentary connector refusal). The
|
|
4540
|
-
required and
|
|
4543
|
+
`controller-gateway-disconnected`, or a momentary connector refusal). The origin member and the
|
|
4544
|
+
mail identity report are required and are reports only: no refusal and no pass criterion reads
|
|
4545
|
+
them. Both read only and carry
|
|
4541
4546
|
row ids, digests, names and states, never a table value, a password or a verifier, and neither has
|
|
4542
4547
|
a validator: a reader shows a refusal name it does not know as text and never refuses the answer.
|
|
4543
|
-
`data.gatewayIntentRefusals` is the controller's whole vocabulary
|
|
4544
|
-
|
|
4548
|
+
`data.gatewayIntentRefusals` is the controller's whole vocabulary; the requests declared here
|
|
4549
|
+
cover it between them (dry run, takeover, operator row read and write).
|
|
4550
|
+
- Takeover (`ts/data/gatewayintent.ts`, `requests.gatewayconnector.IReq_Admin_Cloudly_TakeOverGateway`):
|
|
4551
|
+
`takeOverGateway` takes `{ identity, gatewayId, exportDigests }`, where `exportDigests` lists one
|
|
4552
|
+
`data.IGatewayTakeoverExportDigest` `{ area, digest }` per configuration area, each the
|
|
4553
|
+
`exportDigest` of the dry run the administrator read; the controller matches them by `area`, so
|
|
4554
|
+
their order is free. The controller reads the tables the gateway exports now, refuses
|
|
4555
|
+
`takeover-exports-moved` when the list does not hold exactly one entry per area (one missing or
|
|
4556
|
+
one twice) or when a table differs from its named digest, makes the dry run again and refuses
|
|
4557
|
+
unless it passes, then imports
|
|
4558
|
+
the tables byte for byte as one `import` revision and pushes them; only the owner of each area
|
|
4559
|
+
changes. It answers a `data.TGatewayTakeoverReport`: `{ ok: true, takeover }` with a
|
|
4560
|
+
`data.IGatewayTakeover` (the `import` revision and per area a `data.IGatewayTakeoverArea`: digest,
|
|
4561
|
+
rows, claimed rows), or `{ ok: false, code }` with a `data.TGatewayTakeoverRefusal` (one of
|
|
4562
|
+
`data.gatewayIntentRefusals`, `controller-gateway-disconnected`, or a momentary connector refusal).
|
|
4563
|
+
A gateway is taken over once: a repeated request, after a lost answer too, answers
|
|
4564
|
+
`{ ok: false, code: 'gateway-taken-over' }` and writes nothing, and `getGatewayTakeoverState`
|
|
4565
|
+
answers who took it over and when. Only a malformed `exportDigests` (not a list, or an entry that
|
|
4566
|
+
is not exactly `{ area, digest }` with a configuration area and a `sha256:` digest) is refused as
|
|
4567
|
+
the thrown connector refusal `request-invalid` (`data.IGatewayConnectorRefusalErrorData`), never
|
|
4568
|
+
as `{ ok: false }`. The report carries digests, counts and names, never a table value, and has no
|
|
4569
|
+
validator. Who may call it is the controller's decision.
|
|
4570
|
+
- Desired-state export (`requests.gatewayconnector.IReq_Admin_Cloudly_ExportGatewayDesiredState`):
|
|
4571
|
+
`exportGatewayDesiredState` takes `{ identity, gatewayId }` and answers `{ desired }`, the
|
|
4572
|
+
`data.IGatewayDesiredState` the controller pushes the gateway now, as
|
|
4573
|
+
`data.validateGatewayDesiredState` accepts it (no area for a gateway that was not taken over): the
|
|
4574
|
+
document an operator carries to the gateway's host control socket
|
|
4575
|
+
(`dcrouter apply-desired-state --file`) when no session carries it. It reads only and calls no
|
|
4576
|
+
gateway, so it answers while the gateway is unreachable; a gateway the controller does not record
|
|
4577
|
+
is refused as a thrown connector refusal `gateway-not-found`. The document carries the tables'
|
|
4578
|
+
values, secrets included, in plain text: keep its bodies out of every log and state only its tuple
|
|
4579
|
+
(gateway, controller, epoch, revision, per-area digests). Who may call it is the controller's
|
|
4580
|
+
decision.
|
|
4545
4581
|
- Validators name every refusal and never run an accessor: `data.validateControllerPeerSet`,
|
|
4546
4582
|
`data.validateControllerRevision`, `data.validateGateway`, `data.validateGatewayAdoptionFacts`,
|
|
4547
4583
|
`data.validateAdoptGatewayResponse`, `data.validateRegisterGatewaySessionRequest`,
|
|
4548
4584
|
`data.validateGatewayDesiredState` (envelope only), `data.validateGatewayApplyReport`,
|
|
4549
4585
|
`data.validateGatewayStatusDocument`, `data.validateGatewayAreaExport`,
|
|
4550
|
-
`data.validateGatewayRouteDnsResultsRequest
|
|
4586
|
+
`data.validateGatewayRouteDnsResultsRequest`, `data.validateGatewayRouteDnsResultsResponse` and
|
|
4587
|
+
`data.validateGatewayAreaRowWrite`.
|
|
4588
|
+
- Operator rows (`ts/data/gatewayarearows.ts`, `requests.gatewayconnector`; Linus rulings 117 §4
|
|
4589
|
+
criterion 4, 121 §6 item 7, 166 points 2 and 4, 171): once a gateway is taken over, an
|
|
4590
|
+
administrator changes its tables one row at a time through the controller. A row is addressed
|
|
4591
|
+
`{ area, member, id }` (`id: null` for a singleton of `data.gatewayAreaSingletonMembers`).
|
|
4592
|
+
`getGatewayAreaRows` (`IReq_Admin_Cloudly_GetGatewayAreaRows`, `{ identity, gatewayId, area,
|
|
4593
|
+
member }`) answers a `data.TGatewayAreaRowsReport`: the table's revision and digest and, per row,
|
|
4594
|
+
its compare token `digest`, its `owner` (`compile` for a row the controller's records compile,
|
|
4595
|
+
which no operator write changes) and its write form (`data.IGatewayAreaRowWrites`), in which every
|
|
4596
|
+
secret of `data.gatewayAreaSecretPaths` is `{ kind: 'keep', version }` (sealed) or
|
|
4597
|
+
`{ kind: 'keep' }` (verifier), never a value; or `{ ok: false, code }` with one of
|
|
4598
|
+
`data.gatewayAreaRowsRefusals`. `writeGatewayAreaRow` (`IReq_Admin_Cloudly_WriteGatewayAreaRow`,
|
|
4599
|
+
`{ identity, gatewayId, write }`) puts one row or one singleton's value, or deletes one list row
|
|
4600
|
+
(`data.TGatewayAreaRowWrite`), based on the digest the administrator read (`expectedDigest`,
|
|
4601
|
+
`null` for a row that must be absent); a new secret is `{ kind: 'set', value }` and the controller
|
|
4602
|
+
mints its version, a new verifier `{ kind: 'set', verifier }`. It answers a
|
|
4603
|
+
`data.TGatewayAreaRowWriteReport`: the revision, the row's and the table's digest and the minted
|
|
4604
|
+
versions, or `{ ok: false, code, problems }` with one of `data.gatewayAreaRowWriteRefusals` and
|
|
4605
|
+
validator lines that never carry a value. `intent-row-stale` means the row moved since the read
|
|
4606
|
+
(read it again); `kept-secret-unknown` means the written row keeps a secret the row does not hold,
|
|
4607
|
+
because a moved row answers `intent-row-stale` first (fix the row, do not re-read). A put equal to
|
|
4608
|
+
the stored row and a delete of an absent row write nothing (`revision: null`). The write never
|
|
4609
|
+
waits for the gateway: `getGateways` tells when it applied the revision.
|
|
4610
|
+
- Caller, both requests: a human administrator who signed in within the last five minutes, with
|
|
4611
|
+
neither a delegated admin temp token nor a machine identity. The controller refuses anyone else
|
|
4612
|
+
with an error naming the requirement before it reads anything, and judges the write's caller
|
|
4613
|
+
again inside its transaction. No delegated admin scope names either request. The read takes
|
|
4614
|
+
the write's caller because it answers the whole table but the sealed values and the table
|
|
4615
|
+
digest, which hashes those values: only a caller entitled to the plaintext may hold both.
|
|
4616
|
+
- Compare token: `data.computeGatewayAreaRowDigest` of the stored row
|
|
4617
|
+
(`data.createGatewayAreaRowDigestInput`), which takes every sealed member by its version only and
|
|
4618
|
+
a verifier as stored. A version names one value, so the token moves with every change, and a
|
|
4619
|
+
reader who holds every other input cannot test a guess at a sealed value against it. A reader
|
|
4620
|
+
compares it for equality only.
|
|
4621
|
+
- One check, one list: `data.validateGatewayAreaRowWrite` judges a write's envelope and secret
|
|
4622
|
+
forms (the controller before it reads, a client before it signs in; the controller answers a
|
|
4623
|
+
problem as the connector refusal `request-invalid`), and `data.gatewayAreaSecretPaths` is the one
|
|
4624
|
+
list of where a table holds a secret, from which `data.listGatewayAreaSecrets` is computed and
|
|
4625
|
+
which `data.projectGatewayAreaRow` and `data.resolveGatewayAreaRowWrite` walk. The controller
|
|
4626
|
+
mints versions with `data.createGatewaySealedVersion`.
|
|
4551
4627
|
|
|
4552
4628
|
```typescript
|
|
4553
4629
|
import { data, requests } from '@serve.zone/interfaces';
|