@serve.zone/interfaces 32.125.0 → 32.127.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 +13 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/hetzner.d.ts +6 -0
- package/dist_ts/data/hetzner.js +17 -1
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/nattraversal.d.ts +98 -0
- package/dist_ts/data/nattraversal.js +172 -0
- package/dist_ts/platform/identity.d.ts +22 -0
- package/dist_ts/platform/identity.js +12 -1
- package/dist_ts/requests/hetzner.d.ts +7 -0
- package/dist_ts/requests/identity.d.ts +26 -1
- package/dist_ts/requests/index.d.ts +2 -1
- package/dist_ts/requests/index.js +3 -2
- package/dist_ts/requests/nattraversal.d.ts +47 -0
- package/dist_ts/requests/nattraversal.js +2 -0
- package/package.json +9 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/hetzner.ts +22 -0
- package/ts/data/index.ts +1 -0
- package/ts/data/nattraversal.ts +261 -0
- package/ts/platform/identity.ts +36 -0
- package/ts/requests/hetzner.ts +7 -0
- package/ts/requests/identity.ts +36 -0
- package/ts/requests/index.ts +2 -0
- package/ts/requests/nattraversal.ts +63 -0
|
@@ -6,6 +6,7 @@ import * as baseOsRequests from './baseos.js';
|
|
|
6
6
|
import * as backupRequests from './backup.js';
|
|
7
7
|
import * as backupMxRequests from './backupmx.js';
|
|
8
8
|
import * as hetznerRequests from './hetzner.js';
|
|
9
|
+
import * as natTraversalRequests from './nattraversal.js';
|
|
9
10
|
import * as certificateRequests from './certificate.js';
|
|
10
11
|
import * as certificateAuthorityRequests from './certificateauthority.js';
|
|
11
12
|
import * as pathRoutingRequests from './pathrouting.js';
|
|
@@ -49,7 +50,7 @@ import * as taskRequests from './task.js';
|
|
|
49
50
|
import * as versionRequests from './version.js';
|
|
50
51
|
import * as webPushRequests from './webpush.js';
|
|
51
52
|
import * as witnessRequests from './witness.js';
|
|
52
|
-
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, backupMxRequests as backupmx, hetznerRequests as hetzner, certificateRequests as certificate, certificateAuthorityRequests as certificateauthority, pathRoutingRequests as pathrouting, cloudAccessRequests as cloudaccess, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, controllerRequests as controller, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, externalDnsRequests as externaldns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, gatewayConnectorRequests as gatewayconnector, gatewayVpnRequests as gatewayvpn, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, witnessRequests as witness, };
|
|
53
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, backupMxRequests as backupmx, hetznerRequests as hetzner, natTraversalRequests as nattraversal, certificateRequests as certificate, certificateAuthorityRequests as certificateauthority, pathRoutingRequests as pathrouting, cloudAccessRequests as cloudaccess, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, controllerRequests as controller, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, externalDnsRequests as externaldns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, gatewayConnectorRequests as gatewayconnector, gatewayVpnRequests as gatewayvpn, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, witnessRequests as witness, };
|
|
53
54
|
export * from './inform.js';
|
|
54
55
|
export * from './hostedapp.js';
|
|
55
56
|
export * from './mail.js';
|
|
@@ -69,4 +70,4 @@ export * as corestorereplication from './corestorereplication.js';
|
|
|
69
70
|
export * as controlledtakeover from './controlledtakeover.js';
|
|
70
71
|
export * as diskencryption from './diskencryption.js';
|
|
71
72
|
export * as locationlock from './locationlock.js';
|
|
72
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxpQkFBaUIsTUFBTSxnQkFBZ0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxlQUFlLE1BQU0sY0FBYyxDQUFDO0FBQ2hELE9BQU8sS0FBS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sT0FBTyxLQUFLLG1CQUFtQixNQUFNLDBCQUEwQixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxnQkFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUMxRCxPQUFPLEtBQUssdUJBQXVCLE1BQU0sOEJBQThCLENBQUM7QUFDeEUsT0FBTyxLQUFLLFNBQVMsTUFBTSxnQkFBZ0IsQ0FBQztBQUM1QyxPQUFPLEtBQUssY0FBYyxNQUFNLHFCQUFxQixDQUFDO0FBQ3RELE9BQU8sS0FBSyxvQkFBb0IsTUFBTSwyQkFBMkIsQ0FBQztBQUNsRSxPQUFPLEtBQUssa0JBQWtCLE1BQU0seUJBQXlCLENBQUM7QUFDOUQsT0FBTyxLQUFLLGNBQWMsTUFBTSxxQkFBcUIsQ0FBQztBQUN0RCxPQUFPLEtBQUssWUFBWSxNQUFNLG1CQUFtQixDQUFDIn0=
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
|
|
2
|
+
import type { INatTraversalAnchorMap, INodeNatEndpointReport, IPeerNatEndpointMap } from '../data/nattraversal.js';
|
|
3
|
+
import type { IIdentityCredential } from '../data/user.js';
|
|
4
|
+
export interface IReq_Admin_Cloudly_GetNatTraversalAnchorMap extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_GetNatTraversalAnchorMap> {
|
|
5
|
+
method: 'getNatTraversalAnchorMap';
|
|
6
|
+
request: {
|
|
7
|
+
identity: IIdentityCredential;
|
|
8
|
+
};
|
|
9
|
+
response: {
|
|
10
|
+
anchorMap: INatTraversalAnchorMap;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface IReq_Node_Cloudly_ReportNatEndpoints extends implementsTR<ITypedRequest, IReq_Node_Cloudly_ReportNatEndpoints> {
|
|
14
|
+
method: 'reportNodeNatEndpoints';
|
|
15
|
+
request: {
|
|
16
|
+
identity: IIdentityCredential;
|
|
17
|
+
report: INodeNatEndpointReport;
|
|
18
|
+
};
|
|
19
|
+
response: {
|
|
20
|
+
ok: true;
|
|
21
|
+
acceptedGeneration: number;
|
|
22
|
+
anchorMapRevision: number;
|
|
23
|
+
} | {
|
|
24
|
+
ok: false;
|
|
25
|
+
code: 'unauthorized' | 'invalid-report' | 'stale-generation';
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface IReq_Node_Cloudly_GetPeerNatEndpointMap extends implementsTR<ITypedRequest, IReq_Node_Cloudly_GetPeerNatEndpointMap> {
|
|
30
|
+
method: 'getPeerNatEndpointMap';
|
|
31
|
+
request: {
|
|
32
|
+
identity: IIdentityCredential;
|
|
33
|
+
nodeId: string;
|
|
34
|
+
nodePublicKey: string;
|
|
35
|
+
scope: string;
|
|
36
|
+
/** Optional specific anchorId to scope the minted relay admission token, defaults to '*'. */
|
|
37
|
+
anchorScope?: string;
|
|
38
|
+
};
|
|
39
|
+
response: {
|
|
40
|
+
ok: true;
|
|
41
|
+
endpointMap: IPeerNatEndpointMap;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
code: 'unauthorized' | 'scope-not-found' | 'invalid-request';
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serve.zone/interfaces",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.127.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
|
|
6
6
|
"exports": {
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./dist_ts/data/hetzner.d.ts",
|
|
37
37
|
"default": "./dist_ts/data/hetzner.js"
|
|
38
38
|
},
|
|
39
|
+
"./data/nattraversal": {
|
|
40
|
+
"types": "./dist_ts/data/nattraversal.d.ts",
|
|
41
|
+
"default": "./dist_ts/data/nattraversal.js"
|
|
42
|
+
},
|
|
39
43
|
"./data/controlledtakeover": {
|
|
40
44
|
"types": "./dist_ts/data/controlledtakeover.d.ts",
|
|
41
45
|
"default": "./dist_ts/data/controlledtakeover.js"
|
|
@@ -116,6 +120,10 @@
|
|
|
116
120
|
"types": "./dist_ts/requests/hetzner.d.ts",
|
|
117
121
|
"default": "./dist_ts/requests/hetzner.js"
|
|
118
122
|
},
|
|
123
|
+
"./requests/nattraversal": {
|
|
124
|
+
"types": "./dist_ts/requests/nattraversal.d.ts",
|
|
125
|
+
"default": "./dist_ts/requests/nattraversal.js"
|
|
126
|
+
},
|
|
119
127
|
"./requests/controlledtakeover": {
|
|
120
128
|
"types": "./dist_ts/requests/controlledtakeover.d.ts",
|
|
121
129
|
"default": "./dist_ts/requests/controlledtakeover.js"
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/hetzner.ts
CHANGED
|
@@ -126,6 +126,12 @@ export interface IManagedHetznerRemoteIngressRoleConfig {
|
|
|
126
126
|
manualTcpPorts: number[];
|
|
127
127
|
manualUdpPorts: number[];
|
|
128
128
|
hubAllowedCidrs: string[];
|
|
129
|
+
/** Enable co-hosted RFC 5389 STUN responder + authenticated encrypted NAT relay on this edge. */
|
|
130
|
+
natRelayEnabled?: boolean;
|
|
131
|
+
/** UDP port for the co-hosted STUN responder (default 3478). */
|
|
132
|
+
stunPort?: number;
|
|
133
|
+
/** TCP/TLS port for the co-hosted encrypted packet relay (default 3479). */
|
|
134
|
+
relayPort?: number;
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
export interface IManagedHetznerBackupMxRoleConfig {
|
|
@@ -294,6 +300,10 @@ export function planManagedHetznerFirewallRules(
|
|
|
294
300
|
tcpPorts.add(443);
|
|
295
301
|
udpPorts.add(443);
|
|
296
302
|
}
|
|
303
|
+
if (roleConfigArg.natRelayEnabled) {
|
|
304
|
+
udpPorts.add(roleConfigArg.stunPort ?? 3478);
|
|
305
|
+
tcpPorts.add(roleConfigArg.relayPort ?? 3479);
|
|
306
|
+
}
|
|
297
307
|
for (const port of [...tcpPorts].sort((a, b) => a - b)) {
|
|
298
308
|
rules.push({
|
|
299
309
|
description: `RemoteIngress TCP ${port}`,
|
|
@@ -414,6 +424,18 @@ export function validateManagedHetznerHostDesired(desiredArg: IManagedHetznerHos
|
|
|
414
424
|
errors.push(`invalid hubAllowedCidr: ${cidr}`);
|
|
415
425
|
}
|
|
416
426
|
}
|
|
427
|
+
if (desiredArg.roleConfig.stunPort !== undefined) {
|
|
428
|
+
const p = desiredArg.roleConfig.stunPort;
|
|
429
|
+
if (!Number.isInteger(p) || p < 1 || p > 65535) {
|
|
430
|
+
errors.push(`invalid remoteingress stunPort: ${String(p)}`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (desiredArg.roleConfig.relayPort !== undefined) {
|
|
434
|
+
const p = desiredArg.roleConfig.relayPort;
|
|
435
|
+
if (!Number.isInteger(p) || p < 1 || p > 65535) {
|
|
436
|
+
errors.push(`invalid remoteingress relayPort: ${String(p)}`);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
417
439
|
}
|
|
418
440
|
return errors;
|
|
419
441
|
}
|
package/ts/data/index.ts
CHANGED
|
@@ -99,6 +99,7 @@ export * from './certificateauthority.js';
|
|
|
99
99
|
export * from './pathrouting.js';
|
|
100
100
|
export * from './backuprestorerefusal.js';
|
|
101
101
|
export * from './hetzner.js';
|
|
102
|
+
export * from './nattraversal.js';
|
|
102
103
|
export * from './clusternode.js';
|
|
103
104
|
export * from './clusternodehostname.js';
|
|
104
105
|
export * from './settings.js';
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { parseCanonicalIpAddress } from '../private/ipaddress.js';
|
|
2
|
+
|
|
3
|
+
export const natTraversalKinds = Object.freeze(['cone', 'symmetric', 'unknown'] as const);
|
|
4
|
+
export type TNatTraversalKind = typeof natTraversalKinds[number];
|
|
5
|
+
|
|
6
|
+
export const natEndpointCandidateKinds = Object.freeze(['lan', 'stun', 'static'] as const);
|
|
7
|
+
export type TNatEndpointCandidateKind = typeof natEndpointCandidateKinds[number];
|
|
8
|
+
|
|
9
|
+
export const natAnchorSources = Object.freeze(['hetzner-remoteingress', 'dcrouter-gateway'] as const);
|
|
10
|
+
export type TNatAnchorSource = typeof natAnchorSources[number];
|
|
11
|
+
|
|
12
|
+
export const natTraversalContract = Object.freeze({
|
|
13
|
+
defaultStunPort: 3478,
|
|
14
|
+
defaultRelayPort: 3479,
|
|
15
|
+
relayAlpn: 'servezone-relay/1',
|
|
16
|
+
tokenVersion: 1 as const,
|
|
17
|
+
defaultTokenTtlSecs: 3600,
|
|
18
|
+
maxTokenTtlSecs: 24 * 60 * 60,
|
|
19
|
+
maxAnchors: 32,
|
|
20
|
+
maxIssuerPublicKeys: 4,
|
|
21
|
+
maxCandidatesPerNode: 32,
|
|
22
|
+
endpointReportTtlMs: 5 * 60_000,
|
|
23
|
+
maximumIdLength: 128,
|
|
24
|
+
} as const);
|
|
25
|
+
|
|
26
|
+
export interface INatTraversalAnchor {
|
|
27
|
+
anchorId: string;
|
|
28
|
+
source: TNatAnchorSource;
|
|
29
|
+
region: string;
|
|
30
|
+
hostname: string;
|
|
31
|
+
ipv4: string | null;
|
|
32
|
+
ipv6: string | null;
|
|
33
|
+
stunPort: number;
|
|
34
|
+
relayPort: number;
|
|
35
|
+
/** `sha256:<43-char-base64url>` SPKI pin of the relay TLS identity, when reported. */
|
|
36
|
+
relayIdentityPin: string | null;
|
|
37
|
+
healthy: boolean;
|
|
38
|
+
updatedAt: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface INatTraversalAnchorMap {
|
|
42
|
+
revision: number;
|
|
43
|
+
generatedAt: number;
|
|
44
|
+
/** 1-2 active base64url-encoded 32-byte Ed25519 issuer public keys for offline relay verification. */
|
|
45
|
+
issuerPublicKeys: string[];
|
|
46
|
+
anchors: INatTraversalAnchor[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface INatRelayAdmissionClaims {
|
|
50
|
+
v: 1;
|
|
51
|
+
nodeId: string;
|
|
52
|
+
/** Base64url-encoded 32-byte node public key (unpadded). */
|
|
53
|
+
nodePublicKey: string;
|
|
54
|
+
/** `'*'` or a specific `anchorId`. */
|
|
55
|
+
anchorScope: string;
|
|
56
|
+
iat: number;
|
|
57
|
+
exp: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface INodeNatEndpointCandidate {
|
|
61
|
+
kind: TNatEndpointCandidateKind;
|
|
62
|
+
ip: string;
|
|
63
|
+
port: number;
|
|
64
|
+
anchorId?: string | null;
|
|
65
|
+
observedAt: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface INodeNatEndpointReport {
|
|
69
|
+
nodeId: string;
|
|
70
|
+
/** Base64url-encoded 32-byte node public key (unpadded). */
|
|
71
|
+
publicKey: string;
|
|
72
|
+
natKind: TNatTraversalKind;
|
|
73
|
+
homeRelayAnchorId: string | null;
|
|
74
|
+
candidates: INodeNatEndpointCandidate[];
|
|
75
|
+
generation: number;
|
|
76
|
+
reportedAt: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface IPeerNatEndpointEntry {
|
|
80
|
+
nodeId: string;
|
|
81
|
+
publicKey: string;
|
|
82
|
+
natKind: TNatTraversalKind;
|
|
83
|
+
homeRelayAnchorId: string | null;
|
|
84
|
+
candidates: INodeNatEndpointCandidate[];
|
|
85
|
+
generation: number;
|
|
86
|
+
reportedAt: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface IPeerNatEndpointMap {
|
|
90
|
+
scope: string;
|
|
91
|
+
revision: number;
|
|
92
|
+
generatedAt: number;
|
|
93
|
+
anchorMap: INatTraversalAnchorMap;
|
|
94
|
+
/** Short-lived Ed25519-signed relay admission token for the requesting node. */
|
|
95
|
+
relayAdmissionToken: string;
|
|
96
|
+
relayAdmissionTokenExpiresAt: number;
|
|
97
|
+
peers: IPeerNatEndpointEntry[];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const base64Url32BytePattern = /^[A-Za-z0-9_-]{43}$/;
|
|
101
|
+
const spkiPinPattern = /^sha256:[A-Za-z0-9_-]{43}$/;
|
|
102
|
+
const safeIdPattern = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
|
|
103
|
+
|
|
104
|
+
export function isValidBase64Url32ByteKey(valueArg: unknown): valueArg is string {
|
|
105
|
+
return typeof valueArg === 'string' && base64Url32BytePattern.test(valueArg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function isValidRelayIdentityPin(valueArg: unknown): valueArg is string {
|
|
109
|
+
return typeof valueArg === 'string' && spkiPinPattern.test(valueArg);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function isValidNatPort(valueArg: unknown): valueArg is number {
|
|
113
|
+
return typeof valueArg === 'number' && Number.isInteger(valueArg) && valueArg >= 1 && valueArg <= 65535;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function validateNatTraversalAnchor(anchorArg: INatTraversalAnchor): string[] {
|
|
117
|
+
const errors: string[] = [];
|
|
118
|
+
if (!safeIdPattern.test(anchorArg.anchorId)) {
|
|
119
|
+
errors.push('anchorId must be a safe identifier (1-128 chars)');
|
|
120
|
+
}
|
|
121
|
+
if (!(natAnchorSources as readonly string[]).includes(anchorArg.source)) {
|
|
122
|
+
errors.push(`invalid anchor source: ${String(anchorArg.source)}`);
|
|
123
|
+
}
|
|
124
|
+
if (!anchorArg.region || anchorArg.region.length > 64) {
|
|
125
|
+
errors.push('region must be a non-empty string (<= 64 chars)');
|
|
126
|
+
}
|
|
127
|
+
if (!anchorArg.hostname || anchorArg.hostname.length > 253) {
|
|
128
|
+
errors.push('hostname must be a non-empty string (<= 253 chars)');
|
|
129
|
+
}
|
|
130
|
+
if (anchorArg.ipv4 === null && anchorArg.ipv6 === null) {
|
|
131
|
+
errors.push('anchor must have at least one of ipv4 or ipv6');
|
|
132
|
+
}
|
|
133
|
+
if (anchorArg.ipv4 !== null) {
|
|
134
|
+
const parsed = parseCanonicalIpAddress(anchorArg.ipv4);
|
|
135
|
+
if (!parsed || parsed.family !== 4) {
|
|
136
|
+
errors.push(`invalid anchor ipv4: ${anchorArg.ipv4}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (anchorArg.ipv6 !== null) {
|
|
140
|
+
const parsed = parseCanonicalIpAddress(anchorArg.ipv6);
|
|
141
|
+
if (!parsed || parsed.family !== 6) {
|
|
142
|
+
errors.push(`invalid anchor ipv6: ${anchorArg.ipv6}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (!isValidNatPort(anchorArg.stunPort)) {
|
|
146
|
+
errors.push(`invalid stunPort: ${String(anchorArg.stunPort)}`);
|
|
147
|
+
}
|
|
148
|
+
if (!isValidNatPort(anchorArg.relayPort)) {
|
|
149
|
+
errors.push(`invalid relayPort: ${String(anchorArg.relayPort)}`);
|
|
150
|
+
}
|
|
151
|
+
if (anchorArg.relayIdentityPin !== null && !isValidRelayIdentityPin(anchorArg.relayIdentityPin)) {
|
|
152
|
+
errors.push('relayIdentityPin must be sha256:<43-char base64url> or null');
|
|
153
|
+
}
|
|
154
|
+
if (!Number.isSafeInteger(anchorArg.updatedAt) || anchorArg.updatedAt < 0) {
|
|
155
|
+
errors.push('updatedAt must be a non-negative integer timestamp');
|
|
156
|
+
}
|
|
157
|
+
return errors;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function validateNatTraversalAnchorMap(mapArg: INatTraversalAnchorMap): string[] {
|
|
161
|
+
const errors: string[] = [];
|
|
162
|
+
if (!Number.isSafeInteger(mapArg.revision) || mapArg.revision < 0) {
|
|
163
|
+
errors.push('revision must be a non-negative safe integer');
|
|
164
|
+
}
|
|
165
|
+
if (!Number.isSafeInteger(mapArg.generatedAt) || mapArg.generatedAt < 0) {
|
|
166
|
+
errors.push('generatedAt must be a non-negative safe integer');
|
|
167
|
+
}
|
|
168
|
+
if (
|
|
169
|
+
!Array.isArray(mapArg.issuerPublicKeys)
|
|
170
|
+
|| mapArg.issuerPublicKeys.length === 0
|
|
171
|
+
|| mapArg.issuerPublicKeys.length > natTraversalContract.maxIssuerPublicKeys
|
|
172
|
+
) {
|
|
173
|
+
errors.push('issuerPublicKeys must contain 1-4 valid 32-byte base64url Ed25519 keys');
|
|
174
|
+
} else {
|
|
175
|
+
mapArg.issuerPublicKeys.forEach((key, idx) => {
|
|
176
|
+
if (!isValidBase64Url32ByteKey(key)) {
|
|
177
|
+
errors.push(`issuerPublicKeys[${idx}] must be a 43-char unpadded base64url 32-byte key`);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
if (!Array.isArray(mapArg.anchors) || mapArg.anchors.length > natTraversalContract.maxAnchors) {
|
|
182
|
+
errors.push(`anchors must be an array of at most ${natTraversalContract.maxAnchors} entries`);
|
|
183
|
+
} else {
|
|
184
|
+
const seen = new Set<string>();
|
|
185
|
+
for (const anchor of mapArg.anchors) {
|
|
186
|
+
if (seen.has(anchor.anchorId)) {
|
|
187
|
+
errors.push(`duplicate anchorId: ${anchor.anchorId}`);
|
|
188
|
+
}
|
|
189
|
+
seen.add(anchor.anchorId);
|
|
190
|
+
errors.push(...validateNatTraversalAnchor(anchor));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return errors;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function validateNodeNatEndpointReport(reportArg: INodeNatEndpointReport): string[] {
|
|
197
|
+
const errors: string[] = [];
|
|
198
|
+
if (!safeIdPattern.test(reportArg.nodeId)) {
|
|
199
|
+
errors.push('nodeId must be a safe identifier (1-128 chars)');
|
|
200
|
+
}
|
|
201
|
+
if (!isValidBase64Url32ByteKey(reportArg.publicKey)) {
|
|
202
|
+
errors.push('publicKey must be a 43-char unpadded base64url 32-byte key');
|
|
203
|
+
}
|
|
204
|
+
if (!(natTraversalKinds as readonly string[]).includes(reportArg.natKind)) {
|
|
205
|
+
errors.push(`invalid natKind: ${String(reportArg.natKind)}`);
|
|
206
|
+
}
|
|
207
|
+
if (reportArg.homeRelayAnchorId !== null && !safeIdPattern.test(reportArg.homeRelayAnchorId)) {
|
|
208
|
+
errors.push('homeRelayAnchorId must be a safe identifier or null');
|
|
209
|
+
}
|
|
210
|
+
if (!Number.isSafeInteger(reportArg.generation) || reportArg.generation < 1) {
|
|
211
|
+
errors.push('generation must be a positive safe integer');
|
|
212
|
+
}
|
|
213
|
+
if (!Number.isSafeInteger(reportArg.reportedAt) || reportArg.reportedAt < 0) {
|
|
214
|
+
errors.push('reportedAt must be a non-negative integer timestamp');
|
|
215
|
+
}
|
|
216
|
+
if (
|
|
217
|
+
!Array.isArray(reportArg.candidates)
|
|
218
|
+
|| reportArg.candidates.length > natTraversalContract.maxCandidatesPerNode
|
|
219
|
+
) {
|
|
220
|
+
errors.push(`candidates must contain at most ${natTraversalContract.maxCandidatesPerNode} entries`);
|
|
221
|
+
} else {
|
|
222
|
+
for (let i = 0; i < reportArg.candidates.length; i++) {
|
|
223
|
+
const c = reportArg.candidates[i];
|
|
224
|
+
if (!(natEndpointCandidateKinds as readonly string[]).includes(c.kind)) {
|
|
225
|
+
errors.push(`candidates[${i}].kind is invalid`);
|
|
226
|
+
}
|
|
227
|
+
if (!parseCanonicalIpAddress(c.ip)) {
|
|
228
|
+
errors.push(`candidates[${i}].ip is not a canonical IP address`);
|
|
229
|
+
}
|
|
230
|
+
if (!isValidNatPort(c.port)) {
|
|
231
|
+
errors.push(`candidates[${i}].port is invalid`);
|
|
232
|
+
}
|
|
233
|
+
if (c.anchorId !== undefined && c.anchorId !== null && !safeIdPattern.test(c.anchorId)) {
|
|
234
|
+
errors.push(`candidates[${i}].anchorId is invalid`);
|
|
235
|
+
}
|
|
236
|
+
if (!Number.isSafeInteger(c.observedAt) || c.observedAt < 0) {
|
|
237
|
+
errors.push(`candidates[${i}].observedAt is invalid`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return errors;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Pure NAT classification from 2+ STUN reflexive candidates observed via distinct anchors
|
|
246
|
+
* on the same local UDP socket: identical `(ip, port)` across anchors indicates cone
|
|
247
|
+
* (endpoint-independent) NAT; differing mappings indicate symmetric (endpoint-dependent) NAT.
|
|
248
|
+
*/
|
|
249
|
+
export function classifyNatFromStunCandidates(
|
|
250
|
+
candidatesArg: ReadonlyArray<Pick<INodeNatEndpointCandidate, 'kind' | 'ip' | 'port' | 'anchorId'>>,
|
|
251
|
+
): TNatTraversalKind {
|
|
252
|
+
const stunByAnchor = new Map<string, { ip: string; port: number }>();
|
|
253
|
+
for (const c of candidatesArg) {
|
|
254
|
+
if (c.kind !== 'stun' || !c.anchorId) continue;
|
|
255
|
+
stunByAnchor.set(c.anchorId, { ip: c.ip, port: c.port });
|
|
256
|
+
}
|
|
257
|
+
if (stunByAnchor.size < 2) return 'unknown';
|
|
258
|
+
const values = [...stunByAnchor.values()];
|
|
259
|
+
const first = values[0];
|
|
260
|
+
return values.every((v) => v.ip === first.ip && v.port === first.port) ? 'cone' : 'symmetric';
|
|
261
|
+
}
|
package/ts/platform/identity.ts
CHANGED
|
@@ -61,6 +61,26 @@ export interface IPlatformIdentityBindingState {
|
|
|
61
61
|
updatedAt: number;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Access policy controlling how Cloudly authorizes upstream `idp.global` sign-ins.
|
|
66
|
+
*
|
|
67
|
+
* Infrastructure administrator access NEVER comes from unscoped cross-organization ID-token
|
|
68
|
+
* `app_roles`. Instead, Cloudly authorizes:
|
|
69
|
+
* 1. Explicitly bound Cloudly human users (`PlatformOidcSubjectBinding`), using their Cloudly role.
|
|
70
|
+
* 2. Members of the explicitly pinned `operatorOrganizationId` holding mapped `admin` role
|
|
71
|
+
* verified via live org-scoped `idp.global` introspection (`authority_version=2`).
|
|
72
|
+
* 3. Scoped multi-tenant `'user'` accounts only when `allowUnboundTenantUsers` is explicitly enabled
|
|
73
|
+
* (defaults to `false`; never grants `'admin'`).
|
|
74
|
+
*/
|
|
75
|
+
export interface IPlatformOidcAccessPolicy {
|
|
76
|
+
/** Single `idp.global` team organization ID trusted to grant Cloudly `admin` via org-scoped introspection. */
|
|
77
|
+
operatorOrganizationId?: string;
|
|
78
|
+
/** Whether unbound `idp.global` users outside `operatorOrganizationId` may sign in as scoped `'user'`s. */
|
|
79
|
+
allowUnboundTenantUsers: boolean;
|
|
80
|
+
/** Source of the active `operatorOrganizationId` (`'config'`, `'env'`, or `null` when unset). */
|
|
81
|
+
operatorOrganizationSource?: 'config' | 'env' | null;
|
|
82
|
+
}
|
|
83
|
+
|
|
64
84
|
/** Value-free administrative status of Cloudly's platform identity registration provider. */
|
|
65
85
|
export interface IPlatformIdentityProviderStatus {
|
|
66
86
|
/** Canonical DER SPKI standard base64 RSA-OAEP-256 public key for sealing credentials to Cloudly. */
|
|
@@ -74,6 +94,7 @@ export interface IPlatformIdentityProviderStatus {
|
|
|
74
94
|
installedAt?: number;
|
|
75
95
|
lastRotatedAt?: number;
|
|
76
96
|
lastError?: string;
|
|
97
|
+
accessPolicy?: IPlatformOidcAccessPolicy;
|
|
77
98
|
}
|
|
78
99
|
|
|
79
100
|
/** Value-free administrative view of one service's platform identity binding. */
|
|
@@ -303,3 +324,18 @@ export const validateSealedPlatformIdentityCredentialEnvelope = (
|
|
|
303
324
|
}
|
|
304
325
|
return errors;
|
|
305
326
|
};
|
|
327
|
+
|
|
328
|
+
/** Validates an explicit `idp.global` operator organization ID for Cloudly infrastructure admin SSO. */
|
|
329
|
+
export const validatePlatformOidcOperatorOrganizationId = (
|
|
330
|
+
organizationIdArg: unknown,
|
|
331
|
+
pathArg = 'operatorOrganizationId',
|
|
332
|
+
): string[] => {
|
|
333
|
+
if (typeof organizationIdArg !== 'string'
|
|
334
|
+
|| organizationIdArg.length === 0
|
|
335
|
+
|| organizationIdArg.length > 200
|
|
336
|
+
|| organizationIdArg.trim() !== organizationIdArg
|
|
337
|
+
|| !/^[A-Za-z0-9][A-Za-z0-9:._-]{0,199}$/.test(organizationIdArg)) {
|
|
338
|
+
return [`${pathArg} must be a canonical organization identifier`];
|
|
339
|
+
}
|
|
340
|
+
return [];
|
|
341
|
+
};
|
package/ts/requests/hetzner.ts
CHANGED
|
@@ -232,6 +232,13 @@ export type TManagedHostEnrollmentBootstrapPayload =
|
|
|
232
232
|
edgeId: string;
|
|
233
233
|
connectionToken: string;
|
|
234
234
|
egressSourceIpv4: string | null;
|
|
235
|
+
natRelay?: {
|
|
236
|
+
enabled: true;
|
|
237
|
+
anchorId: string;
|
|
238
|
+
stunPort: number;
|
|
239
|
+
relayPort: number;
|
|
240
|
+
issuerPublicKeys: string[];
|
|
241
|
+
};
|
|
235
242
|
}
|
|
236
243
|
| {
|
|
237
244
|
role: 'backupmx';
|
package/ts/requests/identity.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as userInterfaces from '../data/user.js';
|
|
|
3
3
|
import type {
|
|
4
4
|
IPlatformIdentityProviderStatus,
|
|
5
5
|
IPlatformIdentityServiceBindingView,
|
|
6
|
+
IPlatformOidcAccessPolicy,
|
|
6
7
|
ISealedPlatformIdentityCredentialEnvelope,
|
|
7
8
|
} from '../platform/identity.js';
|
|
8
9
|
|
|
@@ -151,3 +152,38 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
151
152
|
binding: IPlatformIdentityServiceBindingView;
|
|
152
153
|
};
|
|
153
154
|
}
|
|
155
|
+
|
|
156
|
+
/** Read Cloudly's upstream Platform OIDC (`idp.global`) access policy (admin-only). */
|
|
157
|
+
export interface IReq_Admin_GetPlatformOidcAccessPolicy
|
|
158
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
159
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
160
|
+
IReq_Admin_GetPlatformOidcAccessPolicy
|
|
161
|
+
> {
|
|
162
|
+
method: 'getPlatformOidcAccessPolicy';
|
|
163
|
+
request: {
|
|
164
|
+
identity: userInterfaces.IIdentityCredential;
|
|
165
|
+
};
|
|
166
|
+
response: {
|
|
167
|
+
policy: IPlatformOidcAccessPolicy;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Update Cloudly's upstream Platform OIDC (`idp.global`) access policy (admin-only, fresh sign-in).
|
|
173
|
+
* Pass `operatorOrganizationId: null` to clear a persisted operator organization pin.
|
|
174
|
+
*/
|
|
175
|
+
export interface IReq_Admin_SetPlatformOidcAccessPolicy
|
|
176
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
177
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
178
|
+
IReq_Admin_SetPlatformOidcAccessPolicy
|
|
179
|
+
> {
|
|
180
|
+
method: 'setPlatformOidcAccessPolicy';
|
|
181
|
+
request: {
|
|
182
|
+
identity: userInterfaces.IIdentityCredential;
|
|
183
|
+
operatorOrganizationId?: string | null;
|
|
184
|
+
allowUnboundTenantUsers?: boolean;
|
|
185
|
+
};
|
|
186
|
+
response: {
|
|
187
|
+
policy: IPlatformOidcAccessPolicy;
|
|
188
|
+
};
|
|
189
|
+
}
|
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 backupMxRequests from './backupmx.js';
|
|
9
9
|
import * as hetznerRequests from './hetzner.js';
|
|
10
|
+
import * as natTraversalRequests from './nattraversal.js';
|
|
10
11
|
import * as certificateRequests from './certificate.js';
|
|
11
12
|
import * as certificateAuthorityRequests from './certificateauthority.js';
|
|
12
13
|
import * as pathRoutingRequests from './pathrouting.js';
|
|
@@ -59,6 +60,7 @@ export {
|
|
|
59
60
|
backupRequests as backup,
|
|
60
61
|
backupMxRequests as backupmx,
|
|
61
62
|
hetznerRequests as hetzner,
|
|
63
|
+
natTraversalRequests as nattraversal,
|
|
62
64
|
certificateRequests as certificate,
|
|
63
65
|
certificateAuthorityRequests as certificateauthority,
|
|
64
66
|
pathRoutingRequests as pathrouting,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
|
|
2
|
+
import type {
|
|
3
|
+
INatTraversalAnchorMap,
|
|
4
|
+
INodeNatEndpointReport,
|
|
5
|
+
IPeerNatEndpointMap,
|
|
6
|
+
} from '../data/nattraversal.js';
|
|
7
|
+
import type { IIdentityCredential } from '../data/user.js';
|
|
8
|
+
|
|
9
|
+
export interface IReq_Admin_Cloudly_GetNatTraversalAnchorMap extends implementsTR<
|
|
10
|
+
ITypedRequest,
|
|
11
|
+
IReq_Admin_Cloudly_GetNatTraversalAnchorMap
|
|
12
|
+
> {
|
|
13
|
+
method: 'getNatTraversalAnchorMap';
|
|
14
|
+
request: {
|
|
15
|
+
identity: IIdentityCredential;
|
|
16
|
+
};
|
|
17
|
+
response: {
|
|
18
|
+
anchorMap: INatTraversalAnchorMap;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IReq_Node_Cloudly_ReportNatEndpoints extends implementsTR<
|
|
23
|
+
ITypedRequest,
|
|
24
|
+
IReq_Node_Cloudly_ReportNatEndpoints
|
|
25
|
+
> {
|
|
26
|
+
method: 'reportNodeNatEndpoints';
|
|
27
|
+
request: {
|
|
28
|
+
identity: IIdentityCredential;
|
|
29
|
+
report: INodeNatEndpointReport;
|
|
30
|
+
};
|
|
31
|
+
response: {
|
|
32
|
+
ok: true;
|
|
33
|
+
acceptedGeneration: number;
|
|
34
|
+
anchorMapRevision: number;
|
|
35
|
+
} | {
|
|
36
|
+
ok: false;
|
|
37
|
+
code: 'unauthorized' | 'invalid-report' | 'stale-generation';
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IReq_Node_Cloudly_GetPeerNatEndpointMap extends implementsTR<
|
|
43
|
+
ITypedRequest,
|
|
44
|
+
IReq_Node_Cloudly_GetPeerNatEndpointMap
|
|
45
|
+
> {
|
|
46
|
+
method: 'getPeerNatEndpointMap';
|
|
47
|
+
request: {
|
|
48
|
+
identity: IIdentityCredential;
|
|
49
|
+
nodeId: string;
|
|
50
|
+
nodePublicKey: string;
|
|
51
|
+
scope: string;
|
|
52
|
+
/** Optional specific anchorId to scope the minted relay admission token, defaults to '*'. */
|
|
53
|
+
anchorScope?: string;
|
|
54
|
+
};
|
|
55
|
+
response: {
|
|
56
|
+
ok: true;
|
|
57
|
+
endpointMap: IPeerNatEndpointMap;
|
|
58
|
+
} | {
|
|
59
|
+
ok: false;
|
|
60
|
+
code: 'unauthorized' | 'scope-not-found' | 'invalid-request';
|
|
61
|
+
message: string;
|
|
62
|
+
};
|
|
63
|
+
}
|