@serve.zone/interfaces 32.88.0 → 32.90.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.
Files changed (43) hide show
  1. package/changelog.md +22 -0
  2. package/dist_ts/00_commitinfo_data.js +1 -1
  3. package/dist_ts/data/cloudaccess.d.ts +402 -0
  4. package/dist_ts/data/cloudaccess.js +685 -0
  5. package/dist_ts/data/cloudlyconfig.d.ts +20 -0
  6. package/dist_ts/data/cloudlyconfig.js +21 -1
  7. package/dist_ts/data/gatewayareas.d.ts +120 -22
  8. package/dist_ts/data/gatewayareas.js +36 -1
  9. package/dist_ts/data/gatewayareas.validation.js +203 -42
  10. package/dist_ts/data/gatewayconnector.d.ts +2 -2
  11. package/dist_ts/data/gatewayconnector.js +20 -1
  12. package/dist_ts/data/gatewayintent.d.ts +181 -0
  13. package/dist_ts/data/gatewayintent.js +67 -0
  14. package/dist_ts/data/index.d.ts +2 -0
  15. package/dist_ts/data/index.js +3 -1
  16. package/dist_ts/data/mail.d.ts +6 -1
  17. package/dist_ts/data/mail.js +1 -1
  18. package/dist_ts/data/witness.js +4 -9
  19. package/dist_ts/private/bearerencoding.d.ts +9 -0
  20. package/dist_ts/private/bearerencoding.js +17 -0
  21. package/dist_ts/private/storagecontract.js +3 -3
  22. package/dist_ts/requests/cloudaccess.d.ts +125 -0
  23. package/dist_ts/requests/cloudaccess.js +2 -0
  24. package/dist_ts/requests/gatewayconnector.d.ts +33 -1
  25. package/dist_ts/requests/index.d.ts +2 -1
  26. package/dist_ts/requests/index.js +3 -2
  27. package/package.json +1 -1
  28. package/readme.md +155 -11
  29. package/ts/00_commitinfo_data.ts +1 -1
  30. package/ts/data/cloudaccess.ts +1133 -0
  31. package/ts/data/cloudlyconfig.ts +27 -0
  32. package/ts/data/gatewayareas.ts +88 -22
  33. package/ts/data/gatewayareas.validation.ts +225 -40
  34. package/ts/data/gatewayconnector.ts +19 -0
  35. package/ts/data/gatewayintent.ts +239 -0
  36. package/ts/data/index.ts +2 -0
  37. package/ts/data/mail.ts +6 -1
  38. package/ts/data/witness.ts +3 -10
  39. package/ts/private/bearerencoding.ts +24 -0
  40. package/ts/private/storagecontract.ts +2 -2
  41. package/ts/requests/cloudaccess.ts +201 -0
  42. package/ts/requests/gatewayconnector.ts +41 -1
  43. package/ts/requests/index.ts +2 -0
package/changelog.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-11-14 - 32.90.0
4
+
5
+ ### Features
6
+
7
+ - The dry run reports its mail identities (Linus ruling 145, point 1): `data.IGatewayIntentDryRun` gains the required member `mailIdentities`, a `data.IGatewayMailIdentityPasswordReport[]` with one `{ key, serviceId, password }` per mail identity the compile claims, ascending by `key` (the identity's client key, its row's `client.externalKey`). `password` is a `data.TGatewayMailIdentityPasswordState`, a value of the new frozen list `data.gatewayMailIdentityPasswordStates` (`verifies`, `does-not-verify`, `absent`): whether the password Cloudly holds for the identity derives to the verifier the compiled row carries, or Cloudly holds none. The report carries no password and no verifier, and it is a report, never a gate: no refusal and no pass criterion reads it. Who must change: Cloudly, the only producer of a dry run, states the member in every dry run it answers and deletes its own declaration of the report when it pins this release; anything else that constructs a `data.IGatewayIntentDryRun` (a fixture, a stand-in) no longer compiles without the member. `getGatewayDryRun` has no validator, so no reader refuses an answer over the member: a reader built before this release ignores it, and a reader built on this release that asks a Cloudly answering none reads `undefined` where the type states a list, so a reader that uses the member moves with or after Cloudly. Spec: `test.gatewayconnector`.
8
+ - Gateway `routes` area, the lifted-secret presence rule (a table-alone rule the gateway still kept as its `validateLiftedPresence`; Linus ruling 125): `data.validateGatewayAreaContent` and `data.validateGatewayAreaTables` now refuse a `security.basicAuth` or `security.jwtAuth` that is present without its lifted secret in any spelling, in a route (`route.security`) and in a source profile (`security`). Beside a `null` `secrets.basicAuthUsers` or `secrets.jwtSecret` the member is absent; beside a set one it is an object, as before. The refusal is `secret-engine-mismatch` at the secret's path (`secrets.basicAuthUsers`, `secrets.jwtSecret`) and names the row, never the member's value. A table 32.87.0 to 32.89.0 accepted with `basicAuth: null`, `jwtAuth: null` or another member that is no object (a text, a number, a boolean, a list) beside a `null` secret is refused. `action.tls.certificate` beside `secrets.tlsKey` keeps its rule (an object exactly with its key), because it has a spelling without a key (`'auto'`), and the mail server's `tlsKey` rule is unchanged. The rule takes and refuses exactly what the gateway's does, so a gateway that pins this release drops its copy; a gateway on an earlier release still judges it itself, as its `invalid-table`. Spec: `test.gatewayareas` (the gateway's failing tables, and every spelling of both members beside a `null` and a set secret compared with a copy of the gateway's rule).
9
+
10
+ ### Documentation
11
+
12
+ - `data.IServiceMailOutboundConfig.credentialId` (Linus ruling 145, point 4), doc only: after a takeover the outbound credential has no id of its own; its public name is the SMTP username, which `credentialId` and `username` both state. The earlier text called the member the gateway's credential id and username at once, which nobody confirmed to be one value. No shape changes.
13
+
14
+ ## 2026-11-14 - 32.89.0
15
+
16
+ ### Features
17
+
18
+ - Gateway `dns` area, table-alone rules (Linus rulings 125 and 129; a gateway keeps only rules that need its own state): `data.validateGatewayAreaTables` now refuses a `records[].name` or `staticRecords[].name` outside the record name form (at most 253 characters, every label a lowercase zone label of letters, digits, `_` and inner `-`, no trailing dot; the leftmost label may instead be exactly `*` with a label after it), as `invalid-value` at `name`, never repaired; a record value that is not the one spelling of its type, the one the gateway's record value owner emits (`CNAME`/`NS` one lowercase name without a trailing dot, labels of at most 63 octets and 253 in all; `MX` `<preference 0-65535> <exchange>` with one space, `0 .` for a null MX; `SOA` two names and five numbers 0 to 4294967295 with one space between each; numbers without a leading zero; `CAA` a text without whitespace around it; `TXT` the text itself; `A` and `AAAA` the canonical address text, see below), as `invalid-value` at `value`; a protected hostname `reason` with whitespace around it; and an authority zone that is a single label or carries a `_` label, as `invalid-row-id`. An `A` or `AAAA` value is narrowed to one spelling per address (Linus ruling 143 B): the canonical address text of its family, a dotted quad without leading zeros or the RFC 5952 text (lowercase hex groups without leading zeros, the longest run of two or more zero groups written `::`, the first run on a tie). 32.87.0 and 32.88.0 accepted every form the gateway's DNS encoder takes, so `203.0.113.07`, `2001:DB8::1`, `2001:db8:0:0:0:0:0:1`, `2001:0db8::1` and `1:2:3:4:5:6:7::8` passed there and are refused now, as `invalid-value` at `value`; the rule is spelling only, so any address of the family (unspecified and multicast included) stays a value. A table 32.87.0 or 32.88.0 accepted with such a row is refused; a controller sends, and a gateway exports, the canonical spelling (a gateway's exporter respells a stored address rather than exporting it as stored). Spec: `test.gatewayareas` (the verdict on every record value and authority zone of its corpus equals the gateway's own rule; every canonical address text passes, and is a form the gateway's encoder takes).
19
+ - Gateway `edges` area, table-alone rules: the new `data.gatewayEdgeSettingBounds` holds the ranges a gateway's remote ingress engine takes, and the validator refuses outside them: each integer of `IGatewayEdgePerformance` in its range (1 to its maximum; `maxHalfClosedStreams` from 0), `minStreamWindowBytes` and `sustainedStreamWindowBytes` above a stated `maxStreamWindowBytes`, `serverFirstPorts` beyond 128 ports (`bound-exceeded`) or naming 443, an enabled egress whose `allowedPorts` is not exactly `[25]` (`egressAllowedPorts`, Linus ruling 129 Q3), `deniedCidrs` or `allowedHostPatterns` beyond 128 entries (`bound-exceeded`) or with whitespace around an entry, `maxConcurrentStreams` outside 1 to 100,000, a `hubDomain` with whitespace around it, a `publicIp` or `publicIpv6` that is not one canonical address literal of its family (a dotted quad without leading zeros, RFC 5952 text), and a `mailHostname` that is not a lowercase fully qualified name without a trailing dot. An integer outside its range answers `invalid-value`; only a list beyond its length answers `bound-exceeded`. A table 32.87.0 or 32.88.0 accepted with such a setting is refused. Spec: `test.gatewayareas`.
20
+ - Gateway `mail` area, table-alone rules for the server settings: while `enabled`, `emailConfig` names a non-blank `hostname` (`emailConfig.hostname`) and a non-empty `ports` list of ports 1 to 65535 (`emailConfig.ports`), and `tlsSource: 'configuredMaterial'` is refused at `tlsSource` without material in the table (`tlsKey`, or `emailConfig.tls.certPem`). A table 32.87.0 or 32.88.0 accepted without them is refused. Spec: `test.gatewayareas`.
21
+ - Gateway takeover reads move into the contract (`ts/data/gatewayintent.ts`), as the controller declares them: `data.IGatewayTakeoverState`, `data.TGatewayDryRunReport` and `data.TGatewayDryRunRefusal` with the shapes they name (`data.IGatewayIntentDryRun`, `data.IGatewayAreaDryRun`, `data.IGatewayAreaRowDiff`, `data.IGatewayCompileHeld`, `data.TGatewayCompileRecordKind`, `data.TGatewayCompileHeldMember`, `data.TGatewayLifeline`) and the refusal vocabulary `data.gatewayIntentRefusals` (`data.TGatewayIntentRefusal`); the requests are `requests.gatewayconnector.IReq_Admin_Cloudly_GetGatewayTakeoverState` (`getGatewayTakeoverState`) and `requests.gatewayconnector.IReq_Admin_Cloudly_GetGatewayDryRun` (`getGatewayDryRun`). A held record names the table member that holds it (Linus ruling 144 Q6): `data.IGatewayCompileHeld.member` is `routes`, `clientHostnames`, `identities` or `coreMailPeers`, one entry per record and member, computed by the compile and never stored. Both read only and carry ids, digests and names, never a table value; no validator is added, and a reader shows a refusal name it does not know as text and never refuses the answer. The list is the controller's whole vocabulary: the two reads name `gateway-not-found`, `area-contract-missing`, `export-missing`, `area-table-invalid`, `controller-origin-unserved`, `lifeline-unjudged` and `compiled-table-invalid`, and the other names are answered only by controller operations this package declares no request for. Spec: `test.gatewayconnector`.
22
+ - Two connector refusal names: `data.gatewayConnectorRefusals` gains `area-controller-owned`, a verdict a gateway answers to a local write (an operator's or a gateway client's, on any of its calls) to an area its controller owns, with the area in the error text; and `route-dns-unavailable`, a second member of `data.gatewayConnectorMomentaryRefusals` (`retryable: true`), which a gateway answers to `getGatewayRouteDnsResults` while it runs no route DNS reconciler: it refuses the whole read, and one hostname's condition stays in its result row. The error data of both stays `{ code, retryable }`. A reader before this release reads either as a failure without a named refusal. Spec: `test.gatewayconnector`.
23
+ - The cloud access contract (AGL-1181, Linus ruling 141 C3, C5, C6, C7 and C9, amendment 141a): `requests.cloudaccess` declares Cloudly's calls `enrollCloudAccessBinding`, `getCloudAccessEnrollmentState`, `confirmCloudAccessEnrollment`, `rejectCloudAccessEnrollment`, `authenticateCloudAccessBinding`, `registerCloudAccessSession`, `reportCloudAccessStatus`, `getCloudAccessBindingState` and `disconnectCloudAccessBinding`, and cloud access's one call back, `openCloudAccessStream` (`requests.cloudaccess.IReq_CloudAccess_Cloudly_OpenCloudAccessStream`), which carries `{ streamId, token, clientAddress }` and no target. `data` holds the shapes (`data.IEnrollCloudAccessBindingRequest` and `data.IRegisterCloudAccessSessionRequest`, both stating `interfacesVersion`, `data.IRegisterCloudAccessSessionResponse`, `data.ICloudAccessEnrollment`, `data.ICloudAccessEnrollmentState` with `data.ICloudAccessPendingClaim`, `data.IAuthenticateCloudAccessBindingRequest`, `data.ICloudAccessReport`, `data.ICloudAccessBindingState` with its `txt`, `address` and `caa` checks and the records to publish, `data.IGetCloudAccessBindingStateRequest`, `data.IOpenCloudAccessStreamRequest`), the bounds `data.cloudAccessContract` (a report at most 256 KiB as the UTF-8 of its JSON, `data.measureCloudAccessReportBytes`; at most 200 attention items with text of at most 500 characters and 1,000 people; each version's `(product, running)` once; every string bounded), exact validators for every body and answer (`data.validateCloudAccessPublicOrigin`: `https` on port 443, no path, a DNS name outside `serve.zone`), the pairing code's display form (`data.isCloudAccessPairingCode`, 8 Crockford base32 symbols as `XXXX-XXXX`), the closed refusal vocabulary `data.cloudAccessRefusals` with its momentary subset `data.cloudAccessMomentaryRefusals` (`data.createCloudAccessRefusalErrorData`, `data.readCloudAccessRefusalErrorData`) and the tunnel preamble constants `data.cloudAccessTunnelPreamble` (the 13-byte tag `szca-tunnel-1`, a 32-byte token). The host contract gains its extras vocabulary beside its environment lists, `data.cloudlyHostExtras` (`relayIngress`; `data.TCloudlyHostExtra`, `data.isCloudlyHostExtra`); no carrier advertises an extra yet, and the environment lists are unchanged. Everything is additive. Spec: `test.cloudaccess`, `test.cloudlyhostcontract`, `test.typedrequest-methods`.
24
+
3
25
  ## 2026-11-14 - 32.88.0
4
26
 
5
27
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '32.88.0',
6
+ version: '32.90.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFNBQVM7SUFDbEIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -0,0 +1,402 @@
1
+ export declare const cloudAccessContract: Readonly<{
2
+ /** A `bindingId` or a `streamId` is the lowercase hex of this many random bytes: 32 characters. */
3
+ readonly randomIdBytes: 16;
4
+ /** The controller's bearer is base64url, unpadded, of this many random bytes: 43 characters. */
5
+ readonly bearerRandomBytes: 32;
6
+ /** A pairing code is this many Crockford base32 symbols, 40 bits, shown as `XXXX-XXXX`. */
7
+ readonly pairingCodeSymbols: 8;
8
+ /** How long an enrollment and its pairing code live, in milliseconds: 10 minutes. */
9
+ readonly pairingCodeLifetimeMs: 600000;
10
+ /** Cloudly reports this often, in milliseconds. */
11
+ readonly reportIntervalMs: 30000;
12
+ /** Cloud access refuses a report sooner than this after the binding's last accepted one. */
13
+ readonly minimumReportIntervalMs: 10000;
14
+ /**
15
+ * The largest report: the UTF-8 bytes of its JSON (`measureCloudAccessReportBytes`), 256 KiB. A
16
+ * peer's message cap sits at least 64 KiB above it, so a report one byte above the bound arrives
17
+ * and is answered `report-too-large` rather than cut off with the socket.
18
+ */
19
+ readonly maximumReportBytes: 262144;
20
+ readonly maximumAttentionItems: 200;
21
+ readonly maximumAttentionTextLength: 500;
22
+ readonly maximumPeople: 1000;
23
+ readonly maximumLocations: 256;
24
+ readonly maximumVersions: 32;
25
+ /** A DNS name: a `publicOrigin` host, a record name. */
26
+ readonly maximumHostnameLength: 253;
27
+ /** A display name: an organization, a person, an attention item's object. */
28
+ readonly maximumNameLength: 256;
29
+ /** An email address (RFC 5321). */
30
+ readonly maximumEmailLength: 254;
31
+ /** An OpenID Connect subject (OpenID Connect Core 1.0, section 2: at most 255 ASCII characters). */
32
+ readonly maximumSubjectLength: 255;
33
+ /** An idp.global organization id. */
34
+ readonly maximumOrganizationIdLength: 256;
35
+ /** A product name in `ICloudAccessReportVersion`. */
36
+ readonly maximumProductLength: 64;
37
+ /** The text of one name check in `ICloudAccessNameCheck.detail`. */
38
+ readonly maximumCheckDetailLength: 500;
39
+ readonly maximumDnsRecords: 8;
40
+ readonly maximumDnsRecordValueLength: 512;
41
+ /** A stream token is this many random bytes, sent in `openCloudAccessStream` as unpadded base64url. */
42
+ readonly streamTokenBytes: 32;
43
+ /** A stream token is used once, within this many milliseconds of its `openCloudAccessStream`. */
44
+ readonly streamTokenLifetimeMs: 10000;
45
+ }>;
46
+ export declare const cloudAccessTunnelPreamble: Readonly<{
47
+ readonly tag: "szca-tunnel-1";
48
+ readonly tokenBytes: 32;
49
+ readonly byteLength: number;
50
+ }>;
51
+ /**
52
+ * Every reason cloud access, or Cloudly for `openCloudAccessStream`, answers instead of a request,
53
+ * as a `TypedResponseError` whose `errorData` is `ICloudAccessRefusalErrorData` and whose text
54
+ * carries the detail, never a bearer, a pairing code or a stream token. The list is a vocabulary,
55
+ * not the order a request is checked in; each request's doc (`requests.cloudaccess`) names the
56
+ * refusals it answers. What cloud access answers a person on its own pages (a code entry, Open)
57
+ * belongs to its own API, which stays in the cloudaccess repository.
58
+ */
59
+ export declare const cloudAccessRefusals: readonly ["request-invalid", "rate-limited", "enrollment-gone", "not-claimed", "handshake-incomplete", "binding-gone", "not-confirmed", "report-too-soon", "report-too-large", "not-active", "epoch-conflict", "stream-limit", "cloud-access-unavailable"];
60
+ /** One of the reasons cloud access or Cloudly answers instead of a request. */
61
+ export type TCloudAccessRefusal = typeof cloudAccessRefusals[number];
62
+ /** The refusals that describe the refusing side's own momentary state rather than a judgement. */
63
+ export declare const cloudAccessMomentaryRefusals: readonly ["rate-limited", "report-too-soon", "stream-limit", "cloud-access-unavailable"];
64
+ /** One of the momentary cloud access refusals. */
65
+ export type TCloudAccessMomentaryRefusal = typeof cloudAccessMomentaryRefusals[number];
66
+ /** A cloud access refusal as `TypedResponseError.errorData`; the error text carries its detail. */
67
+ export interface ICloudAccessRefusalErrorData {
68
+ code: TCloudAccessRefusal;
69
+ /**
70
+ * True exactly for `cloudAccessMomentaryRefusals`: the same request may be sent again later.
71
+ * Every other refusal answers the same request again until the state the code names changed.
72
+ */
73
+ retryable: boolean;
74
+ }
75
+ /** True for one of `cloudAccessRefusals`. */
76
+ export declare const isCloudAccessRefusal: (valueArg: unknown) => valueArg is TCloudAccessRefusal;
77
+ /** True for one of `cloudAccessMomentaryRefusals`. */
78
+ export declare const isCloudAccessMomentaryRefusal: (valueArg: unknown) => valueArg is TCloudAccessMomentaryRefusal;
79
+ /** The `errorData` a cloud access refusal is answered with. */
80
+ export declare const createCloudAccessRefusalErrorData: (codeArg: TCloudAccessRefusal) => ICloudAccessRefusalErrorData;
81
+ /**
82
+ * The cloud access refusal an error payload states, or `null` when it is not exactly one: a payload
83
+ * with another member, an unknown code or a `retryable` that disagrees with the code reads as no
84
+ * answer, never as a verdict.
85
+ */
86
+ export declare const readCloudAccessRefusalErrorData: (valueArg: unknown) => ICloudAccessRefusalErrorData | null;
87
+ /** True for a pairing code in its display form: 8 uppercase Crockford base32 symbols as `XXXX-XXXX`. */
88
+ export declare const isCloudAccessPairingCode: (valueArg: unknown) => valueArg is string;
89
+ /** The body of `enrollCloudAccessBinding` (`validateEnrollCloudAccessBindingRequest`). */
90
+ export interface IEnrollCloudAccessBindingRequest {
91
+ /** Self-reported and for display only; cloud access keys everything by `bindingId`. */
92
+ controllerId: string;
93
+ /**
94
+ * The controller's public origin (`validateCloudAccessPublicOrigin`): `https`, port 443, no
95
+ * path. Its host is the one name the binding may route.
96
+ */
97
+ publicOrigin: string;
98
+ /** The Cloudly release that enrolls (`data.isReleaseVersion`), for display. */
99
+ version: string;
100
+ /** The release of this package Cloudly speaks (`data.isReleaseVersion`). */
101
+ interfacesVersion: string;
102
+ /**
103
+ * The SHA-256 of the UTF-8 of the bearer Cloudly created for itself: 64 lowercase hex characters.
104
+ * The bearer itself never leaves Cloudly's secret store.
105
+ */
106
+ bearerSha256: string;
107
+ }
108
+ /** What `enrollCloudAccessBinding` answers (`validateCloudAccessEnrollment`). */
109
+ export interface ICloudAccessEnrollment {
110
+ /** Random, assigned by cloud access: `cloudAccessContract.randomIdBytes` bytes as lowercase hex. */
111
+ bindingId: string;
112
+ /** In its display form, `XXXX-XXXX` (`isCloudAccessPairingCode`). */
113
+ pairingCode: string;
114
+ /**
115
+ * Unix milliseconds on cloud access's clock when the enrollment and its code end. It never moves;
116
+ * Cloudly keeps it for as long as the enrollment lives on its socket.
117
+ */
118
+ expiresAt: number;
119
+ }
120
+ /** A claim recorded by a code entry, waiting for the controller's Administrator (C3 step 3). */
121
+ export interface ICloudAccessPendingClaim {
122
+ /** The idp.global organization the claimant picked: its id, never its slug. */
123
+ organizationId: string;
124
+ organizationName: string;
125
+ /** The person who entered the code, as idp.global names them. */
126
+ claimantSubject: string;
127
+ claimantName: string;
128
+ claimantEmail: string;
129
+ }
130
+ /** What `getCloudAccessEnrollmentState` answers (`validateCloudAccessEnrollmentState`). */
131
+ export interface ICloudAccessEnrollmentState {
132
+ /** `waiting` until a person enters the code, then `claimed` until the enrollment ends. */
133
+ state: 'waiting' | 'claimed';
134
+ /** `null` exactly while `waiting`. */
135
+ claim: ICloudAccessPendingClaim | null;
136
+ }
137
+ /**
138
+ * The body of `getCloudAccessEnrollmentState`, `confirmCloudAccessEnrollment` and
139
+ * `rejectCloudAccessEnrollment` (`validateCloudAccessEnrollmentHandle`).
140
+ */
141
+ export interface ICloudAccessEnrollmentHandle {
142
+ bindingId: string;
143
+ }
144
+ /**
145
+ * The body of `authenticateCloudAccessBinding` (`validateAuthenticateCloudAccessBindingRequest`);
146
+ * exclude it from logs.
147
+ */
148
+ export interface IAuthenticateCloudAccessBindingRequest {
149
+ bindingId: string;
150
+ /**
151
+ * Base64url, unpadded, of `cloudAccessContract.bearerRandomBytes` random bytes: exactly 43
152
+ * characters. Never logged, never part of a refusal.
153
+ */
154
+ bearer: string;
155
+ }
156
+ /** The body of `registerCloudAccessSession` (`validateRegisterCloudAccessSessionRequest`). */
157
+ export interface IRegisterCloudAccessSessionRequest {
158
+ /** Self-reported and for display only. */
159
+ controllerId: string;
160
+ /** The controller epoch this site holds (`IControllerPeerSet.epoch`). */
161
+ epoch: number;
162
+ /** Whether this site is the active controller; a shadow says `false`. */
163
+ active: boolean;
164
+ /** The Cloudly release this site runs (`data.isReleaseVersion`), for display. */
165
+ version: string;
166
+ /** The release of this package this site speaks (`data.isReleaseVersion`). */
167
+ interfacesVersion: string;
168
+ }
169
+ /** What `registerCloudAccessSession` answers (`validateRegisterCloudAccessSessionResponse`). */
170
+ export interface IRegisterCloudAccessSessionResponse {
171
+ /** The release of this package cloud access speaks (`data.isReleaseVersion`). */
172
+ interfacesVersion: string;
173
+ }
174
+ /** One release some of the controller's components run, and the update it is offered. */
175
+ export interface ICloudAccessReportVersion {
176
+ /**
177
+ * The component as the controller names it, for display only (`cloudly`, `onebox`, `kubernetes`,
178
+ * `dcrouter`): lowercase letters, digits and hyphens. Each `(product, running)` once per report.
179
+ */
180
+ product: string;
181
+ /** The release they run (`data.isReleaseVersion`). */
182
+ running: string;
183
+ /**
184
+ * The newest release the controller is offered for them (`data.isReleaseVersion`), or `null`
185
+ * when they run it; cloud access never asks a registry itself.
186
+ */
187
+ offered: string | null;
188
+ /** How many of them run `running`: a positive safe integer. */
189
+ count: number;
190
+ }
191
+ /** Counts of the controller's fleet. */
192
+ export interface ICloudAccessReportCounts {
193
+ nodes: number;
194
+ /** Of `nodes`, the offline ones. */
195
+ offlineNodes: number;
196
+ services: number;
197
+ }
198
+ /** The controller roles a location can hold in a report. */
199
+ export declare const cloudAccessLocationRoles: readonly ["active", "shadow", "none"];
200
+ /** One of `cloudAccessLocationRoles`. */
201
+ export type TCloudAccessLocationRole = typeof cloudAccessLocationRoles[number];
202
+ /** One of the controller's locations. */
203
+ export interface ICloudAccessReportLocation {
204
+ /** `data.isLocationName`; each name once per report. */
205
+ name: string;
206
+ /** The controller site it holds: the active one, a shadow, or none (edges or nodes only). */
207
+ role: TCloudAccessLocationRole;
208
+ /** For a `shadow`, whether it is in sync with the active; `null` for every other role. */
209
+ inSync: boolean | null;
210
+ }
211
+ /** The severities of an attention item, Cloudly's own. */
212
+ export declare const cloudAccessAttentionSeverities: readonly ["failed", "warning"];
213
+ /** One of `cloudAccessAttentionSeverities`. */
214
+ export type TCloudAccessAttentionSeverity = typeof cloudAccessAttentionSeverities[number];
215
+ /** The kinds of object an attention item is about, Cloudly's own. */
216
+ export declare const cloudAccessAttentionKinds: readonly ["service", "node", "domain", "backup"];
217
+ /** One of `cloudAccessAttentionKinds`. */
218
+ export type TCloudAccessAttentionKind = typeof cloudAccessAttentionKinds[number];
219
+ /**
220
+ * One thing on the controller an administrator should look at. Cloud access keys its alert
221
+ * history by `(bindingId, key)` and renders every string as text only, never as HTML.
222
+ */
223
+ export interface ICloudAccessAttentionItem {
224
+ /**
225
+ * Stable while the condition lasts (`service:<id>`), under `data.validateControllerIdentifier`'s
226
+ * rule. One key outside it refuses the whole report: the sender checks before it sends.
227
+ */
228
+ key: string;
229
+ severity: TCloudAccessAttentionSeverity;
230
+ kind: TCloudAccessAttentionKind;
231
+ /** The object's display name (a service, a node's hostname, a domain). */
232
+ object: string;
233
+ /** The location the object stands in (`data.isLocationName`), or `null` when it stands in none. */
234
+ location: string | null;
235
+ /**
236
+ * Unix milliseconds on the controller's clock since when it holds, or `null` when unknown; never
237
+ * a time in the future, such as an expiry.
238
+ */
239
+ since: number | null;
240
+ /** At most `cloudAccessContract.maximumAttentionTextLength` characters. */
241
+ text: string;
242
+ }
243
+ /** The Cloudly roles of a human user (`IUser.data.role`). */
244
+ export declare const cloudAccessPersonRoles: readonly ["admin", "user"];
245
+ /** One of `cloudAccessPersonRoles`. */
246
+ export type TCloudAccessPersonRole = typeof cloudAccessPersonRoles[number];
247
+ /** One person the controller knows by an idp.global subject, with their Cloudly role. */
248
+ export interface ICloudAccessPerson {
249
+ subject: string;
250
+ role: TCloudAccessPersonRole;
251
+ }
252
+ /**
253
+ * The controller's people: users linked to idp.global, by subject. For display only, never
254
+ * authority. `issuer` is the idp.global issuer the controller signs in with (a canonical `https`
255
+ * origin); cloud access shows the map only when it is the issuer it signs in with itself, and a
256
+ * controller lists no person linked to another issuer. Names come from cloud access's own sign-in
257
+ * records, not from the report.
258
+ */
259
+ export interface ICloudAccessPeopleMap {
260
+ issuer: string;
261
+ /** Each subject once, at most `cloudAccessContract.maximumPeople`. */
262
+ entries: ICloudAccessPerson[];
263
+ }
264
+ /** One report (`validateCloudAccessReport`), the body of `reportCloudAccessStatus`. */
265
+ export interface ICloudAccessReport {
266
+ /** Cloudly's own health verdict, the one `cloudlyStatusPath` answers. */
267
+ healthy: boolean;
268
+ versions: ICloudAccessReportVersion[];
269
+ counts: ICloudAccessReportCounts;
270
+ locations: ICloudAccessReportLocation[];
271
+ /** Most urgent first, each `key` once, at most `cloudAccessContract.maximumAttentionItems`. */
272
+ attention: ICloudAccessAttentionItem[];
273
+ /** `null` while the controller has no idp.global sign-in. */
274
+ people: ICloudAccessPeopleMap | null;
275
+ }
276
+ /** The states of one hostname proof check (C4). */
277
+ export declare const cloudAccessNameCheckStates: readonly ["unchecked", "passing", "failing", "lookup-error"];
278
+ /** One of `cloudAccessNameCheckStates`. */
279
+ export type TCloudAccessNameCheckState = typeof cloudAccessNameCheckStates[number];
280
+ /** One hostname proof check as cloud access last ran it. */
281
+ export interface ICloudAccessNameCheck {
282
+ state: TCloudAccessNameCheckState;
283
+ /** Unix milliseconds on cloud access's clock; `null` exactly while `unchecked`. */
284
+ checkedAt: number | null;
285
+ /** Why it is not passing, at most `cloudAccessContract.maximumCheckDetailLength` characters. */
286
+ detail: string | null;
287
+ }
288
+ /** The record types a binding asks its owner to publish. */
289
+ export declare const cloudAccessDnsRecordTypes: readonly ["TXT", "A", "AAAA", "CAA"];
290
+ /** One of `cloudAccessDnsRecordTypes`. */
291
+ export type TCloudAccessDnsRecordType = typeof cloudAccessDnsRecordTypes[number];
292
+ /** One record to publish, ready to copy. */
293
+ export interface ICloudAccessDnsRecord {
294
+ type: TCloudAccessDnsRecordType;
295
+ /** The record's name, a lowercase DNS name without the trailing dot. */
296
+ name: string;
297
+ /** The record's value in presentation format, at most `maximumDnsRecordValueLength` characters. */
298
+ value: string;
299
+ }
300
+ /** What `getCloudAccessBindingState` answers (`validateCloudAccessBindingState`). */
301
+ export interface ICloudAccessBindingState {
302
+ bindingId: string;
303
+ /** The idp.global organization the binding belongs to. */
304
+ organizationId: string;
305
+ organizationName: string;
306
+ /** The one name the binding may route: the host of the enrolled `publicOrigin`. */
307
+ hostname: string;
308
+ /**
309
+ * The hostname proof (C4): `txt`, `TXT _cloudaccess.<host>` holds `ca1=<bindingId>`; `address`,
310
+ * the name has A/AAAA records directly, with no CNAME or DNAME on the way; `caa`, the effective
311
+ * CAA set allows exactly `letsencrypt.org` with `validationmethods=dns-01`.
312
+ */
313
+ checks: {
314
+ txt: ICloudAccessNameCheck;
315
+ address: ICloudAccessNameCheck;
316
+ caa: ICloudAccessNameCheck;
317
+ };
318
+ /** Diagnostic, never a condition: whether the name's A/AAAA point at the relay; `null` unchecked. */
319
+ pointsAtRelay: boolean | null;
320
+ /** Whether the relay routes the name now. */
321
+ routed: boolean;
322
+ /** The records the name's owner publishes, ready to copy; 1 to `maximumDnsRecords`. */
323
+ records: ICloudAccessDnsRecord[];
324
+ }
325
+ /** The body of `getCloudAccessBindingState` (`validateGetCloudAccessBindingStateRequest`). */
326
+ export interface IGetCloudAccessBindingStateRequest {
327
+ /**
328
+ * Runs the hostname proof now, which only brings the scheduled check forward, before answering;
329
+ * refused `rate-limited` when asked too often.
330
+ */
331
+ recheck: boolean;
332
+ }
333
+ /**
334
+ * The body of `openCloudAccessStream` (`validateOpenCloudAccessStreamRequest`). It names no target:
335
+ * the connector dials `tunnel.cloudaccess.serve.zone` and the host's relay ingress, never an address
336
+ * taken from a request.
337
+ */
338
+ export interface IOpenCloudAccessStreamRequest {
339
+ /** Random, assigned by cloud access: `cloudAccessContract.randomIdBytes` bytes as lowercase hex. */
340
+ streamId: string;
341
+ /**
342
+ * Unpadded base64url of `cloudAccessContract.streamTokenBytes` random bytes: 43 characters. Used
343
+ * once, valid `streamTokenLifetimeMs`, bound to the binding; written raw in the preamble. Never logged.
344
+ */
345
+ token: string;
346
+ /**
347
+ * The browser's address as the relay saw it, canonical (`192.0.2.1`, RFC 5952 for IPv6, never
348
+ * IPv4-mapped). Cloudly records it as reported, never as the peer.
349
+ */
350
+ clientAddress: string;
351
+ }
352
+ /**
353
+ * A controller's `publicOrigin` as cloud access binds it: a canonical `https` origin on port 443
354
+ * (no explicit port), without userinfo, path, query or fragment, whose host is a DNS name of two
355
+ * or more labels (no address literal) and is neither `serve.zone` nor below it.
356
+ */
357
+ export declare const validateCloudAccessPublicOrigin: (valueArg: unknown, pathArg?: string) => string[];
358
+ /** Validates an `enrollCloudAccessBinding` body and names every reason it is refused. */
359
+ export declare const validateEnrollCloudAccessBindingRequest: (valueArg: unknown, pathArg?: string) => string[];
360
+ /** Validates what `enrollCloudAccessBinding` answers; Cloudly checks it before it shows the code. */
361
+ export declare const validateCloudAccessEnrollment: (valueArg: unknown, pathArg?: string) => string[];
362
+ /**
363
+ * Validates what `getCloudAccessEnrollmentState` answers; Cloudly checks it before it asks for a
364
+ * confirmation.
365
+ */
366
+ export declare const validateCloudAccessEnrollmentState: (valueArg: unknown, pathArg?: string) => string[];
367
+ /**
368
+ * Validates a `getCloudAccessEnrollmentState`, `confirmCloudAccessEnrollment` or
369
+ * `rejectCloudAccessEnrollment` body.
370
+ */
371
+ export declare const validateCloudAccessEnrollmentHandle: (valueArg: unknown, pathArg?: string) => string[];
372
+ /** Validates an `authenticateCloudAccessBinding` body; no refusal carries the bearer. */
373
+ export declare const validateAuthenticateCloudAccessBindingRequest: (valueArg: unknown, pathArg?: string) => string[];
374
+ /** Validates a `registerCloudAccessSession` body. */
375
+ export declare const validateRegisterCloudAccessSessionRequest: (valueArg: unknown, pathArg?: string) => string[];
376
+ /** Validates what `registerCloudAccessSession` answers. */
377
+ export declare const validateRegisterCloudAccessSessionResponse: (valueArg: unknown, pathArg?: string) => string[];
378
+ /**
379
+ * The size of a report as the bound reads it: the UTF-8 bytes of its JSON. Call it on a report that
380
+ * passed the rest of `validateCloudAccessReport`, which calls it last.
381
+ */
382
+ export declare const measureCloudAccessReportBytes: (reportArg: ICloudAccessReport) => number;
383
+ /**
384
+ * Validates one report and names every reason it is refused: exact keys, closed lists, each list's
385
+ * and each string's bound, and last the whole report's `cloudAccessContract.maximumReportBytes`.
386
+ * Cloud access answers `report-too-large` when the size is the reason and `request-invalid`
387
+ * otherwise. Cloudly runs it before it sends.
388
+ */
389
+ export declare const validateCloudAccessReport: (valueArg: unknown, pathArg?: string) => string[];
390
+ /**
391
+ * Validates what `getCloudAccessBindingState` answers; Cloudly checks it before it shows it. A
392
+ * routed binding has no failing and no unchecked check (a `lookup-error` keeps the previous verdict
393
+ * for its grace).
394
+ */
395
+ export declare const validateCloudAccessBindingState: (valueArg: unknown, pathArg?: string) => string[];
396
+ /** Validates a `getCloudAccessBindingState` body. */
397
+ export declare const validateGetCloudAccessBindingStateRequest: (valueArg: unknown, pathArg?: string) => string[];
398
+ /**
399
+ * Validates an `openCloudAccessStream` body; Cloudly runs it before it dials. Exactly these three
400
+ * members: a request that names a target, or anything else, is refused. No refusal carries the token.
401
+ */
402
+ export declare const validateOpenCloudAccessStreamRequest: (valueArg: unknown, pathArg?: string) => string[];