@ornncompute/cli 1.0.152 → 1.0.154
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/README.md +10 -1
- package/package.json +1 -1
- package/src/catalog-shell.mjs +8 -52
- package/src/evidence-commands.mjs +6 -50
- package/src/vm-commands.mjs +57 -13
- package/vendor/api-client/orchestrator.js +32 -1
- package/vendor/capabilities/cli.js +77 -0
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@ Native Commerce requests use the caller’s bearer directly through the gateway:
|
|
|
16
16
|
The gateway and Commerce enforce the caller’s organization and staff permissions.
|
|
17
17
|
Listing output follows the live session's
|
|
18
18
|
[visibility rules in the internal reference](../../docs/cli.md#staff-namespace).
|
|
19
|
+
Output validation and diagnostics use the
|
|
20
|
+
[shared output-field rules](../../packages/capabilities/src/output-safety.ts).
|
|
19
21
|
All Commerce operations use `@ornn/api-client/commerce`, including the reservation
|
|
20
22
|
reads inside launch, connect, and evidence flows. Customer reservation pickers
|
|
21
23
|
explicitly scope every page to the selected organization, including for staff.
|
|
@@ -73,7 +75,8 @@ use the same context. Reserve browsing and purchasing still require approval.
|
|
|
73
75
|
|
|
74
76
|
Node and VM requests use `@ornn/api-client/orchestrator`; CLI selection, polling,
|
|
75
77
|
and SSH remain here. VM readiness comes from the guest resource, separately from
|
|
76
|
-
physical-host readiness.
|
|
78
|
+
physical-host readiness. Bare Metal uses the node's SSH endpoint and waits
|
|
79
|
+
when the service reports that the endpoint is unavailable. See [machine behavior](../../docs/cli.md#customer-workflows).
|
|
77
80
|
|
|
78
81
|
Advanced customer resources are registered under one noun and one verb:
|
|
79
82
|
|
|
@@ -491,3 +494,9 @@ local key, obtains a 15-minute certificate through the gateway and launches
|
|
|
491
494
|
OpenSSH with normal host-key verification. Nodes configured for the staff SSH
|
|
492
495
|
relay connect through Orchestrator automatically. Temporary files are removed
|
|
493
496
|
when the command exits.
|
|
497
|
+
|
|
498
|
+
Gateway-bound connections resolve their gateway before producing SSH commands.
|
|
499
|
+
Forwarded endpoints remain a single SSH destination. Supplier-provided jump hosts
|
|
500
|
+
use `ssh -J user@gateway:port -p port user@private-host`; authenticate to the jump
|
|
501
|
+
with its existing SSH key or agent. Enrollment does not install customer keys on
|
|
502
|
+
a supplier-provided jump host.
|
package/package.json
CHANGED
package/src/catalog-shell.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getCliSession } from "../vendor/api-client/authorization.js";
|
|
2
|
+
import { isCustomerSensitiveField } from "../vendor/capabilities/cli.js";
|
|
2
3
|
import { readFileSync } from "node:fs";
|
|
3
4
|
|
|
4
5
|
import {
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
executeExternalBucketCommand,
|
|
38
39
|
writeExternalBucketResultHuman,
|
|
39
40
|
} from "./external-bucket-commands.mjs";
|
|
40
|
-
import { executeEvidenceCommand
|
|
41
|
+
import { executeEvidenceCommand } from "./evidence-commands.mjs";
|
|
41
42
|
import { executeRegistryCommand } from "./registry-commands.mjs";
|
|
42
43
|
import {
|
|
43
44
|
executeKubernetesClusterCommand,
|
|
@@ -743,51 +744,6 @@ function writeCommandHuman(stdout, stderr, capability, execution) {
|
|
|
743
744
|
}
|
|
744
745
|
}
|
|
745
746
|
|
|
746
|
-
const CUSTOMER_FORBIDDEN_FIELDS = {
|
|
747
|
-
client_secret: true,
|
|
748
|
-
clientSecret: true,
|
|
749
|
-
payment_secret: true,
|
|
750
|
-
paymentSecret: true,
|
|
751
|
-
organizationName: true,
|
|
752
|
-
organization_name: true,
|
|
753
|
-
internal_owner: true,
|
|
754
|
-
internalOwner: true,
|
|
755
|
-
payment_intent_client_secret: true,
|
|
756
|
-
checkout_key: true,
|
|
757
|
-
checkoutKey: true,
|
|
758
|
-
provider_id: true,
|
|
759
|
-
provider_name: true,
|
|
760
|
-
providerId: true,
|
|
761
|
-
providerName: true,
|
|
762
|
-
paymentIntentClientSecret: true,
|
|
763
|
-
payment_provider: true,
|
|
764
|
-
paymentProvider: true,
|
|
765
|
-
provider: true,
|
|
766
|
-
site_supplier: true,
|
|
767
|
-
siteSupplier: true,
|
|
768
|
-
site_supplier_id: true,
|
|
769
|
-
site_supplier_name: true,
|
|
770
|
-
siteSupplierId: true,
|
|
771
|
-
siteSupplierName: true,
|
|
772
|
-
reconciliation: true,
|
|
773
|
-
reconciliation_status: true,
|
|
774
|
-
reconciliationStatus: true,
|
|
775
|
-
stripe_client_secret: true,
|
|
776
|
-
stripeClientSecret: true,
|
|
777
|
-
stripe_invoice_id: true,
|
|
778
|
-
stripeInvoiceId: true,
|
|
779
|
-
supplier: true,
|
|
780
|
-
supplier_id: true,
|
|
781
|
-
supplier_name: true,
|
|
782
|
-
supplierId: true,
|
|
783
|
-
supplierName: true,
|
|
784
|
-
supplier_organization_id: true,
|
|
785
|
-
supplier_organization_name: true,
|
|
786
|
-
supplierOrganizationId: true,
|
|
787
|
-
supplierOrganizationName: true,
|
|
788
|
-
};
|
|
789
|
-
const SUPPLIER_OWNER_FIELDS = { organizationId: true, organization_id: true };
|
|
790
|
-
|
|
791
747
|
// Native listings expose supplierId to their owner and to verified staff.
|
|
792
748
|
function assertCustomerResultSafe(value, listingSession) {
|
|
793
749
|
if (Array.isArray(value)) {
|
|
@@ -796,7 +752,6 @@ function assertCustomerResultSafe(value, listingSession) {
|
|
|
796
752
|
}
|
|
797
753
|
if (!value || typeof value !== "object") return;
|
|
798
754
|
const ownOrganizationId = listingSession?.selectedOrganization?.id;
|
|
799
|
-
const ownedBySupplier = supplierOwnedRecord(value);
|
|
800
755
|
for (const [key, child] of Object.entries(value)) {
|
|
801
756
|
if (
|
|
802
757
|
key === "supplierId" &&
|
|
@@ -806,11 +761,12 @@ function assertCustomerResultSafe(value, listingSession) {
|
|
|
806
761
|
)
|
|
807
762
|
continue;
|
|
808
763
|
if (
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
764
|
+
(key === "organizationId" || key === "organization_id") &&
|
|
765
|
+
ownOrganizationId &&
|
|
766
|
+
child === ownOrganizationId
|
|
767
|
+
)
|
|
768
|
+
continue;
|
|
769
|
+
if (isCustomerSensitiveField(value, key)) {
|
|
814
770
|
throw new VnextContractError(
|
|
815
771
|
"The gateway returned an unexpected response shape.",
|
|
816
772
|
"customer_result_unsafe"
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
clusterListCapability,
|
|
3
3
|
metricsSnapshotCapability,
|
|
4
4
|
metricsHistoryCapability,
|
|
5
|
+
isCustomerSensitiveField,
|
|
5
6
|
} from "../vendor/capabilities/cli.js";
|
|
6
7
|
import * as gatewayApi from "../vendor/api-client/gateway.js";
|
|
7
8
|
import { gpuLabeler } from "./gpu-catalog.mjs";
|
|
@@ -38,29 +39,6 @@ const UNSAFE_LOG_MESSAGE = [
|
|
|
38
39
|
/\/(?:internal|v1\/(?:orchestrator|observability|cli\/operator))(?:\/|\b)/i,
|
|
39
40
|
/\b(?:staff_activity|staff activity|internal route|route)\s*[:=]/i,
|
|
40
41
|
];
|
|
41
|
-
const UNSAFE_KEYS = new Set([
|
|
42
|
-
"authorization",
|
|
43
|
-
"clientsecret",
|
|
44
|
-
"organizationname",
|
|
45
|
-
"password",
|
|
46
|
-
"paymentsecret",
|
|
47
|
-
"privatekey",
|
|
48
|
-
"provider",
|
|
49
|
-
"providerid",
|
|
50
|
-
"providername",
|
|
51
|
-
"refreshtoken",
|
|
52
|
-
"sitesupplier",
|
|
53
|
-
"sitesupplierid",
|
|
54
|
-
"sitesuppliername",
|
|
55
|
-
"staffactivity",
|
|
56
|
-
"stripeclientsecret",
|
|
57
|
-
"supplier",
|
|
58
|
-
"supplierid",
|
|
59
|
-
"suppliername",
|
|
60
|
-
"supplierorganizationid",
|
|
61
|
-
"supplierorganizationname",
|
|
62
|
-
"token",
|
|
63
|
-
]);
|
|
64
42
|
const STABLE_SOURCE_CODES = new Set([
|
|
65
43
|
"invalid_logs_response",
|
|
66
44
|
"invalid_metrics_response",
|
|
@@ -78,38 +56,16 @@ function text(value) {
|
|
|
78
56
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
79
57
|
}
|
|
80
58
|
|
|
81
|
-
function normalizedKey(value) {
|
|
82
|
-
return String(value)
|
|
83
|
-
.replaceAll(/[^a-z0-9]/gi, "")
|
|
84
|
-
.toLowerCase();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// A node, listing, or facility's organization is its supplier; a reservation's
|
|
88
|
-
// or drive's is the buyer, which the caller may see.
|
|
89
|
-
export function supplierOwnedRecord(value) {
|
|
90
|
-
const keys = new Set(Object.keys(record(value)).map(normalizedKey));
|
|
91
|
-
if (keys.has("driveid")) return false;
|
|
92
|
-
if (keys.has("nodeid")) return true;
|
|
93
|
-
if (keys.has("reservationid")) return false;
|
|
94
|
-
return keys.has("listingid") || keys.has("facilityid");
|
|
95
|
-
}
|
|
96
|
-
|
|
97
59
|
function containsUnsafeFields(value) {
|
|
98
60
|
if (Array.isArray(value)) return value.some(containsUnsafeFields);
|
|
99
61
|
if (!value || typeof value !== "object") return false;
|
|
100
|
-
const ownedBySupplier = supplierOwnedRecord(value);
|
|
101
62
|
return Object.entries(value).some(([key, child]) => {
|
|
102
|
-
const normalized =
|
|
63
|
+
const normalized = key.replaceAll(/[^a-z0-9]/gi, "").toLowerCase();
|
|
103
64
|
return (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
normalized
|
|
107
|
-
normalized
|
|
108
|
-
normalized.includes("password") ||
|
|
109
|
-
normalized.includes("privatekey") ||
|
|
110
|
-
normalized.includes("apikey") ||
|
|
111
|
-
normalized.includes("accesskey") ||
|
|
112
|
-
normalized.includes("credential") ||
|
|
65
|
+
isCustomerSensitiveField(value, key) ||
|
|
66
|
+
normalized === "authorization" ||
|
|
67
|
+
normalized === "staffactivity" ||
|
|
68
|
+
/secret|token|password|privatekey|apikey|accesskey|credential/.test(normalized) ||
|
|
113
69
|
containsUnsafeFields(child)
|
|
114
70
|
);
|
|
115
71
|
});
|
package/src/vm-commands.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
sshArguments,
|
|
2
3
|
accessActivateCapability,
|
|
3
4
|
accessShowCapability,
|
|
4
5
|
machineSwitchCapability,
|
|
@@ -180,6 +181,7 @@ function machineUsername(value) {
|
|
|
180
181
|
|
|
181
182
|
function machineHost(value) {
|
|
182
183
|
const machine = record(value);
|
|
184
|
+
if (machine.ssh_endpoint === null) return null;
|
|
183
185
|
const endpoint = sshText(machine.ssh_endpoint);
|
|
184
186
|
if (endpoint) {
|
|
185
187
|
const at = endpoint.indexOf("@");
|
|
@@ -213,7 +215,7 @@ function shellQuote(value) {
|
|
|
213
215
|
: `\u0027${raw.replace(/\u0027/g, "\u0027\\\u0027\u0027")}\u0027`;
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
function sshInvocation(machine, input = {}) {
|
|
218
|
+
function sshInvocation(machine, input = {}, gateway) {
|
|
217
219
|
const host = machineHost(machine);
|
|
218
220
|
if (host) {
|
|
219
221
|
const user = sshText(input.user) ?? machineUsername(machine) ?? "root";
|
|
@@ -227,6 +229,14 @@ function sshInvocation(machine, input = {}) {
|
|
|
227
229
|
if (text(input.identityFile)) args.push("-i", expandPath(input.identityFile));
|
|
228
230
|
const port = machinePort(machine);
|
|
229
231
|
if (port !== 22) args.push("-p", String(port));
|
|
232
|
+
const accessArgs = sshArguments({
|
|
233
|
+
host,
|
|
234
|
+
username: user,
|
|
235
|
+
port,
|
|
236
|
+
gatewayId: gateway?.id,
|
|
237
|
+
gateway,
|
|
238
|
+
});
|
|
239
|
+
if (gateway?.ssh_access_mode === "jump") args.push(...accessArgs.slice(0, 2));
|
|
230
240
|
args.push("--", `${user}@${host}`);
|
|
231
241
|
return { command: "ssh", args };
|
|
232
242
|
}
|
|
@@ -956,10 +966,21 @@ function machineReplayState(machines, key, input, interaction, expectedMode, res
|
|
|
956
966
|
};
|
|
957
967
|
}
|
|
958
968
|
|
|
959
|
-
function launchData(
|
|
969
|
+
async function launchData(
|
|
970
|
+
context,
|
|
971
|
+
reservation,
|
|
972
|
+
machine,
|
|
973
|
+
key,
|
|
974
|
+
waitPolicy,
|
|
975
|
+
replayed,
|
|
976
|
+
virtualMachine
|
|
977
|
+
) {
|
|
978
|
+
const gateway = machine.ssh_gateway_id
|
|
979
|
+
? await orchestrator.getSupplierGateway(context.fetch, machine.ssh_gateway_id)
|
|
980
|
+
: undefined;
|
|
960
981
|
const reservationId = text(reservation.reservationId);
|
|
961
982
|
const invocation = isSshReady(machine, key, virtualMachine)
|
|
962
|
-
? sshInvocation(virtualMachine)
|
|
983
|
+
? sshInvocation(virtualMachine, {}, gateway)
|
|
963
984
|
: null;
|
|
964
985
|
return {
|
|
965
986
|
mode: "vm",
|
|
@@ -1291,7 +1312,8 @@ export const vmLaunchModeHandler = {
|
|
|
1291
1312
|
);
|
|
1292
1313
|
} catch (error) {
|
|
1293
1314
|
return acceptedWaitFailure(interaction, error, {
|
|
1294
|
-
data: launchData(
|
|
1315
|
+
data: await launchData(
|
|
1316
|
+
context,
|
|
1295
1317
|
currentReservation,
|
|
1296
1318
|
machine,
|
|
1297
1319
|
key,
|
|
@@ -1317,7 +1339,8 @@ export const vmLaunchModeHandler = {
|
|
|
1317
1339
|
if (!shouldWait) {
|
|
1318
1340
|
const ready = isSshReady(machine, key, virtualMachine);
|
|
1319
1341
|
return interaction.result({
|
|
1320
|
-
data: launchData(
|
|
1342
|
+
data: await launchData(
|
|
1343
|
+
context,
|
|
1321
1344
|
currentReservation,
|
|
1322
1345
|
machine,
|
|
1323
1346
|
key,
|
|
@@ -1353,7 +1376,8 @@ export const vmLaunchModeHandler = {
|
|
|
1353
1376
|
});
|
|
1354
1377
|
} catch (error) {
|
|
1355
1378
|
return acceptedWaitFailure(interaction, error, {
|
|
1356
|
-
data: launchData(
|
|
1379
|
+
data: await launchData(
|
|
1380
|
+
context,
|
|
1357
1381
|
currentReservation,
|
|
1358
1382
|
machine,
|
|
1359
1383
|
key,
|
|
@@ -1369,7 +1393,8 @@ export const vmLaunchModeHandler = {
|
|
|
1369
1393
|
}
|
|
1370
1394
|
machine = waitOutcome.value.node;
|
|
1371
1395
|
virtualMachine = waitOutcome.value.virtualMachine;
|
|
1372
|
-
const data = launchData(
|
|
1396
|
+
const data = await launchData(
|
|
1397
|
+
context,
|
|
1373
1398
|
currentReservation,
|
|
1374
1399
|
machine,
|
|
1375
1400
|
key,
|
|
@@ -1527,9 +1552,20 @@ function bareMetalIntentSignature(reservation, relationships) {
|
|
|
1527
1552
|
});
|
|
1528
1553
|
}
|
|
1529
1554
|
|
|
1530
|
-
function bareMetalLaunchData(
|
|
1555
|
+
async function bareMetalLaunchData(
|
|
1556
|
+
context,
|
|
1557
|
+
reservation,
|
|
1558
|
+
machine,
|
|
1559
|
+
key,
|
|
1560
|
+
relationships,
|
|
1561
|
+
waitPolicy,
|
|
1562
|
+
replayed
|
|
1563
|
+
) {
|
|
1564
|
+
const gateway = machine.ssh_gateway_id
|
|
1565
|
+
? await orchestrator.getSupplierGateway(context.fetch, machine.ssh_gateway_id)
|
|
1566
|
+
: undefined;
|
|
1531
1567
|
const reservationId = text(reservation.reservationId);
|
|
1532
|
-
const invocation = isSshReady(machine, key) ? sshInvocation(machine) : null;
|
|
1568
|
+
const invocation = isSshReady(machine, key) ? sshInvocation(machine, {}, gateway) : null;
|
|
1533
1569
|
return {
|
|
1534
1570
|
mode: "bare-metal",
|
|
1535
1571
|
capacity_reservation: {
|
|
@@ -2607,7 +2643,8 @@ export const bareMetalLaunchModeHandler = {
|
|
|
2607
2643
|
if (!shouldWait) {
|
|
2608
2644
|
const ready = isSshReady(machine, key);
|
|
2609
2645
|
return interaction.result({
|
|
2610
|
-
data: bareMetalLaunchData(
|
|
2646
|
+
data: await bareMetalLaunchData(
|
|
2647
|
+
context,
|
|
2611
2648
|
currentReservation,
|
|
2612
2649
|
machine,
|
|
2613
2650
|
key,
|
|
@@ -2647,7 +2684,8 @@ export const bareMetalLaunchModeHandler = {
|
|
|
2647
2684
|
});
|
|
2648
2685
|
} catch (error) {
|
|
2649
2686
|
return acceptedWaitFailure(interaction, error, {
|
|
2650
|
-
data: bareMetalLaunchData(
|
|
2687
|
+
data: await bareMetalLaunchData(
|
|
2688
|
+
context,
|
|
2651
2689
|
currentReservation,
|
|
2652
2690
|
machine,
|
|
2653
2691
|
key,
|
|
@@ -2662,7 +2700,8 @@ export const bareMetalLaunchModeHandler = {
|
|
|
2662
2700
|
});
|
|
2663
2701
|
}
|
|
2664
2702
|
machine = waitOutcome.value;
|
|
2665
|
-
const data = bareMetalLaunchData(
|
|
2703
|
+
const data = await bareMetalLaunchData(
|
|
2704
|
+
context,
|
|
2666
2705
|
currentReservation,
|
|
2667
2706
|
machine,
|
|
2668
2707
|
key,
|
|
@@ -2921,7 +2960,12 @@ function createDirectMachineConnectModeHandler({
|
|
|
2921
2960
|
);
|
|
2922
2961
|
}
|
|
2923
2962
|
const reachability = machineReachability(machine, access);
|
|
2924
|
-
const
|
|
2963
|
+
const gateway =
|
|
2964
|
+
machine.ssh_gateway_id && !state.privateNetwork
|
|
2965
|
+
? await orchestrator.getSupplierGateway(context.fetch, machine.ssh_gateway_id)
|
|
2966
|
+
: undefined;
|
|
2967
|
+
const invocation =
|
|
2968
|
+
reachability.class === "ready" ? sshInvocation(access, input, gateway) : null;
|
|
2925
2969
|
const resume = { kind: "machine", ref: machineId(machine) };
|
|
2926
2970
|
const displayName = machineHostname(machine) || "the selected machine";
|
|
2927
2971
|
const waitTarget = machineHostname(machine)
|
|
@@ -811,12 +811,33 @@ var path4 = "/v1/orchestrator/supplier-gateways";
|
|
|
811
811
|
function createSupplierGateway(request, body) {
|
|
812
812
|
return request(path4, { method: "POST", body });
|
|
813
813
|
}
|
|
814
|
+
function listSupplierGatewayRegions(request, signal) {
|
|
815
|
+
return request("/v1/orchestrator/supplier-gateway-regions", {
|
|
816
|
+
method: "GET",
|
|
817
|
+
...signal ? { signal } : {}
|
|
818
|
+
});
|
|
819
|
+
}
|
|
814
820
|
function getSupplierGateway(request, id, signal) {
|
|
815
821
|
return request(`${path4}/${encodeURIComponent(id)}`, {
|
|
816
822
|
method: "GET",
|
|
817
823
|
...signal ? { signal } : {}
|
|
818
824
|
});
|
|
819
825
|
}
|
|
826
|
+
function registerSupplierGateway(request, body) {
|
|
827
|
+
return request(`${path4}/register`, { method: "POST", body });
|
|
828
|
+
}
|
|
829
|
+
function configureEnrollmentConnection(request, body) {
|
|
830
|
+
return request("/v1/orchestrator/enrollment/configurable/connection", {
|
|
831
|
+
method: "POST",
|
|
832
|
+
body
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
function verifyEnrollmentConnection(request) {
|
|
836
|
+
return request("/v1/orchestrator/enrollment/configurable/connection/verify", {
|
|
837
|
+
method: "POST",
|
|
838
|
+
body: {}
|
|
839
|
+
});
|
|
840
|
+
}
|
|
820
841
|
|
|
821
842
|
// ../../packages/api-client/dist/orchestrator/supplier-connection-configs.js
|
|
822
843
|
var path5 = "/v1/orchestrator/supplier-connection-configs";
|
|
@@ -830,6 +851,8 @@ function listSupplierConnectionConfigs(request, query = {}, signal) {
|
|
|
830
851
|
const params = new URLSearchParams();
|
|
831
852
|
if (query.organization_id !== void 0)
|
|
832
853
|
params.set("organization_id", query.organization_id);
|
|
854
|
+
if (query.gateway_id !== void 0)
|
|
855
|
+
params.set("gateway_id", query.gateway_id);
|
|
833
856
|
if (query.after !== void 0)
|
|
834
857
|
params.set("after", query.after);
|
|
835
858
|
if (query.limit !== void 0)
|
|
@@ -854,6 +877,9 @@ function patchSupplierConnectionConfig(request, id, body) {
|
|
|
854
877
|
body
|
|
855
878
|
});
|
|
856
879
|
}
|
|
880
|
+
function deleteSupplierConnectionConfig(request, id) {
|
|
881
|
+
return request(`${path5}/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
882
|
+
}
|
|
857
883
|
|
|
858
884
|
// ../../packages/api-client/dist/orchestrator/supplier-node-configs.js
|
|
859
885
|
function listSupplierNodeConfigs(request, query = {}, signal) {
|
|
@@ -960,6 +986,7 @@ export {
|
|
|
960
986
|
completeDriveUpload,
|
|
961
987
|
completeGitHubConnection,
|
|
962
988
|
completeImageUpload,
|
|
989
|
+
configureEnrollmentConnection,
|
|
963
990
|
controllersSocketPath,
|
|
964
991
|
controlplaneDownloadPath,
|
|
965
992
|
controlplaneSplashPath,
|
|
@@ -987,6 +1014,7 @@ export {
|
|
|
987
1014
|
deleteRegistryTag,
|
|
988
1015
|
deleteReservationSshKey,
|
|
989
1016
|
deleteSshBastion,
|
|
1017
|
+
deleteSupplierConnectionConfig,
|
|
990
1018
|
deleteVirtualMachine,
|
|
991
1019
|
disksSocketPath,
|
|
992
1020
|
downloadDriveFile,
|
|
@@ -1069,6 +1097,7 @@ export {
|
|
|
1069
1097
|
listStorageTargets,
|
|
1070
1098
|
listSupplierConnectionConfigs,
|
|
1071
1099
|
listSupplierConnectionTypes,
|
|
1100
|
+
listSupplierGatewayRegions,
|
|
1072
1101
|
listSupplierNodeConfigs,
|
|
1073
1102
|
listVirtualMachinePorts,
|
|
1074
1103
|
localityGeolocatePath,
|
|
@@ -1082,6 +1111,7 @@ export {
|
|
|
1082
1111
|
putSupplierNodeConfig,
|
|
1083
1112
|
rebootNode,
|
|
1084
1113
|
rebootVirtualMachine,
|
|
1114
|
+
registerSupplierGateway,
|
|
1085
1115
|
remoteRunPath,
|
|
1086
1116
|
removeControllerNode,
|
|
1087
1117
|
removeControllerVirtualMachine,
|
|
@@ -1112,5 +1142,6 @@ export {
|
|
|
1112
1142
|
updateNodeSanitize,
|
|
1113
1143
|
updateSshBastion,
|
|
1114
1144
|
updateVirtualMachineKeys,
|
|
1115
|
-
updateVirtualMachineRun
|
|
1145
|
+
updateVirtualMachineRun,
|
|
1146
|
+
verifyEnrollmentConnection
|
|
1116
1147
|
};
|
|
@@ -6993,6 +6993,56 @@ var catalog = [
|
|
|
6993
6993
|
creditGrantCapability
|
|
6994
6994
|
];
|
|
6995
6995
|
|
|
6996
|
+
// ../../packages/capabilities/dist/output-safety.js
|
|
6997
|
+
var SUPPLIER_IDENTITY_KEYS = /* @__PURE__ */ new Set([
|
|
6998
|
+
"provider",
|
|
6999
|
+
"providerid",
|
|
7000
|
+
"providername",
|
|
7001
|
+
"sitesupplier",
|
|
7002
|
+
"sitesupplierid",
|
|
7003
|
+
"sitesuppliername",
|
|
7004
|
+
"supplier",
|
|
7005
|
+
"supplierid",
|
|
7006
|
+
"suppliername",
|
|
7007
|
+
"supplierorganizationid",
|
|
7008
|
+
"supplierorganizationname",
|
|
7009
|
+
"supplierorganizationstatus"
|
|
7010
|
+
]);
|
|
7011
|
+
var PRIVATE_OUTPUT_KEYS = /* @__PURE__ */ new Set([
|
|
7012
|
+
"checkoutkey",
|
|
7013
|
+
"clientsecret",
|
|
7014
|
+
"internalowner",
|
|
7015
|
+
"organizationname",
|
|
7016
|
+
"paymentintentclientsecret",
|
|
7017
|
+
"paymentprovider",
|
|
7018
|
+
"paymentsecret",
|
|
7019
|
+
"reconciliation",
|
|
7020
|
+
"reconciliationstatus",
|
|
7021
|
+
"stripeclientsecret",
|
|
7022
|
+
"stripeinvoiceid"
|
|
7023
|
+
]);
|
|
7024
|
+
function normalizedKey(key) {
|
|
7025
|
+
return key.replaceAll(/[^a-z0-9]/gi, "").toLowerCase();
|
|
7026
|
+
}
|
|
7027
|
+
function supplierOwnedRecord(record) {
|
|
7028
|
+
const has = (...keys2) => keys2.some((key) => Object.hasOwn(record, key));
|
|
7029
|
+
if (has("driveId", "drive_id"))
|
|
7030
|
+
return false;
|
|
7031
|
+
const keys = new Set(Object.keys(record).map(normalizedKey));
|
|
7032
|
+
if (keys.has("nodeid"))
|
|
7033
|
+
return true;
|
|
7034
|
+
if (has("reservationId", "reservation_id"))
|
|
7035
|
+
return false;
|
|
7036
|
+
return keys.has("capacitylistingid") || keys.has("listingid") || keys.has("facilityid");
|
|
7037
|
+
}
|
|
7038
|
+
function isSupplierIdentityField(record, key) {
|
|
7039
|
+
const normalized = normalizedKey(key);
|
|
7040
|
+
return SUPPLIER_IDENTITY_KEYS.has(normalized) || (normalized === "organizationid" || normalized === "organizationname") && supplierOwnedRecord(record);
|
|
7041
|
+
}
|
|
7042
|
+
function isCustomerSensitiveField(record, key) {
|
|
7043
|
+
return PRIVATE_OUTPUT_KEYS.has(normalizedKey(key)) || isSupplierIdentityField(record, key);
|
|
7044
|
+
}
|
|
7045
|
+
|
|
6996
7046
|
// ../../packages/capabilities/dist/cli-migrations.js
|
|
6997
7047
|
var CLI_MIGRATION_GUIDE_URL = "https://docs.ornn.com/cli#migrating-to-vnext";
|
|
6998
7048
|
var LEGACY_CLI_MIGRATIONS = [
|
|
@@ -7248,6 +7298,30 @@ var LEGACY_CLI_MIGRATIONS = [
|
|
|
7248
7298
|
function findLegacyCliMigration(argv) {
|
|
7249
7299
|
return [...LEGACY_CLI_MIGRATIONS].sort((left, right) => right.legacy.length - left.legacy.length).find((entry) => entry.legacy.every((part, index) => argv[index] === part)) ?? null;
|
|
7250
7300
|
}
|
|
7301
|
+
|
|
7302
|
+
// ../../packages/capabilities/dist/ssh-access.js
|
|
7303
|
+
function sshArguments({ host, username, port, gatewayId, gateway }) {
|
|
7304
|
+
if (!host || !username || !Number.isInteger(port) || port < 1 || port > 65535)
|
|
7305
|
+
return null;
|
|
7306
|
+
if (gatewayId && (!gateway || gateway.id !== gatewayId))
|
|
7307
|
+
return null;
|
|
7308
|
+
const args = [];
|
|
7309
|
+
if (gateway?.ssh_access_mode === "jump") {
|
|
7310
|
+
const address = gateway.public_ip ?? gateway.hostname;
|
|
7311
|
+
if (!address || !gateway.ssh_username || !gateway.ssh_port)
|
|
7312
|
+
return null;
|
|
7313
|
+
args.push("-J", `${gateway.ssh_username}@${address.includes(":") ? `[${address}]` : address}:${gateway.ssh_port}`);
|
|
7314
|
+
}
|
|
7315
|
+
args.push("-p", String(port), `${username}@${host}`);
|
|
7316
|
+
return args;
|
|
7317
|
+
}
|
|
7318
|
+
function sshCommand(input) {
|
|
7319
|
+
const args = sshArguments(input);
|
|
7320
|
+
return args ? ["ssh", ...args.map(shellArgument)].join(" ") : null;
|
|
7321
|
+
}
|
|
7322
|
+
function shellArgument(value) {
|
|
7323
|
+
return /^[a-zA-Z0-9_./:@-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
7324
|
+
}
|
|
7251
7325
|
export {
|
|
7252
7326
|
ADMIN_CLI_ROOTS,
|
|
7253
7327
|
CLI_MIGRATION_GUIDE_URL,
|
|
@@ -7273,6 +7347,7 @@ export {
|
|
|
7273
7347
|
findLegacyCliMigration,
|
|
7274
7348
|
forRole,
|
|
7275
7349
|
gpuDisplay,
|
|
7350
|
+
isCustomerSensitiveField,
|
|
7276
7351
|
machineRebootCapability,
|
|
7277
7352
|
machineResetCapability,
|
|
7278
7353
|
machineSwitchCapability,
|
|
@@ -7284,6 +7359,8 @@ export {
|
|
|
7284
7359
|
privateNetworkListCapability,
|
|
7285
7360
|
privateNetworkShowCapability,
|
|
7286
7361
|
privateNetworkUpdateCapability,
|
|
7362
|
+
sshArguments,
|
|
7363
|
+
sshCommand,
|
|
7287
7364
|
sshKeyAddCapability,
|
|
7288
7365
|
sshKeyAssignmentAssignCapability,
|
|
7289
7366
|
sshKeyAssignmentListCapability,
|