@serve.zone/interfaces 31.2.0 → 31.4.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 +74 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/cluster.d.ts +52 -0
- package/dist_ts/data/cluster.js +68 -1
- package/dist_ts/data/clusteringress.d.ts +137 -0
- package/dist_ts/data/clusteringress.js +302 -0
- package/dist_ts/data/coremail.runtime.js +4 -8
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/networkprotection.d.ts +18 -0
- package/dist_ts/data/networkprotection.js +24 -3
- package/dist_ts/data/privatenetwork.js +3 -5
- package/dist_ts/private/ipv4.d.ts +9 -0
- package/dist_ts/private/ipv4.js +23 -0
- package/dist_ts/private/networkcontract.d.ts +1 -1
- package/dist_ts/private/networkcontract.js +7 -3
- package/dist_ts/private/utccalendarday.d.ts +17 -0
- package/dist_ts/private/utccalendarday.js +27 -0
- package/dist_ts/requests/cluster.d.ts +47 -0
- package/dist_ts/requests/clusteringress.d.ts +120 -0
- package/dist_ts/requests/clusteringress.js +3 -0
- package/dist_ts/requests/index.d.ts +2 -1
- package/dist_ts/requests/index.js +3 -2
- package/package.json +1 -1
- package/readme.md +126 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/cluster.ts +126 -0
- package/ts/data/clusteringress.ts +425 -0
- package/ts/data/coremail.runtime.ts +3 -10
- package/ts/data/index.ts +1 -0
- package/ts/data/networkprotection.ts +34 -2
- package/ts/data/privatenetwork.ts +3 -4
- package/ts/private/ipv4.ts +24 -0
- package/ts/private/networkcontract.ts +8 -2
- package/ts/private/utccalendarday.ts +30 -0
- package/ts/requests/cluster.ts +59 -0
- package/ts/requests/clusteringress.ts +140 -0
- package/ts/requests/index.ts +2 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import * as clusterIngressInterfaces from '../data/clusteringress.js';
|
|
2
|
+
import * as plugins from '../plugins.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cloudly hands a cluster's relay the table its ingress serves.
|
|
6
|
+
*
|
|
7
|
+
* Cloudly computes it: it is the only party that knows every service, every
|
|
8
|
+
* ready endpoint, the node address each published port answers on and the
|
|
9
|
+
* certificate each hostname needs. The relay caches it in memory and serves it
|
|
10
|
+
* to the ingress; it never authors one.
|
|
11
|
+
*
|
|
12
|
+
* The table carries private keys, so this request is secret-bearing: exclude it
|
|
13
|
+
* from hooks, logs and journals on both sides.
|
|
14
|
+
*/
|
|
15
|
+
export interface IReq_Cloudly_Relay_PushClusterRouteTable extends plugins.typedrequestInterfaces.implementsTR<
|
|
16
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
17
|
+
IReq_Cloudly_Relay_PushClusterRouteTable
|
|
18
|
+
> {
|
|
19
|
+
method: 'pushClusterRouteTable';
|
|
20
|
+
request: {
|
|
21
|
+
table: clusterIngressInterfaces.IClusterRouteTable;
|
|
22
|
+
};
|
|
23
|
+
response: {
|
|
24
|
+
/**
|
|
25
|
+
* The revision the relay now holds. Lower than the pushed revision means
|
|
26
|
+
* the relay already held a newer table and kept it.
|
|
27
|
+
*/
|
|
28
|
+
appliedRevision: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The relay asks for the current table.
|
|
34
|
+
*
|
|
35
|
+
* Its own session decides which cluster it speaks for, so the request carries no
|
|
36
|
+
* cluster of its own. `null` means Cloudly has computed no table yet — a fact,
|
|
37
|
+
* not an empty table, which the relay must not serve as one.
|
|
38
|
+
*/
|
|
39
|
+
export interface IReq_Relay_Cloudly_GetClusterRouteTable extends plugins.typedrequestInterfaces.implementsTR<
|
|
40
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
41
|
+
IReq_Relay_Cloudly_GetClusterRouteTable
|
|
42
|
+
> {
|
|
43
|
+
method: 'getClusterRouteTable';
|
|
44
|
+
request: Record<string, never>;
|
|
45
|
+
response: {
|
|
46
|
+
table: clusterIngressInterfaces.IClusterRouteTable | null;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The cluster ingress announces itself, and Cloudly decides whether it is one.
|
|
52
|
+
*
|
|
53
|
+
* One body for both hops: the ingress sends it to its relay, and the relay
|
|
54
|
+
* forwards it to Cloudly untouched. The relay cannot decide this — anything that
|
|
55
|
+
* reaches its listener could ask — so the bearer Cloudly minted into the ingress
|
|
56
|
+
* workload's assignment environment is what authorizes the registration, and
|
|
57
|
+
* Cloudly derives which cluster is speaking from the identity tag on the relay's
|
|
58
|
+
* own session, never from a request field.
|
|
59
|
+
*
|
|
60
|
+
* A method, not a connection tag: what a relay knows about its ingress is what
|
|
61
|
+
* it registered through, which a server owns, rather than a label a client
|
|
62
|
+
* authored. Only an accepted registration binds the connection; every other
|
|
63
|
+
* ingress method is answered for that connection alone.
|
|
64
|
+
*
|
|
65
|
+
* `revision` is the table the relay holds, so an accepted ingress knows at once
|
|
66
|
+
* whether it has to fetch one. Cloudly answers `null`: the table is the relay's
|
|
67
|
+
* to state, not Cloudly's to echo.
|
|
68
|
+
*/
|
|
69
|
+
export interface IReq_Ingress_Relay_Cloudly_RegisterClusterIngress extends plugins.typedrequestInterfaces.implementsTR<
|
|
70
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
71
|
+
IReq_Ingress_Relay_Cloudly_RegisterClusterIngress
|
|
72
|
+
> {
|
|
73
|
+
method: 'registerClusterIngress';
|
|
74
|
+
request: {
|
|
75
|
+
/**
|
|
76
|
+
* Sensitive ephemeral input: exclude the complete request from hooks, logs,
|
|
77
|
+
* diagnostics and durable journals on every hop. Cloudly mints it into the
|
|
78
|
+
* ingress workload's assignment environment and verifies it here.
|
|
79
|
+
*/
|
|
80
|
+
bearer: string;
|
|
81
|
+
/** The ingress build that registered, for operators reading a relay's log. */
|
|
82
|
+
version: string;
|
|
83
|
+
/** The node this ingress runs on, as its assignment names it. */
|
|
84
|
+
nodeId: string;
|
|
85
|
+
/** Optional capability names; an ingress that states none states nothing. */
|
|
86
|
+
capabilities?: string[];
|
|
87
|
+
};
|
|
88
|
+
response: {
|
|
89
|
+
accepted: true;
|
|
90
|
+
revision: number | null;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The ingress fetches the table the relay holds.
|
|
96
|
+
*
|
|
97
|
+
* `knownRevision` is what the ingress already applied: the relay answers `null`
|
|
98
|
+
* when it holds nothing newer, so a reconnect costs one round trip and not a
|
|
99
|
+
* certificate transfer.
|
|
100
|
+
*/
|
|
101
|
+
export interface IReq_Ingress_Relay_GetClusterIngressRouteTable extends plugins.typedrequestInterfaces.implementsTR<
|
|
102
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
103
|
+
IReq_Ingress_Relay_GetClusterIngressRouteTable
|
|
104
|
+
> {
|
|
105
|
+
method: 'getClusterIngressRouteTable';
|
|
106
|
+
request: {
|
|
107
|
+
knownRevision: number | null;
|
|
108
|
+
};
|
|
109
|
+
response: {
|
|
110
|
+
table: clusterIngressInterfaces.IClusterRouteTable | null;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* One page of the ingress's day-bucketed counters.
|
|
116
|
+
*
|
|
117
|
+
* The same body travels Cloudly → relay and relay → ingress: the relay carries
|
|
118
|
+
* the request to the ingress that answers it and the page back, adding nothing.
|
|
119
|
+
* A reader re-reads yesterday and today on every pass, because a day only stops
|
|
120
|
+
* changing once it has closed.
|
|
121
|
+
*/
|
|
122
|
+
export interface IReq_Any_Ingress_GetClusterTrafficStatistics extends plugins.typedrequestInterfaces.implementsTR<
|
|
123
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
124
|
+
IReq_Any_Ingress_GetClusterTrafficStatistics
|
|
125
|
+
> {
|
|
126
|
+
method: 'getClusterTrafficStatistics';
|
|
127
|
+
request: {
|
|
128
|
+
/** Inclusive first UTC calendar day, `YYYY-MM-DD`. */
|
|
129
|
+
fromDayUtc: string;
|
|
130
|
+
/** Inclusive last UTC calendar day, `YYYY-MM-DD`. */
|
|
131
|
+
toDayUtc: string;
|
|
132
|
+
/** Opaque ingress-owned cursor. */
|
|
133
|
+
cursor?: string;
|
|
134
|
+
limit: number;
|
|
135
|
+
};
|
|
136
|
+
response: {
|
|
137
|
+
statistics: clusterIngressInterfaces.IClusterTrafficStatistics[];
|
|
138
|
+
nextCursor?: string;
|
|
139
|
+
};
|
|
140
|
+
}
|
package/ts/requests/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as baseOsRequests from './baseos.js';
|
|
|
7
7
|
import * as backupRequests from './backup.js';
|
|
8
8
|
import * as certificateRequests from './certificate.js';
|
|
9
9
|
import * as clusterRequests from './cluster.js';
|
|
10
|
+
import * as clusterIngressRequests from './clusteringress.js';
|
|
10
11
|
import * as configRequests from './config.js';
|
|
11
12
|
import * as coreMailRequests from './coremail.js';
|
|
12
13
|
import * as coreMailAdminRequests from './coremail.admin.js';
|
|
@@ -45,6 +46,7 @@ export {
|
|
|
45
46
|
backupRequests as backup,
|
|
46
47
|
certificateRequests as certificate,
|
|
47
48
|
clusterRequests as cluster,
|
|
49
|
+
clusterIngressRequests as clusteringress,
|
|
48
50
|
configRequests as config,
|
|
49
51
|
coreMailRequests as coremail,
|
|
50
52
|
coreMailAdminRequests as coremailAdmin,
|