@serve.zone/interfaces 32.87.0 → 32.89.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 +17 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/cloudaccess.d.ts +402 -0
- package/dist_ts/data/cloudaccess.js +685 -0
- package/dist_ts/data/cloudlyconfig.d.ts +20 -0
- package/dist_ts/data/cloudlyconfig.js +21 -1
- package/dist_ts/data/gatewayareas.d.ts +116 -21
- package/dist_ts/data/gatewayareas.js +36 -1
- package/dist_ts/data/gatewayareas.validation.d.ts +30 -1
- package/dist_ts/data/gatewayareas.validation.js +242 -38
- package/dist_ts/data/gatewayconnector.d.ts +2 -2
- package/dist_ts/data/gatewayconnector.js +20 -1
- package/dist_ts/data/gatewayintent.d.ts +154 -0
- package/dist_ts/data/gatewayintent.js +61 -0
- package/dist_ts/data/index.d.ts +2 -0
- package/dist_ts/data/index.js +3 -1
- package/dist_ts/data/witness.js +4 -9
- package/dist_ts/private/bearerencoding.d.ts +9 -0
- package/dist_ts/private/bearerencoding.js +17 -0
- package/dist_ts/private/storagecontract.js +3 -3
- package/dist_ts/requests/cloudaccess.d.ts +125 -0
- package/dist_ts/requests/cloudaccess.js +2 -0
- package/dist_ts/requests/gatewayconnector.d.ts +33 -1
- 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 +156 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/cloudaccess.ts +1133 -0
- package/ts/data/cloudlyconfig.ts +27 -0
- package/ts/data/gatewayareas.ts +84 -21
- package/ts/data/gatewayareas.validation.ts +268 -36
- package/ts/data/gatewayconnector.ts +19 -0
- package/ts/data/gatewayintent.ts +209 -0
- package/ts/data/index.ts +2 -0
- package/ts/data/witness.ts +3 -10
- package/ts/private/bearerencoding.ts +24 -0
- package/ts/private/storagecontract.ts +2 -2
- package/ts/requests/cloudaccess.ts +201 -0
- package/ts/requests/gatewayconnector.ts +41 -1
- package/ts/requests/index.ts +2 -0
|
@@ -69,6 +69,26 @@ export type TCloudlyHostPlatformOidcEnvironmentName = typeof cloudlyHostPlatform
|
|
|
69
69
|
export declare const cloudlyHostOptionalEnvironment: readonly ["SERVEZONE_LISTENPORT", "SERVEZONE_WORKLOADINIT_APPROVAL_PATH", "MONGODB_NAME", "MONGODB_USER", "MONGODB_PASS", "S3_PORT", "S3_USESSL", "SERVEZONE_RUNTIME_URL", "SERVEZONE_APP_CONTROL_TOKEN", "SERVEZONE_PLATFORM_OIDC_ISSUER", "SERVEZONE_PLATFORM_OIDC_CLIENT_ID", "SERVEZONE_PLATFORM_OIDC_CLIENT_SECRET", "SERVEZONE_PLATFORM_OIDC_REDIRECT_URI", "SERVEZONE_PLATFORM_OIDC_AUDIENCE", "CLOUDLY_BACKUP_CRON", "CLOUDLY_BACKUP_KEEP_LAST", "CLOUDLY_BASEOS_IMAGE_CLEANUP_INTERVAL_MS", "SERVEZONE_SITE_ORIGIN", "SERVEZONE_WITNESS_ORIGIN", "SERVEZONE_WITNESS_BEARER_PATH"];
|
|
70
70
|
/** One variable the Cloudly server reads but starts without. */
|
|
71
71
|
export type TCloudlyHostOptionalEnvironmentName = typeof cloudlyHostOptionalEnvironment[number];
|
|
72
|
+
/**
|
|
73
|
+
* The host extras a host can advertise to the Cloudly it runs (Linus ruling 13, amendment points
|
|
74
|
+
* 12 and 17): optional offers Cloudly uses only when the host advertises them, never a precondition
|
|
75
|
+
* for its start or run, and never inferred from the host type (`SERVEZONE_APP_HOST_TYPE`) or by
|
|
76
|
+
* probing the environment.
|
|
77
|
+
*
|
|
78
|
+
* `relayIngress` (Linus ruling 141 C7): the host serves `SERVEZONE_PUBLIC_ORIGIN`'s TLS on a second
|
|
79
|
+
* listener the Cloudly container can reach and forwards that listener only to Cloudly's relayed
|
|
80
|
+
* port, which serves the human surface only; a request accepted there is relayed. Cloud access can
|
|
81
|
+
* be started only on a host that advertises it.
|
|
82
|
+
*
|
|
83
|
+
* No carrier advertises an extra yet, so none can be advertised or read (amendment 141a): ruling 15
|
|
84
|
+
* point 4 names the carrier, `IHostedAppLifecycleState.hostExtras`, which this package does not
|
|
85
|
+
* declare yet, and no environment variable of either list names the relayed port yet.
|
|
86
|
+
*/
|
|
87
|
+
export declare const cloudlyHostExtras: readonly ["relayIngress"];
|
|
88
|
+
/** One host extra. */
|
|
89
|
+
export type TCloudlyHostExtra = typeof cloudlyHostExtras[number];
|
|
90
|
+
/** True for one of `cloudlyHostExtras`. */
|
|
91
|
+
export declare const isCloudlyHostExtra: (valueArg: unknown) => valueArg is TCloudlyHostExtra;
|
|
72
92
|
/**
|
|
73
93
|
* Cloudly's health path on its listen port (`GET` or `HEAD`). It answers 200 with
|
|
74
94
|
* `{ healthy: true, checks }` while Cloudly runs and 503 otherwise; it states no version. Cloudly
|
|
@@ -120,6 +120,26 @@ export const cloudlyHostOptionalEnvironment = Object.freeze([
|
|
|
120
120
|
*/
|
|
121
121
|
'SERVEZONE_WITNESS_BEARER_PATH',
|
|
122
122
|
]);
|
|
123
|
+
/**
|
|
124
|
+
* The host extras a host can advertise to the Cloudly it runs (Linus ruling 13, amendment points
|
|
125
|
+
* 12 and 17): optional offers Cloudly uses only when the host advertises them, never a precondition
|
|
126
|
+
* for its start or run, and never inferred from the host type (`SERVEZONE_APP_HOST_TYPE`) or by
|
|
127
|
+
* probing the environment.
|
|
128
|
+
*
|
|
129
|
+
* `relayIngress` (Linus ruling 141 C7): the host serves `SERVEZONE_PUBLIC_ORIGIN`'s TLS on a second
|
|
130
|
+
* listener the Cloudly container can reach and forwards that listener only to Cloudly's relayed
|
|
131
|
+
* port, which serves the human surface only; a request accepted there is relayed. Cloud access can
|
|
132
|
+
* be started only on a host that advertises it.
|
|
133
|
+
*
|
|
134
|
+
* No carrier advertises an extra yet, so none can be advertised or read (amendment 141a): ruling 15
|
|
135
|
+
* point 4 names the carrier, `IHostedAppLifecycleState.hostExtras`, which this package does not
|
|
136
|
+
* declare yet, and no environment variable of either list names the relayed port yet.
|
|
137
|
+
*/
|
|
138
|
+
export const cloudlyHostExtras = Object.freeze([
|
|
139
|
+
'relayIngress',
|
|
140
|
+
]);
|
|
141
|
+
/** True for one of `cloudlyHostExtras`. */
|
|
142
|
+
export const isCloudlyHostExtra = (valueArg) => (cloudlyHostExtras.includes(valueArg));
|
|
123
143
|
/**
|
|
124
144
|
* Cloudly's health path on its listen port (`GET` or `HEAD`). It answers 200 with
|
|
125
145
|
* `{ healthy: true, checks }` while Cloudly runs and 503 otherwise; it states no version. Cloudly
|
|
@@ -131,4 +151,4 @@ export const cloudlyHostOptionalEnvironment = Object.freeze([
|
|
|
131
151
|
export const cloudlyStatusPath = '/status';
|
|
132
152
|
/** The port Cloudly binds when `SERVEZONE_LISTENPORT` is unset. */
|
|
133
153
|
export const cloudlyDefaultListenPort = 3000;
|
|
134
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
154
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xvdWRseWNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2RhdGEvY2xvdWRseWNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsNEJBQTRCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQTZDOUQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxNQUFNLDhCQUE4QixHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUM7SUFDMUQ7Ozs7T0FJRztJQUNILHVCQUF1QjtJQUN2Qjs7OztPQUlHO0lBQ0gseUJBQXlCO0lBQ3pCOztPQUVHO0lBQ0gsbUJBQW1CO0lBQ25COzs7OztPQUtHO0lBQ0gsK0JBQStCO0lBQy9C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0FBS1o7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCxNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDO0lBQzdDLGNBQWM7Q0FDTixDQUFDLENBQUM7QUFLWiwyQ0FBMkM7QUFDM0MsTUFBTSxDQUFDLE1BQU0sa0JBQWtCLEdBQUcsQ0FBQyxRQUFpQixFQUFpQyxFQUFFLENBQUMsQ0FDckYsaUJBQXdDLENBQUMsUUFBUSxDQUFDLFFBQVEsQ0FBQyxDQUM3RCxDQUFDO0FBRUY7Ozs7Ozs7R0FPRztBQUNILE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLFNBQWtCLENBQUM7QUFFcEQsbUVBQW1FO0FBQ25FLE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFHLElBQWEsQ0FBQyJ9
|
|
@@ -272,16 +272,30 @@ export interface IGatewayDnsRecordRow {
|
|
|
272
272
|
/** A `dcrouter`-source row of `domains`. */
|
|
273
273
|
domainId: string;
|
|
274
274
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
275
|
+
* At most 253 characters of lowercase labels (letters, digits, `_` and inner `-`, 1 to 63
|
|
276
|
+
* characters, as a zone's), no trailing dot; the leftmost label may instead be exactly `*`, with at
|
|
277
|
+
* least one label after it (Linus ruling 129). Inside its zone: the zone's `name` itself, or a name
|
|
278
|
+
* that ends in `.` and the zone's `name`, compared as written. A name outside the form is refused,
|
|
279
|
+
* never repaired; whether a gateway answers a `*` name as a wildcard is the gateway's to state.
|
|
277
280
|
*/
|
|
278
281
|
name: string;
|
|
279
282
|
type: TGatewayDnsRecordType;
|
|
280
283
|
/**
|
|
281
|
-
* The record value in
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
284
|
+
* The record value in its one spelling per type, the one the gateway's record value owner emits
|
|
285
|
+
* (Linus ruling 129):
|
|
286
|
+
*
|
|
287
|
+
* - `A`: one IPv4 address as a dotted quad without leading zeros. `AAAA`: one IPv6 address in its
|
|
288
|
+
* RFC 5952 text (lowercase hex groups without leading zeros, the longest run of two or more
|
|
289
|
+
* zero groups written `::`, the first run on a tie), no IPv4 tail and no zone id. The contract's
|
|
290
|
+
* canonical address text, with nothing around it (Linus ruling 143 B): another spelling of the
|
|
291
|
+
* same address is refused, and any address of the family is a value.
|
|
292
|
+
* - `CNAME`, `NS`: one domain name: lowercase, no trailing dot, no whitespace, no empty label,
|
|
293
|
+
* each label at most 63 octets and the name at most 253.
|
|
294
|
+
* - `MX`: `<preference> <exchange>` with one space between: the preference 0 to 65535 without a
|
|
295
|
+
* leading zero, the exchange such a name, or `0 .` for a null MX.
|
|
296
|
+
* - `SOA`: `<mname> <rname> <serial> <refresh> <retry> <expire> <minimum>` with one space between
|
|
297
|
+
* each: two such names and five numbers from 0 to 4294967295 without a leading zero.
|
|
298
|
+
* - `CAA`: a text without whitespace around it. `TXT`: the text itself.
|
|
285
299
|
*/
|
|
286
300
|
value: string;
|
|
287
301
|
/** Seconds, positive. */
|
|
@@ -294,9 +308,10 @@ export interface IGatewayDnsRecordRow {
|
|
|
294
308
|
export interface IGatewayDnsStaticRecordRow {
|
|
295
309
|
/** `static-` followed by 64 lowercase hex digits. */
|
|
296
310
|
id: string;
|
|
311
|
+
/** The name form of `IGatewayDnsRecordRow.name`; a static record belongs to no zone row. */
|
|
297
312
|
name: string;
|
|
298
313
|
type: TGatewayDnsStaticRecordType;
|
|
299
|
-
/** As `IGatewayDnsRecordRow.value
|
|
314
|
+
/** As `IGatewayDnsRecordRow.value`: the one spelling of its type. */
|
|
300
315
|
value: string;
|
|
301
316
|
/** Seconds; `null` for the gateway's default. */
|
|
302
317
|
ttl: number | null;
|
|
@@ -307,6 +322,7 @@ export interface IGatewayDnsStaticRecordRow {
|
|
|
307
322
|
export interface IGatewayDnsProtectedHostnameRow {
|
|
308
323
|
/** The exact hostname: lowercase, no trailing dot, no wildcard. */
|
|
309
324
|
id: string;
|
|
325
|
+
/** Without whitespace around it: the gateway stores a reason trimmed. */
|
|
310
326
|
reason: string;
|
|
311
327
|
}
|
|
312
328
|
/**
|
|
@@ -351,7 +367,8 @@ export interface IGatewayDnsArea {
|
|
|
351
367
|
protectedHostnames: IGatewayDnsProtectedHostnameRow[];
|
|
352
368
|
/**
|
|
353
369
|
* Zones the gateway may answer for once it has proven their delegation itself, keyed by zone
|
|
354
|
-
* name
|
|
370
|
+
* name: at least two labels of letters, digits and inner hyphens (no `_`), the form a delegation
|
|
371
|
+
* names. The proof and its evidence stay on the gateway; it serves the proven ones.
|
|
355
372
|
*/
|
|
356
373
|
authorityZones: IGatewayAreaKeyRow[];
|
|
357
374
|
clientHostnames: IGatewayDnsClientHostnameRow[];
|
|
@@ -603,7 +620,8 @@ export interface IGatewayMailPortConfig {
|
|
|
603
620
|
}
|
|
604
621
|
/**
|
|
605
622
|
* The mail server settings singleton (the stored settings, never the run-time options).
|
|
606
|
-
* `emailConfig` is SmartMTA's server options
|
|
623
|
+
* `emailConfig` is SmartMTA's server options; while `enabled` it names a non-blank `hostname` and
|
|
624
|
+
* `ports`, a non-empty list of ports 1 to 65535 (a gateway starts no mail server without them). `auth.users` and `auth.accounts` are out; the rest of
|
|
607
625
|
* `auth` (`required`, `methods`) travels inside `emailConfig` (Linus ruling 126, which amends ruling
|
|
608
626
|
* 121). SMTP accounts are rows of `smtpAccounts`; plaintext `auth.users` logins have no table form,
|
|
609
627
|
* so a gateway that holds one refuses to export by name. Host paths stay out, and `tls.keyPem` is
|
|
@@ -616,7 +634,10 @@ export interface IGatewayMailServerSettings {
|
|
|
616
634
|
/** `emailConfig.tls.keyPem`; only with `emailConfig.tls`. */
|
|
617
635
|
tlsKey: IGatewaySealedValue | null;
|
|
618
636
|
emailPortConfig: IGatewayMailPortConfig;
|
|
619
|
-
/**
|
|
637
|
+
/**
|
|
638
|
+
* The effective source: what the gateway serves for settings stored without one.
|
|
639
|
+
* `configuredMaterial` only with material in the table: `tlsKey`, or `emailConfig.tls.certPem`.
|
|
640
|
+
*/
|
|
620
641
|
tlsSource: 'managedCertificate' | 'configuredMaterial';
|
|
621
642
|
}
|
|
622
643
|
/** dcrouter's `IEmailDomainRateLimits`, canonical. */
|
|
@@ -706,8 +727,8 @@ export type TGatewayMailIdentityInboundTarget = {
|
|
|
706
727
|
};
|
|
707
728
|
/**
|
|
708
729
|
* One WorkApp mail identity, one row per identity. Its SMTP credential is a verifier with
|
|
709
|
-
* `gatewayMailIdentityScramIterations` iterations; the password
|
|
710
|
-
*
|
|
730
|
+
* `gatewayMailIdentityScramIterations` iterations (`deriveGatewayScramVerifier`); the password is
|
|
731
|
+
* never stored by the gateway or in a table.
|
|
711
732
|
*/
|
|
712
733
|
export interface IGatewayMailIdentityRow {
|
|
713
734
|
id: string;
|
|
@@ -751,11 +772,77 @@ export interface IGatewayMailArea {
|
|
|
751
772
|
identities: IGatewayMailIdentityRow[];
|
|
752
773
|
coreMailPeers: IGatewayCoreMailPeerRow[];
|
|
753
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* The ranges and bounds of an edge's settings (`IGatewayEdgePerformance`, `IGatewayEdgeEgress`), the
|
|
777
|
+
* ones a gateway's remote ingress engine takes; `validateGatewayAreaTables` refuses outside them: an
|
|
778
|
+
* integer outside its range as `invalid-value` (a wrong value), a list beyond its length as
|
|
779
|
+
* `bound-exceeded` (a document's size).
|
|
780
|
+
*/
|
|
781
|
+
export declare const gatewayEdgeSettingBounds: Readonly<{
|
|
782
|
+
/** Each integer performance setting, inclusive. Only `maxHalfClosedStreams` may be 0 (it turns the retention off). */
|
|
783
|
+
readonly performance: Readonly<{
|
|
784
|
+
maxStreamsPerEdge: Readonly<{
|
|
785
|
+
minimum: 1;
|
|
786
|
+
maximum: 100000;
|
|
787
|
+
}>;
|
|
788
|
+
totalWindowBudgetBytes: Readonly<{
|
|
789
|
+
minimum: 1;
|
|
790
|
+
maximum: 1073741824;
|
|
791
|
+
}>;
|
|
792
|
+
minStreamWindowBytes: Readonly<{
|
|
793
|
+
minimum: 1;
|
|
794
|
+
maximum: 16777216;
|
|
795
|
+
}>;
|
|
796
|
+
maxStreamWindowBytes: Readonly<{
|
|
797
|
+
minimum: 1;
|
|
798
|
+
maximum: 134217728;
|
|
799
|
+
}>;
|
|
800
|
+
sustainedStreamWindowBytes: Readonly<{
|
|
801
|
+
minimum: 1;
|
|
802
|
+
maximum: 134217728;
|
|
803
|
+
}>;
|
|
804
|
+
quicDatagramReceiveBufferBytes: Readonly<{
|
|
805
|
+
minimum: 1;
|
|
806
|
+
maximum: 67108864;
|
|
807
|
+
}>;
|
|
808
|
+
streamFramePayloadBytes: Readonly<{
|
|
809
|
+
minimum: 1;
|
|
810
|
+
maximum: 16777216;
|
|
811
|
+
}>;
|
|
812
|
+
firstDataConnectTimeoutMs: Readonly<{
|
|
813
|
+
minimum: 1;
|
|
814
|
+
maximum: 3600000;
|
|
815
|
+
}>;
|
|
816
|
+
clientWriteTimeoutMs: Readonly<{
|
|
817
|
+
minimum: 1;
|
|
818
|
+
maximum: 3600000;
|
|
819
|
+
}>;
|
|
820
|
+
maxHalfClosedStreams: Readonly<{
|
|
821
|
+
minimum: 0;
|
|
822
|
+
maximum: 100000;
|
|
823
|
+
}>;
|
|
824
|
+
halfCloseDrainTimeoutMs: Readonly<{
|
|
825
|
+
minimum: 1;
|
|
826
|
+
maximum: 3600000;
|
|
827
|
+
}>;
|
|
828
|
+
}>;
|
|
829
|
+
/** Entries of `serverFirstPorts`. */
|
|
830
|
+
readonly maximumServerFirstPorts: 128;
|
|
831
|
+
/** The client-first TLS port, which `serverFirstPorts` never names. */
|
|
832
|
+
readonly clientFirstPort: 443;
|
|
833
|
+
/** The `allowedPorts` of every enabled egress policy, exactly (Linus ruling 129, Q3): outbound SMTP. */
|
|
834
|
+
readonly egressAllowedPorts: readonly [25];
|
|
835
|
+
/** Entries of an egress policy's `deniedCidrs` and of its `allowedHostPatterns`. */
|
|
836
|
+
readonly maximumEgressListEntries: 128;
|
|
837
|
+
/** An egress policy's `maxConcurrentStreams`, from 1. */
|
|
838
|
+
readonly maximumEgressConcurrentStreams: 100000;
|
|
839
|
+
}>;
|
|
754
840
|
/**
|
|
755
841
|
* dcrouter's `IRemoteIngressPerformanceConfig`, canonical; `null` members take the gateway default.
|
|
756
842
|
* At least one member is set: settings that state nothing are the owner's `performance: null`, never
|
|
757
843
|
* an object of `null` members (Linus ruling 125, Q-b7; the gateway stores and exports them as no
|
|
758
|
-
* setting).
|
|
844
|
+
* setting). Every integer lies in its range of `gatewayEdgeSettingBounds.performance`, and neither
|
|
845
|
+
* `minStreamWindowBytes` nor `sustainedStreamWindowBytes` is above a stated `maxStreamWindowBytes`.
|
|
759
846
|
*/
|
|
760
847
|
export interface IGatewayEdgePerformance {
|
|
761
848
|
profile: 'balanced' | 'throughput' | 'highConcurrency' | null;
|
|
@@ -770,14 +857,18 @@ export interface IGatewayEdgePerformance {
|
|
|
770
857
|
clientWriteTimeoutMs: number | null;
|
|
771
858
|
maxHalfClosedStreams: number | null;
|
|
772
859
|
halfCloseDrainTimeoutMs: number | null;
|
|
773
|
-
/**
|
|
860
|
+
/**
|
|
861
|
+
* A non-empty set of at most `gatewayEdgeSettingBounds.maximumServerFirstPorts` ports, never 443
|
|
862
|
+
* (client-first TLS); `null` for none (never `[]`).
|
|
863
|
+
*/
|
|
774
864
|
serverFirstPorts: number[] | null;
|
|
775
865
|
}
|
|
776
866
|
/**
|
|
777
867
|
* dcrouter's `IRemoteIngressEgressPolicyConfig`, canonical; `null` members take the gateway default.
|
|
778
|
-
* An enabled policy states its ports
|
|
779
|
-
*
|
|
780
|
-
*
|
|
868
|
+
* An enabled policy states its ports, which are exactly `gatewayEdgeSettingBounds.egressAllowedPorts`
|
|
869
|
+
* (`[25]`, never `null`; Linus ruling 129: a gateway opens no other egress port); a disabled one
|
|
870
|
+
* states nothing else, every other member `null`, because the gateway keeps only `enabled` of it. A
|
|
871
|
+
* list member is `null` or non-empty, never `[]` (Linus ruling 125, Q-b7).
|
|
781
872
|
*
|
|
782
873
|
* Always stated on an edge row (`IGatewayEdgeRow.egress`): the gateway reads an edge without a
|
|
783
874
|
* policy and one with a disabled policy alike, so egress off has the one spelling
|
|
@@ -787,13 +878,14 @@ export interface IGatewayEdgePerformance {
|
|
|
787
878
|
*/
|
|
788
879
|
export interface IGatewayEdgeEgress {
|
|
789
880
|
enabled: boolean;
|
|
790
|
-
/**
|
|
881
|
+
/** `[25]` exactly when `enabled`; `null` otherwise. */
|
|
791
882
|
allowedPorts: number[] | null;
|
|
792
883
|
allowPrivateRanges: boolean | null;
|
|
793
|
-
/** A non-empty set of CIDRs, or `null`. */
|
|
884
|
+
/** A non-empty set of at most `gatewayEdgeSettingBounds.maximumEgressListEntries` CIDRs, each without whitespace around it, or `null`. */
|
|
794
885
|
deniedCidrs: string[] | null;
|
|
795
|
-
/** A non-empty set of host patterns, or `null`. */
|
|
886
|
+
/** A non-empty set of host patterns under the same bound and rule, or `null`. */
|
|
796
887
|
allowedHostPatterns: string[] | null;
|
|
888
|
+
/** 1 to `gatewayEdgeSettingBounds.maximumEgressConcurrentStreams`, or `null`. */
|
|
797
889
|
maxConcurrentStreams: number | null;
|
|
798
890
|
}
|
|
799
891
|
/** One remote ingress edge. Its tunnel listener port is a host fact and never here. */
|
|
@@ -813,14 +905,17 @@ export interface IGatewayEdgeRow {
|
|
|
813
905
|
egress: IGatewayEdgeEgress;
|
|
814
906
|
/** A set of tags (the gateway reads absent as empty). */
|
|
815
907
|
tags: string[];
|
|
908
|
+
/** One IPv4 address in canonical text (a dotted quad without leading zeros). */
|
|
816
909
|
publicIp: string | null;
|
|
817
|
-
/** dcrouter stores it as `publicIpV6`. */
|
|
910
|
+
/** One IPv6 address in canonical text (RFC 5952). dcrouter stores it as `publicIpV6`. */
|
|
818
911
|
publicIpv6: string | null;
|
|
912
|
+
/** A lowercase fully qualified name: two or more labels of letters, digits and inner hyphens, no trailing dot. */
|
|
819
913
|
mailHostname: string | null;
|
|
820
914
|
}
|
|
821
915
|
/** The tunnel hub singleton, without its listener port and TLS files. */
|
|
822
916
|
export interface IGatewayEdgeHubSettings {
|
|
823
917
|
enabled: boolean;
|
|
918
|
+
/** Without whitespace around it. */
|
|
824
919
|
hubDomain: string | null;
|
|
825
920
|
performance: IGatewayEdgePerformance | null;
|
|
826
921
|
}
|
|
@@ -214,6 +214,41 @@ export const gatewayDnsStaticRecordTypes = Object.freeze(['A', 'AAAA', 'CNAME',
|
|
|
214
214
|
export const gatewayRoutePathClasses = Object.freeze([
|
|
215
215
|
'git-smart-http', 'static', 'normal-html', 'expensive-html', 'raw', 'archive',
|
|
216
216
|
]);
|
|
217
|
+
// ---------------------------------------------------------------------------------------------
|
|
218
|
+
// edges
|
|
219
|
+
// ---------------------------------------------------------------------------------------------
|
|
220
|
+
/**
|
|
221
|
+
* The ranges and bounds of an edge's settings (`IGatewayEdgePerformance`, `IGatewayEdgeEgress`), the
|
|
222
|
+
* ones a gateway's remote ingress engine takes; `validateGatewayAreaTables` refuses outside them: an
|
|
223
|
+
* integer outside its range as `invalid-value` (a wrong value), a list beyond its length as
|
|
224
|
+
* `bound-exceeded` (a document's size).
|
|
225
|
+
*/
|
|
226
|
+
export const gatewayEdgeSettingBounds = Object.freeze({
|
|
227
|
+
/** Each integer performance setting, inclusive. Only `maxHalfClosedStreams` may be 0 (it turns the retention off). */
|
|
228
|
+
performance: Object.freeze({
|
|
229
|
+
maxStreamsPerEdge: Object.freeze({ minimum: 1, maximum: 100_000 }),
|
|
230
|
+
totalWindowBudgetBytes: Object.freeze({ minimum: 1, maximum: 1_073_741_824 }),
|
|
231
|
+
minStreamWindowBytes: Object.freeze({ minimum: 1, maximum: 16_777_216 }),
|
|
232
|
+
maxStreamWindowBytes: Object.freeze({ minimum: 1, maximum: 134_217_728 }),
|
|
233
|
+
sustainedStreamWindowBytes: Object.freeze({ minimum: 1, maximum: 134_217_728 }),
|
|
234
|
+
quicDatagramReceiveBufferBytes: Object.freeze({ minimum: 1, maximum: 67_108_864 }),
|
|
235
|
+
streamFramePayloadBytes: Object.freeze({ minimum: 1, maximum: 16_777_216 }),
|
|
236
|
+
firstDataConnectTimeoutMs: Object.freeze({ minimum: 1, maximum: 3_600_000 }),
|
|
237
|
+
clientWriteTimeoutMs: Object.freeze({ minimum: 1, maximum: 3_600_000 }),
|
|
238
|
+
maxHalfClosedStreams: Object.freeze({ minimum: 0, maximum: 100_000 }),
|
|
239
|
+
halfCloseDrainTimeoutMs: Object.freeze({ minimum: 1, maximum: 3_600_000 }),
|
|
240
|
+
}),
|
|
241
|
+
/** Entries of `serverFirstPorts`. */
|
|
242
|
+
maximumServerFirstPorts: 128,
|
|
243
|
+
/** The client-first TLS port, which `serverFirstPorts` never names. */
|
|
244
|
+
clientFirstPort: 443,
|
|
245
|
+
/** The `allowedPorts` of every enabled egress policy, exactly (Linus ruling 129, Q3): outbound SMTP. */
|
|
246
|
+
egressAllowedPorts: Object.freeze([25]),
|
|
247
|
+
/** Entries of an egress policy's `deniedCidrs` and of its `allowedHostPatterns`. */
|
|
248
|
+
maximumEgressListEntries: 128,
|
|
249
|
+
/** An egress policy's `maxConcurrentStreams`, from 1. */
|
|
250
|
+
maximumEgressConcurrentStreams: 100_000,
|
|
251
|
+
});
|
|
217
252
|
/** The members of each area, in the order its doc lists them. */
|
|
218
253
|
export const gatewayAreaMembers = Object.freeze({
|
|
219
254
|
security: Object.freeze(['blockRules', 'apiTokens', 'proxyPolicy']),
|
|
@@ -295,4 +330,4 @@ export const gatewayAreaRefusedEngineKeys = Object.freeze({
|
|
|
295
330
|
'headers.request', // SmartProxy `IRouteHeaders.request` (route and every target; lifted to `secrets.requestHeaders`)
|
|
296
331
|
]),
|
|
297
332
|
});
|
|
298
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
333
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2F0ZXdheWFyZWFzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4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BFQUEwRTtRQUN0RixXQUFXLEVBQUUsb0VBQW9FO1FBQ2pGLFNBQVMsRUFBRSw2Q0FBNkM7UUFDeEQsU0FBUyxFQUFFLDZDQUE2QztRQUN4RCxvQkFBb0IsRUFBRSxpREFBaUQ7UUFDdkUsTUFBTSxFQUFFLCtEQUErRDtLQUMvRCxDQUFDO0lBQ1gsZUFBZSxFQUFFLE1BQU0sQ0FBQyxNQUFNLENBQUM7UUFDN0Isa0JBQWtCLEVBQUUsZ0VBQWdFO1FBQ3BGLGVBQWUsRUFBRSx1RUFBdUU7UUFDeEYsaUJBQWlCLEVBQUUsa0dBQWtHO0tBQzdHLENBQUM7Q0FDSCxDQUFDLENBQUMifQ==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IGatewayDnsStaticRecordRow, type TGatewayAreaContent, type TGatewayRoutePortEntry, type TGatewayRoutePortsInput } from './gatewayareas.js';
|
|
1
|
+
import { type IGatewayDnsStaticRecordRow, type IGatewayScramVerifier, type TGatewayAreaContent, type TGatewayRoutePortEntry, type TGatewayRoutePortsInput } from './gatewayareas.js';
|
|
2
2
|
import { type IGatewayAreaTable, type TGatewayConfigArea } from './gatewayconnector.js';
|
|
3
3
|
/** Every reason an area content is refused. */
|
|
4
4
|
export declare const gatewayAreaContentRefusalCodes: readonly ["not-strict-json", "exact-keys", "invalid-value", "bound-exceeded", "invalid-row-id", "rows-not-ascending", "set-not-ascending", "duplicate-key", "dangling-reference", "reference-not-dcrouter-zone", "reference-cycle", "referenced-area-missing", "area-repeated", "invalid-sealed-value", "secret-engine-mismatch", "secret-in-engine-config", "host-path-in-engine-config", "typed-member-in-engine-config", "invalid-scope", "invalid-verifier", "immutable-member-changed"];
|
|
@@ -55,6 +55,35 @@ export declare const canonicalizeGatewayRoutePorts: (portsArg: TGatewayRoutePort
|
|
|
55
55
|
* both sides derive one id and no row id carries a record value.
|
|
56
56
|
*/
|
|
57
57
|
export declare const createGatewayDnsStaticRecordId: (recordArg: Pick<IGatewayDnsStaticRecordRow, 'name' | 'type' | 'value'>) => Promise<string>;
|
|
58
|
+
/** An input `deriveGatewayScramVerifier` refuses; the message names the member, never its value. */
|
|
59
|
+
export declare class GatewayScramVerifierError extends Error {
|
|
60
|
+
constructor(reasonArg: string);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The SCRAM-SHA-256 verifier (RFC 5802/7677 stored form) of a password under a given salt and
|
|
64
|
+
* iteration count: `SaltedPassword = PBKDF2-HMAC-SHA256(password, salt, iterations, 32 bytes)`,
|
|
65
|
+
* `StoredKey = SHA-256(HMAC-SHA256(SaltedPassword, 'Client Key'))`,
|
|
66
|
+
* `ServerKey = HMAC-SHA256(SaltedPassword, 'Server Key')`. For one salt it answers exactly what
|
|
67
|
+
* SmartMTA 13.1.0's `deriveScramVerifier` stores, so a gateway's SMTP AUTH accepts the password.
|
|
68
|
+
*
|
|
69
|
+
* - `password`: a non-empty string, taken as its UTF-8 bytes as written. No SASLprep and no Unicode
|
|
70
|
+
* normalisation is applied (SmartMTA applies none either), so two spellings of one non-ASCII
|
|
71
|
+
* password are two passwords: a caller passes the password it minted (24 random bytes as base64url,
|
|
72
|
+
* which is ASCII) and never a human-typed one it has not normalised itself.
|
|
73
|
+
* - `salt`: the verifier's `salt`, canonical padded base64 of 16 to 64 bytes. The caller draws it
|
|
74
|
+
* (once, at mint) and the answer carries it back unchanged; this function draws nothing.
|
|
75
|
+
* - `iterations`: 4096 to 1000000; a WorkApp mail identity uses `gatewayMailIdentityScramIterations`.
|
|
76
|
+
*
|
|
77
|
+
* To check a password against a stored verifier, derive with that verifier's `salt` and `iterations`
|
|
78
|
+
* and compare `storedKey` and `serverKey`: there is no second function. Throws
|
|
79
|
+
* `GatewayScramVerifierError` for an input outside these rules, which are the ones
|
|
80
|
+
* `validateGatewayAreaTables` holds a verifier to, so every answer passes it.
|
|
81
|
+
*/
|
|
82
|
+
export declare const deriveGatewayScramVerifier: (inputArg: {
|
|
83
|
+
password: string;
|
|
84
|
+
salt: string;
|
|
85
|
+
iterations: number;
|
|
86
|
+
}) => Promise<IGatewayScramVerifier>;
|
|
58
87
|
/**
|
|
59
88
|
* Validates one area's content on its own and names every reason it is refused. Cross-area hard
|
|
60
89
|
* references (`mail.domains[].linkedDomainId`) are not judged here: `validateGatewayAreaTables`
|