@kitsy/cnos 1.8.2 → 1.8.4
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/dist/build/index.cjs +38 -5
- package/dist/build/index.d.cts +1 -1
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +34 -9
- package/dist/{chunk-KU73PJSQ.js → chunk-36AR262B.js} +1 -1
- package/dist/{chunk-DAFUP7EQ.js → chunk-4AAA2RHV.js} +1 -1
- package/dist/{chunk-VTUOWV3S.js → chunk-DL5G3QSZ.js} +1 -1
- package/dist/{chunk-DQGLBF6G.js → chunk-EJT2VJTM.js} +1 -1
- package/dist/{chunk-B5TV5O6O.js → chunk-JQLV4OQU.js} +1 -1
- package/dist/{chunk-CP6K2DB3.js → chunk-LDFKY65G.js} +11 -4
- package/dist/{chunk-FWW7F52D.js → chunk-N5DX5QEB.js} +1 -1
- package/dist/{chunk-J7VEEREE.js → chunk-O2KTQ6PB.js} +10 -10
- package/dist/{chunk-4MQBH4AY.js → chunk-UMVFSHP2.js} +1 -1
- package/dist/{chunk-5XOGTE42.js → chunk-ZH5QZQ7C.js} +15 -3
- package/dist/configure/index.cjs +16 -4
- package/dist/configure/index.d.cts +3 -3
- package/dist/configure/index.d.ts +3 -3
- package/dist/configure/index.js +8 -8
- package/dist/{core-CXgtC4VL.d.cts → core-zDTUSVx9.d.cts} +3 -1
- package/dist/{core-CXgtC4VL.d.ts → core-zDTUSVx9.d.ts} +3 -1
- package/dist/{envNaming-CA6OluSg.d.ts → envNaming-BkorOKW_.d.ts} +1 -1
- package/dist/{envNaming-BDtISWCK.d.cts → envNaming-EFzezmB3.d.cts} +1 -1
- package/dist/index.cjs +24 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +2 -2
- package/dist/plugin/basic-schema.d.cts +1 -1
- package/dist/plugin/basic-schema.d.ts +1 -1
- package/dist/plugin/basic-schema.js +2 -2
- package/dist/plugin/cli-args.d.cts +1 -1
- package/dist/plugin/cli-args.d.ts +1 -1
- package/dist/plugin/cli-args.js +2 -2
- package/dist/plugin/dotenv.d.cts +2 -2
- package/dist/plugin/dotenv.d.ts +2 -2
- package/dist/plugin/dotenv.js +2 -2
- package/dist/plugin/env-export.d.cts +2 -2
- package/dist/plugin/env-export.d.ts +2 -2
- package/dist/plugin/env-export.js +2 -2
- package/dist/plugin/filesystem.d.cts +1 -1
- package/dist/plugin/filesystem.d.ts +1 -1
- package/dist/plugin/filesystem.js +2 -2
- package/dist/plugin/process-env.d.cts +2 -2
- package/dist/plugin/process-env.d.ts +2 -2
- package/dist/plugin/process-env.js +2 -2
- package/dist/runtime/index.cjs +24 -5
- package/dist/runtime/index.d.cts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +10 -10
- package/dist/{toPublicEnv-B_dZDXDv.d.ts → toPublicEnv-CT265rzS.d.ts} +1 -1
- package/dist/{toPublicEnv-C_MbUTdV.d.cts → toPublicEnv-Ds1DRwCX.d.cts} +1 -1
- package/package.json +1 -1
package/dist/build/index.cjs
CHANGED
|
@@ -3173,6 +3173,13 @@ function stableSortObject(value) {
|
|
|
3173
3173
|
function stripValuePrefix(key) {
|
|
3174
3174
|
return key.startsWith("value.") ? key.slice("value.".length) : key;
|
|
3175
3175
|
}
|
|
3176
|
+
function resolveProjectedEnvVar(manifest, vaultId, ref) {
|
|
3177
|
+
const mapping = manifest.vaults[vaultId]?.mapping;
|
|
3178
|
+
if (!mapping) {
|
|
3179
|
+
return void 0;
|
|
3180
|
+
}
|
|
3181
|
+
return Object.entries(mapping).find(([, logicalRef]) => logicalRef === ref)?.[0];
|
|
3182
|
+
}
|
|
3176
3183
|
function configHash(values) {
|
|
3177
3184
|
const serialized = JSON.stringify(stableSortObject(values));
|
|
3178
3185
|
return (0, import_node_crypto3.createHash)("sha256").update(serialized).digest("hex");
|
|
@@ -3189,10 +3196,15 @@ function toServerProjection(graph, manifest, cnosVersion = "0.0.0-dev", helpers
|
|
|
3189
3196
|
const publicKeys = Array.from(graph.entries.values()).filter((entry) => entry.namespace === "public").map((entry) => entry.key.slice("public.".length)).sort((left, right) => left.localeCompare(right));
|
|
3190
3197
|
for (const [key, entry] of graph.entries) {
|
|
3191
3198
|
if (entry.namespace === "secret" && isSecretReference(entry.value)) {
|
|
3199
|
+
const vaultId = entry.value.vault ?? "default";
|
|
3200
|
+
const envVar = resolveProjectedEnvVar(manifest, vaultId, entry.value.ref);
|
|
3192
3201
|
secretRefs[key.slice("secret.".length)] = {
|
|
3193
3202
|
provider: entry.value.provider,
|
|
3194
|
-
vault:
|
|
3195
|
-
ref: entry.value.ref
|
|
3203
|
+
vault: vaultId,
|
|
3204
|
+
ref: entry.value.ref,
|
|
3205
|
+
...envVar ? {
|
|
3206
|
+
envVar
|
|
3207
|
+
} : {}
|
|
3196
3208
|
};
|
|
3197
3209
|
continue;
|
|
3198
3210
|
}
|
|
@@ -3647,7 +3659,7 @@ async function createCnos(options = {}) {
|
|
|
3647
3659
|
});
|
|
3648
3660
|
const schemaApplied = applySchemaRules(graph, loadedManifest.manifest.schema);
|
|
3649
3661
|
const promotedGraph = promoteToPublic(schemaApplied.graph, loadedManifest.manifest);
|
|
3650
|
-
const secretCache = options.secretResolution === "lazy" ?
|
|
3662
|
+
const secretCache = options.secretResolution === "lazy" ? new SecretCache() : await batchResolveSecrets(promotedGraph, loadedManifest.manifest, options.processEnv);
|
|
3651
3663
|
return createRuntime(
|
|
3652
3664
|
loadedManifest.manifest,
|
|
3653
3665
|
appendMetaEntries({
|
|
@@ -3700,7 +3712,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3700
3712
|
// package.json
|
|
3701
3713
|
var package_default = {
|
|
3702
3714
|
name: "@kitsy/cnos",
|
|
3703
|
-
version: "1.8.
|
|
3715
|
+
version: "1.8.4",
|
|
3704
3716
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3705
3717
|
type: "module",
|
|
3706
3718
|
main: "./dist/index.cjs",
|
|
@@ -4424,12 +4436,33 @@ async function resolveFrameworkEnv(options = {}, framework = "generic", envOptio
|
|
|
4424
4436
|
});
|
|
4425
4437
|
}
|
|
4426
4438
|
async function resolveServerProjection(options = {}) {
|
|
4439
|
+
const secretResolution = options.secretResolution ?? "lazy";
|
|
4427
4440
|
const runtime = await createCnos2({
|
|
4428
4441
|
...options,
|
|
4429
|
-
cacheMode: options.cacheMode ?? "build"
|
|
4442
|
+
cacheMode: options.cacheMode ?? "build",
|
|
4443
|
+
secretResolution
|
|
4430
4444
|
});
|
|
4445
|
+
validateServerProjectionSecretRefs(runtime);
|
|
4431
4446
|
return runtime.toServerProjection();
|
|
4432
4447
|
}
|
|
4448
|
+
function validateServerProjectionSecretRefs(runtime) {
|
|
4449
|
+
for (const entry of runtime.graph.entries.values()) {
|
|
4450
|
+
if (entry.namespace !== "secret" || !isSecretReference(entry.value)) {
|
|
4451
|
+
continue;
|
|
4452
|
+
}
|
|
4453
|
+
const vaultId = entry.value.vault ?? "default";
|
|
4454
|
+
const definition = runtime.manifest.vaults[vaultId];
|
|
4455
|
+
if (!definition) {
|
|
4456
|
+
throw new CnosManifestError(`Unknown vault "${vaultId}" for secret ref "${entry.key}"`);
|
|
4457
|
+
}
|
|
4458
|
+
if (entry.value.provider !== definition.provider) {
|
|
4459
|
+
throw new CnosManifestError(
|
|
4460
|
+
`Secret ref "${entry.key}" declares provider "${entry.value.provider}" but vault "${vaultId}" uses provider "${definition.provider}"`
|
|
4461
|
+
);
|
|
4462
|
+
}
|
|
4463
|
+
createSecretVaultProvider(vaultId, definition);
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4433
4466
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4434
4467
|
0 && (module.exports = {
|
|
4435
4468
|
resolveBrowserData,
|
package/dist/build/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CnosCreateOptions, S as ServerProjection } from '../core-
|
|
1
|
+
import { C as CnosCreateOptions, S as ServerProjection } from '../core-zDTUSVx9.cjs';
|
|
2
2
|
|
|
3
3
|
type BrowserDataMap = Record<string, unknown>;
|
|
4
4
|
type FrameworkEnvTarget = 'generic' | 'vite' | 'next' | 'webpack' | (string & {});
|
package/dist/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CnosCreateOptions, S as ServerProjection } from '../core-
|
|
1
|
+
import { C as CnosCreateOptions, S as ServerProjection } from '../core-zDTUSVx9.js';
|
|
2
2
|
|
|
3
3
|
type BrowserDataMap = Record<string, unknown>;
|
|
4
4
|
type FrameworkEnvTarget = 'generic' | 'vite' | 'next' | 'webpack' | (string & {});
|
package/dist/build/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCnos
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import
|
|
3
|
+
} from "../chunk-O2KTQ6PB.js";
|
|
4
|
+
import "../chunk-JQLV4OQU.js";
|
|
5
|
+
import "../chunk-4AAA2RHV.js";
|
|
6
|
+
import "../chunk-UMVFSHP2.js";
|
|
7
|
+
import "../chunk-N5DX5QEB.js";
|
|
8
|
+
import "../chunk-36AR262B.js";
|
|
9
|
+
import "../chunk-EJT2VJTM.js";
|
|
10
|
+
import {
|
|
11
|
+
CnosManifestError,
|
|
12
|
+
createSecretVaultProvider,
|
|
13
|
+
isSecretReference
|
|
14
|
+
} from "../chunk-ZH5QZQ7C.js";
|
|
11
15
|
|
|
12
16
|
// src/build/index.ts
|
|
13
17
|
async function resolveBrowserData(options = {}) {
|
|
@@ -86,12 +90,33 @@ async function resolveFrameworkEnv(options = {}, framework = "generic", envOptio
|
|
|
86
90
|
});
|
|
87
91
|
}
|
|
88
92
|
async function resolveServerProjection(options = {}) {
|
|
93
|
+
const secretResolution = options.secretResolution ?? "lazy";
|
|
89
94
|
const runtime = await createCnos({
|
|
90
95
|
...options,
|
|
91
|
-
cacheMode: options.cacheMode ?? "build"
|
|
96
|
+
cacheMode: options.cacheMode ?? "build",
|
|
97
|
+
secretResolution
|
|
92
98
|
});
|
|
99
|
+
validateServerProjectionSecretRefs(runtime);
|
|
93
100
|
return runtime.toServerProjection();
|
|
94
101
|
}
|
|
102
|
+
function validateServerProjectionSecretRefs(runtime) {
|
|
103
|
+
for (const entry of runtime.graph.entries.values()) {
|
|
104
|
+
if (entry.namespace !== "secret" || !isSecretReference(entry.value)) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const vaultId = entry.value.vault ?? "default";
|
|
108
|
+
const definition = runtime.manifest.vaults[vaultId];
|
|
109
|
+
if (!definition) {
|
|
110
|
+
throw new CnosManifestError(`Unknown vault "${vaultId}" for secret ref "${entry.key}"`);
|
|
111
|
+
}
|
|
112
|
+
if (entry.value.provider !== definition.provider) {
|
|
113
|
+
throw new CnosManifestError(
|
|
114
|
+
`Secret ref "${entry.key}" declares provider "${entry.value.provider}" but vault "${vaultId}" uses provider "${definition.provider}"`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
createSecretVaultProvider(vaultId, definition);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
95
120
|
export {
|
|
96
121
|
resolveBrowserData,
|
|
97
122
|
resolveFrameworkEnv,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
graphRequiresSecretHydration,
|
|
4
4
|
readRuntimeGraphFromEnv,
|
|
5
5
|
readServerProjectionFromEnv
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DL5G3QSZ.js";
|
|
7
7
|
import {
|
|
8
8
|
createCnos,
|
|
9
9
|
getBootstrappedSecretHydrationRequired,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
setBootstrappedSecretHydrationRequired,
|
|
13
13
|
setSingletonReady,
|
|
14
14
|
setSingletonRuntime
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-O2KTQ6PB.js";
|
|
16
16
|
import {
|
|
17
17
|
createDefaultRuntimeProviders,
|
|
18
18
|
createDerivedRuntimeSupport,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
toLogicalKey,
|
|
29
29
|
toNamespaceObject,
|
|
30
30
|
toPublicEnv
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZH5QZQ7C.js";
|
|
32
32
|
|
|
33
33
|
// src/runtime/index.ts
|
|
34
34
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -474,7 +474,14 @@ function attachBootstrappedProjection(projection, force = false) {
|
|
|
474
474
|
if (!ref) {
|
|
475
475
|
return void 0;
|
|
476
476
|
}
|
|
477
|
-
const definition = {
|
|
477
|
+
const definition = {
|
|
478
|
+
provider: ref.provider,
|
|
479
|
+
...ref.envVar ? {
|
|
480
|
+
mapping: {
|
|
481
|
+
[ref.envVar]: ref.ref
|
|
482
|
+
}
|
|
483
|
+
} : {}
|
|
484
|
+
};
|
|
478
485
|
const provider = createSecretVaultProvider(ref.vault ?? "default", definition, process.env);
|
|
479
486
|
const auth = await resolveVaultAuth(ref.vault ?? "default", definition, process.env);
|
|
480
487
|
await provider.authenticate(auth);
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createDotenvPlugin
|
|
3
|
-
} from "./chunk-DQGLBF6G.js";
|
|
4
1
|
import {
|
|
5
2
|
createEnvExportPlugin,
|
|
6
3
|
createPublicEnvExportPlugin
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JQLV4OQU.js";
|
|
8
5
|
import {
|
|
9
6
|
createFilesystemSecretsPlugin,
|
|
10
7
|
createFilesystemValuesPlugin
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4AAA2RHV.js";
|
|
12
9
|
import {
|
|
13
10
|
createProcessEnvPlugin
|
|
14
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UMVFSHP2.js";
|
|
15
12
|
import {
|
|
16
13
|
createBasicSchemaPlugin
|
|
17
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-N5DX5QEB.js";
|
|
18
15
|
import {
|
|
19
16
|
createCliArgsPlugin
|
|
20
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-36AR262B.js";
|
|
18
|
+
import {
|
|
19
|
+
createDotenvPlugin
|
|
20
|
+
} from "./chunk-EJT2VJTM.js";
|
|
21
21
|
import {
|
|
22
22
|
createCnos,
|
|
23
23
|
createProvenanceInspector
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZH5QZQ7C.js";
|
|
25
25
|
|
|
26
26
|
// src/defaultPlugins.ts
|
|
27
27
|
function defaultPlugins() {
|
|
@@ -68,7 +68,7 @@ function setBootstrappedSecretHydrationRequired(value) {
|
|
|
68
68
|
// package.json
|
|
69
69
|
var package_default = {
|
|
70
70
|
name: "@kitsy/cnos",
|
|
71
|
-
version: "1.8.
|
|
71
|
+
version: "1.8.4",
|
|
72
72
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
73
73
|
type: "module",
|
|
74
74
|
main: "./dist/index.cjs",
|
|
@@ -3565,6 +3565,13 @@ function stableSortObject(value) {
|
|
|
3565
3565
|
function stripValuePrefix(key) {
|
|
3566
3566
|
return key.startsWith("value.") ? key.slice("value.".length) : key;
|
|
3567
3567
|
}
|
|
3568
|
+
function resolveProjectedEnvVar(manifest, vaultId, ref) {
|
|
3569
|
+
const mapping = manifest.vaults[vaultId]?.mapping;
|
|
3570
|
+
if (!mapping) {
|
|
3571
|
+
return void 0;
|
|
3572
|
+
}
|
|
3573
|
+
return Object.entries(mapping).find(([, logicalRef]) => logicalRef === ref)?.[0];
|
|
3574
|
+
}
|
|
3568
3575
|
function configHash(values) {
|
|
3569
3576
|
const serialized = JSON.stringify(stableSortObject(values));
|
|
3570
3577
|
return createHash2("sha256").update(serialized).digest("hex");
|
|
@@ -3581,10 +3588,15 @@ function toServerProjection(graph, manifest, cnosVersion = "0.0.0-dev", helpers
|
|
|
3581
3588
|
const publicKeys = Array.from(graph.entries.values()).filter((entry) => entry.namespace === "public").map((entry) => entry.key.slice("public.".length)).sort((left, right) => left.localeCompare(right));
|
|
3582
3589
|
for (const [key, entry] of graph.entries) {
|
|
3583
3590
|
if (entry.namespace === "secret" && isSecretReference(entry.value)) {
|
|
3591
|
+
const vaultId = entry.value.vault ?? "default";
|
|
3592
|
+
const envVar = resolveProjectedEnvVar(manifest, vaultId, entry.value.ref);
|
|
3584
3593
|
secretRefs[key.slice("secret.".length)] = {
|
|
3585
3594
|
provider: entry.value.provider,
|
|
3586
|
-
vault:
|
|
3587
|
-
ref: entry.value.ref
|
|
3595
|
+
vault: vaultId,
|
|
3596
|
+
ref: entry.value.ref,
|
|
3597
|
+
...envVar ? {
|
|
3598
|
+
envVar
|
|
3599
|
+
} : {}
|
|
3588
3600
|
};
|
|
3589
3601
|
continue;
|
|
3590
3602
|
}
|
|
@@ -3942,7 +3954,7 @@ async function createCnos(options = {}) {
|
|
|
3942
3954
|
});
|
|
3943
3955
|
const schemaApplied = applySchemaRules(graph, loadedManifest.manifest.schema);
|
|
3944
3956
|
const promotedGraph = promoteToPublic(schemaApplied.graph, loadedManifest.manifest);
|
|
3945
|
-
const secretCache = options.secretResolution === "lazy" ?
|
|
3957
|
+
const secretCache = options.secretResolution === "lazy" ? new SecretCache() : await batchResolveSecrets(promotedGraph, loadedManifest.manifest, options.processEnv);
|
|
3946
3958
|
return createRuntime(
|
|
3947
3959
|
loadedManifest.manifest,
|
|
3948
3960
|
appendMetaEntries({
|
package/dist/configure/index.cjs
CHANGED
|
@@ -3175,6 +3175,13 @@ function stableSortObject(value) {
|
|
|
3175
3175
|
function stripValuePrefix(key) {
|
|
3176
3176
|
return key.startsWith("value.") ? key.slice("value.".length) : key;
|
|
3177
3177
|
}
|
|
3178
|
+
function resolveProjectedEnvVar(manifest, vaultId, ref) {
|
|
3179
|
+
const mapping = manifest.vaults[vaultId]?.mapping;
|
|
3180
|
+
if (!mapping) {
|
|
3181
|
+
return void 0;
|
|
3182
|
+
}
|
|
3183
|
+
return Object.entries(mapping).find(([, logicalRef]) => logicalRef === ref)?.[0];
|
|
3184
|
+
}
|
|
3178
3185
|
function configHash(values) {
|
|
3179
3186
|
const serialized = JSON.stringify(stableSortObject(values));
|
|
3180
3187
|
return (0, import_node_crypto3.createHash)("sha256").update(serialized).digest("hex");
|
|
@@ -3191,10 +3198,15 @@ function toServerProjection(graph, manifest, cnosVersion = "0.0.0-dev", helpers
|
|
|
3191
3198
|
const publicKeys = Array.from(graph.entries.values()).filter((entry) => entry.namespace === "public").map((entry) => entry.key.slice("public.".length)).sort((left, right) => left.localeCompare(right));
|
|
3192
3199
|
for (const [key, entry] of graph.entries) {
|
|
3193
3200
|
if (entry.namespace === "secret" && isSecretReference(entry.value)) {
|
|
3201
|
+
const vaultId = entry.value.vault ?? "default";
|
|
3202
|
+
const envVar = resolveProjectedEnvVar(manifest, vaultId, entry.value.ref);
|
|
3194
3203
|
secretRefs[key.slice("secret.".length)] = {
|
|
3195
3204
|
provider: entry.value.provider,
|
|
3196
|
-
vault:
|
|
3197
|
-
ref: entry.value.ref
|
|
3205
|
+
vault: vaultId,
|
|
3206
|
+
ref: entry.value.ref,
|
|
3207
|
+
...envVar ? {
|
|
3208
|
+
envVar
|
|
3209
|
+
} : {}
|
|
3198
3210
|
};
|
|
3199
3211
|
continue;
|
|
3200
3212
|
}
|
|
@@ -3649,7 +3661,7 @@ async function createCnos(options = {}) {
|
|
|
3649
3661
|
});
|
|
3650
3662
|
const schemaApplied = applySchemaRules(graph, loadedManifest.manifest.schema);
|
|
3651
3663
|
const promotedGraph = promoteToPublic(schemaApplied.graph, loadedManifest.manifest);
|
|
3652
|
-
const secretCache = options.secretResolution === "lazy" ?
|
|
3664
|
+
const secretCache = options.secretResolution === "lazy" ? new SecretCache() : await batchResolveSecrets(promotedGraph, loadedManifest.manifest, options.processEnv);
|
|
3653
3665
|
return createRuntime(
|
|
3654
3666
|
loadedManifest.manifest,
|
|
3655
3667
|
appendMetaEntries({
|
|
@@ -3744,7 +3756,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3744
3756
|
// package.json
|
|
3745
3757
|
var package_default = {
|
|
3746
3758
|
name: "@kitsy/cnos",
|
|
3747
|
-
version: "1.8.
|
|
3759
|
+
version: "1.8.4",
|
|
3748
3760
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3749
3761
|
type: "module",
|
|
3750
3762
|
main: "./dist/index.cjs",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../core-
|
|
2
|
-
export { a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider, T as ToEnvOptions, c as ToPublicEnvOptions } from '../core-
|
|
3
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../core-zDTUSVx9.cjs';
|
|
2
|
+
export { a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider, T as ToEnvOptions, c as ToPublicEnvOptions } from '../core-zDTUSVx9.cjs';
|
|
3
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Ds1DRwCX.cjs';
|
|
4
4
|
|
|
5
5
|
declare function planDump(graph: ResolvedGraph, options?: DumpPlanOptions): DumpPlan;
|
|
6
6
|
declare function writeDump(graph: ResolvedGraph, options: DumpOptions): Promise<DumpResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../core-
|
|
2
|
-
export { a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider, T as ToEnvOptions, c as ToPublicEnvOptions } from '../core-
|
|
3
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { R as ResolvedGraph, D as DumpPlanOptions, d as DumpPlan, e as DumpOptions, f as DumpResult, C as CnosCreateOptions, g as CnosRuntime, h as CnosPlugin } from '../core-zDTUSVx9.js';
|
|
2
|
+
export { a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider, T as ToEnvOptions, c as ToPublicEnvOptions } from '../core-zDTUSVx9.js';
|
|
3
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CT265rzS.js';
|
|
4
4
|
|
|
5
5
|
declare function planDump(graph: ResolvedGraph, options?: DumpPlanOptions): DumpPlan;
|
|
6
6
|
declare function writeDump(graph: ResolvedGraph, options: DumpOptions): Promise<DumpResult>;
|
package/dist/configure/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCnos,
|
|
3
3
|
defaultPlugins
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-O2KTQ6PB.js";
|
|
5
|
+
import "../chunk-JQLV4OQU.js";
|
|
6
|
+
import "../chunk-4AAA2RHV.js";
|
|
7
|
+
import "../chunk-UMVFSHP2.js";
|
|
8
|
+
import "../chunk-N5DX5QEB.js";
|
|
9
|
+
import "../chunk-36AR262B.js";
|
|
10
|
+
import "../chunk-EJT2VJTM.js";
|
|
11
11
|
import {
|
|
12
12
|
planDump,
|
|
13
13
|
toEnv,
|
|
14
14
|
toPublicEnv,
|
|
15
15
|
writeDump
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-ZH5QZQ7C.js";
|
|
17
17
|
export {
|
|
18
18
|
createCnos,
|
|
19
19
|
defaultPlugins,
|
|
@@ -467,7 +467,9 @@ interface ServerProjection {
|
|
|
467
467
|
configHash: string;
|
|
468
468
|
values: Record<string, unknown>;
|
|
469
469
|
derived: Record<string, DerivedFormula>;
|
|
470
|
-
secretRefs: Record<string, SecretReference
|
|
470
|
+
secretRefs: Record<string, SecretReference & {
|
|
471
|
+
envVar?: string;
|
|
472
|
+
}>;
|
|
471
473
|
publicKeys: string[];
|
|
472
474
|
runtimeNamespaces: string[];
|
|
473
475
|
meta: {
|
|
@@ -467,7 +467,9 @@ interface ServerProjection {
|
|
|
467
467
|
configHash: string;
|
|
468
468
|
values: Record<string, unknown>;
|
|
469
469
|
derived: Record<string, DerivedFormula>;
|
|
470
|
-
secretRefs: Record<string, SecretReference
|
|
470
|
+
secretRefs: Record<string, SecretReference & {
|
|
471
|
+
envVar?: string;
|
|
472
|
+
}>;
|
|
471
473
|
publicKeys: string[];
|
|
472
474
|
runtimeNamespaces: string[];
|
|
473
475
|
meta: {
|
package/dist/index.cjs
CHANGED
|
@@ -3175,6 +3175,13 @@ function stableSortObject(value) {
|
|
|
3175
3175
|
function stripValuePrefix(key) {
|
|
3176
3176
|
return key.startsWith("value.") ? key.slice("value.".length) : key;
|
|
3177
3177
|
}
|
|
3178
|
+
function resolveProjectedEnvVar(manifest, vaultId, ref) {
|
|
3179
|
+
const mapping = manifest.vaults[vaultId]?.mapping;
|
|
3180
|
+
if (!mapping) {
|
|
3181
|
+
return void 0;
|
|
3182
|
+
}
|
|
3183
|
+
return Object.entries(mapping).find(([, logicalRef]) => logicalRef === ref)?.[0];
|
|
3184
|
+
}
|
|
3178
3185
|
function configHash(values) {
|
|
3179
3186
|
const serialized = JSON.stringify(stableSortObject(values));
|
|
3180
3187
|
return (0, import_node_crypto3.createHash)("sha256").update(serialized).digest("hex");
|
|
@@ -3191,10 +3198,15 @@ function toServerProjection(graph, manifest, cnosVersion = "0.0.0-dev", helpers
|
|
|
3191
3198
|
const publicKeys = Array.from(graph.entries.values()).filter((entry) => entry.namespace === "public").map((entry) => entry.key.slice("public.".length)).sort((left, right) => left.localeCompare(right));
|
|
3192
3199
|
for (const [key, entry] of graph.entries) {
|
|
3193
3200
|
if (entry.namespace === "secret" && isSecretReference(entry.value)) {
|
|
3201
|
+
const vaultId = entry.value.vault ?? "default";
|
|
3202
|
+
const envVar = resolveProjectedEnvVar(manifest, vaultId, entry.value.ref);
|
|
3194
3203
|
secretRefs[key.slice("secret.".length)] = {
|
|
3195
3204
|
provider: entry.value.provider,
|
|
3196
|
-
vault:
|
|
3197
|
-
ref: entry.value.ref
|
|
3205
|
+
vault: vaultId,
|
|
3206
|
+
ref: entry.value.ref,
|
|
3207
|
+
...envVar ? {
|
|
3208
|
+
envVar
|
|
3209
|
+
} : {}
|
|
3198
3210
|
};
|
|
3199
3211
|
continue;
|
|
3200
3212
|
}
|
|
@@ -3649,7 +3661,7 @@ async function createCnos(options = {}) {
|
|
|
3649
3661
|
});
|
|
3650
3662
|
const schemaApplied = applySchemaRules(graph, loadedManifest.manifest.schema);
|
|
3651
3663
|
const promotedGraph = promoteToPublic(schemaApplied.graph, loadedManifest.manifest);
|
|
3652
|
-
const secretCache = options.secretResolution === "lazy" ?
|
|
3664
|
+
const secretCache = options.secretResolution === "lazy" ? new SecretCache() : await batchResolveSecrets(promotedGraph, loadedManifest.manifest, options.processEnv);
|
|
3653
3665
|
return createRuntime(
|
|
3654
3666
|
loadedManifest.manifest,
|
|
3655
3667
|
appendMetaEntries({
|
|
@@ -3702,7 +3714,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3702
3714
|
// package.json
|
|
3703
3715
|
var package_default = {
|
|
3704
3716
|
name: "@kitsy/cnos",
|
|
3705
|
-
version: "1.8.
|
|
3717
|
+
version: "1.8.4",
|
|
3706
3718
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3707
3719
|
type: "module",
|
|
3708
3720
|
main: "./dist/index.cjs",
|
|
@@ -4892,7 +4904,14 @@ function attachBootstrappedProjection(projection, force = false) {
|
|
|
4892
4904
|
if (!ref) {
|
|
4893
4905
|
return void 0;
|
|
4894
4906
|
}
|
|
4895
|
-
const definition = {
|
|
4907
|
+
const definition = {
|
|
4908
|
+
provider: ref.provider,
|
|
4909
|
+
...ref.envVar ? {
|
|
4910
|
+
mapping: {
|
|
4911
|
+
[ref.envVar]: ref.ref
|
|
4912
|
+
}
|
|
4913
|
+
} : {}
|
|
4914
|
+
};
|
|
4896
4915
|
const provider = createSecretVaultProvider(ref.vault ?? "default", definition, process.env);
|
|
4897
4916
|
const auth = await resolveVaultAuth(ref.vault ?? "default", definition, process.env);
|
|
4898
4917
|
await provider.authenticate(auth);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { CnosSingleton, default as cnos, default } from './runtime/index.cjs';
|
|
2
|
-
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-
|
|
2
|
+
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-zDTUSVx9.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { CnosSingleton, default as cnos, default } from './runtime/index.js';
|
|
2
|
-
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-
|
|
2
|
+
export { h as CnosPlugin, g as CnosRuntime, a as ConfigEntry, i as DerivedFormula, j as DerivedValue, k as ExprNode, I as InspectResult, L as LoaderPlugin, b as LogicalKey, M as ManifestFile, N as NormalizedManifest, P as ParsedDerivation, l as RuntimeProvider } from './core-zDTUSVx9.js';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runtime_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LDFKY65G.js";
|
|
4
|
+
import "./chunk-DL5G3QSZ.js";
|
|
5
|
+
import "./chunk-O2KTQ6PB.js";
|
|
6
|
+
import "./chunk-JQLV4OQU.js";
|
|
7
|
+
import "./chunk-4AAA2RHV.js";
|
|
8
|
+
import "./chunk-UMVFSHP2.js";
|
|
9
|
+
import "./chunk-N5DX5QEB.js";
|
|
10
|
+
import "./chunk-36AR262B.js";
|
|
11
|
+
import "./chunk-EJT2VJTM.js";
|
|
12
|
+
import "./chunk-ZH5QZQ7C.js";
|
|
13
13
|
export {
|
|
14
14
|
runtime_default as cnos,
|
|
15
15
|
runtime_default as default
|
package/dist/internal.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProvider, t as ResolvedRoot, m as NamespaceName, u as RootResolution, v as SecretReference, g as CnosRuntime, w as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-
|
|
2
|
-
export { l as RuntimeProvider, x as ValidationIssue, y as WorkspaceFile } from './core-
|
|
1
|
+
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProvider, t as ResolvedRoot, m as NamespaceName, u as RootResolution, v as SecretReference, g as CnosRuntime, w as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-zDTUSVx9.cjs';
|
|
2
|
+
export { l as RuntimeProvider, x as ValidationIssue, y as WorkspaceFile } from './core-zDTUSVx9.cjs';
|
|
3
3
|
|
|
4
4
|
declare class CnosError extends Error {
|
|
5
5
|
constructor(message: string);
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProvider, t as ResolvedRoot, m as NamespaceName, u as RootResolution, v as SecretReference, g as CnosRuntime, w as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-
|
|
2
|
-
export { l as RuntimeProvider, x as ValidationIssue, y as WorkspaceFile } from './core-
|
|
1
|
+
import { j as DerivedValue, P as ParsedDerivation, N as NormalizedManifest, n as LoadManifestOptions, o as LoadedManifest, b as LogicalKey, p as NamespaceDefinition, q as VaultDefinition, r as VaultAuthConfig, s as SecretVaultProvider, t as ResolvedRoot, m as NamespaceName, u as RootResolution, v as SecretReference, g as CnosRuntime, w as ValidationSummary, R as ResolvedGraph, S as ServerProjection } from './core-zDTUSVx9.js';
|
|
2
|
+
export { l as RuntimeProvider, x as ValidationIssue, y as WorkspaceFile } from './core-zDTUSVx9.js';
|
|
3
3
|
|
|
4
4
|
declare class CnosError extends Error {
|
|
5
5
|
constructor(message: string);
|
package/dist/internal.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
serializeRuntimeGraph,
|
|
12
12
|
serializeSecretPayload,
|
|
13
13
|
serializeServerProjection
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DL5G3QSZ.js";
|
|
15
15
|
import {
|
|
16
16
|
CnosAuthenticationError,
|
|
17
17
|
CnosSecurityError,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
writeLocalSecret,
|
|
65
65
|
writeRemoteRootCacheMetadata,
|
|
66
66
|
writeVaultSessionKey
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-ZH5QZQ7C.js";
|
|
68
68
|
|
|
69
69
|
// src/codegen/generateTypes.ts
|
|
70
70
|
function toPascalCase(value) {
|
package/dist/plugin/cli-args.js
CHANGED
package/dist/plugin/dotenv.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../core-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../core-zDTUSVx9.cjs';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-EFzezmB3.cjs';
|
|
3
3
|
|
|
4
4
|
declare function parseDotenv(document: string): Record<string, string>;
|
|
5
5
|
declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
|
package/dist/plugin/dotenv.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../core-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../core-zDTUSVx9.js';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-BkorOKW_.js';
|
|
3
3
|
|
|
4
4
|
declare function parseDotenv(document: string): Record<string, string>;
|
|
5
5
|
declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
|
package/dist/plugin/dotenv.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExporterPlugin } from '../core-
|
|
2
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { E as ExporterPlugin } from '../core-zDTUSVx9.cjs';
|
|
2
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Ds1DRwCX.cjs';
|
|
3
3
|
|
|
4
4
|
declare function createEnvExportPlugin(): ExporterPlugin;
|
|
5
5
|
declare function createPublicEnvExportPlugin(): ExporterPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExporterPlugin } from '../core-
|
|
2
|
-
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-
|
|
1
|
+
import { E as ExporterPlugin } from '../core-zDTUSVx9.js';
|
|
2
|
+
export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-CT265rzS.js';
|
|
3
3
|
|
|
4
4
|
declare function createEnvExportPlugin(): ExporterPlugin;
|
|
5
5
|
declare function createPublicEnvExportPlugin(): ExporterPlugin;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createEnvExportPlugin,
|
|
3
3
|
createPublicEnvExportPlugin
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-JQLV4OQU.js";
|
|
5
5
|
import {
|
|
6
6
|
toEnv,
|
|
7
7
|
toPublicEnv
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-ZH5QZQ7C.js";
|
|
9
9
|
export {
|
|
10
10
|
createEnvExportPlugin,
|
|
11
11
|
createPublicEnvExportPlugin,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, m as NamespaceName } from '../core-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, m as NamespaceName } from '../core-zDTUSVx9.cjs';
|
|
2
2
|
|
|
3
3
|
declare function filesystemSecretsReader(filePath: string, document: string, workspaceId?: string): ConfigEntry[];
|
|
4
4
|
declare function createFilesystemSecretsPlugin(): LoaderPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, m as NamespaceName } from '../core-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry, W as WorkspaceRoot, m as NamespaceName } from '../core-zDTUSVx9.js';
|
|
2
2
|
|
|
3
3
|
declare function filesystemSecretsReader(filePath: string, document: string, workspaceId?: string): ConfigEntry[];
|
|
4
4
|
declare function createFilesystemSecretsPlugin(): LoaderPlugin;
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
filesystemSecretsReader,
|
|
6
6
|
filesystemValuesReader,
|
|
7
7
|
yamlObjectToEntries
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-4AAA2RHV.js";
|
|
9
|
+
import "../chunk-ZH5QZQ7C.js";
|
|
10
10
|
export {
|
|
11
11
|
collectFilesystemLayerFiles,
|
|
12
12
|
createFilesystemSecretsPlugin,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../core-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../core-zDTUSVx9.cjs';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-EFzezmB3.cjs';
|
|
3
3
|
|
|
4
4
|
declare function processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
|
|
5
5
|
declare function processNamespaceEntriesFromContext(env: Record<string, string | undefined>, workspaceId?: string): ConfigEntry[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoaderPlugin, a as ConfigEntry } from '../core-
|
|
2
|
-
import { E as EnvMappingConfig } from '../envNaming-
|
|
1
|
+
import { L as LoaderPlugin, a as ConfigEntry } from '../core-zDTUSVx9.js';
|
|
2
|
+
import { E as EnvMappingConfig } from '../envNaming-BkorOKW_.js';
|
|
3
3
|
|
|
4
4
|
declare function processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
|
|
5
5
|
declare function processNamespaceEntriesFromContext(env: Record<string, string | undefined>, workspaceId?: string): ConfigEntry[];
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
createProcessEnvPlugin,
|
|
3
3
|
processEnvEntriesFromObject,
|
|
4
4
|
processNamespaceEntriesFromContext
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-UMVFSHP2.js";
|
|
6
|
+
import "../chunk-ZH5QZQ7C.js";
|
|
7
7
|
export {
|
|
8
8
|
createProcessEnvPlugin,
|
|
9
9
|
processEnvEntriesFromObject,
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -3172,6 +3172,13 @@ function stableSortObject(value) {
|
|
|
3172
3172
|
function stripValuePrefix(key) {
|
|
3173
3173
|
return key.startsWith("value.") ? key.slice("value.".length) : key;
|
|
3174
3174
|
}
|
|
3175
|
+
function resolveProjectedEnvVar(manifest, vaultId, ref) {
|
|
3176
|
+
const mapping = manifest.vaults[vaultId]?.mapping;
|
|
3177
|
+
if (!mapping) {
|
|
3178
|
+
return void 0;
|
|
3179
|
+
}
|
|
3180
|
+
return Object.entries(mapping).find(([, logicalRef]) => logicalRef === ref)?.[0];
|
|
3181
|
+
}
|
|
3175
3182
|
function configHash(values) {
|
|
3176
3183
|
const serialized = JSON.stringify(stableSortObject(values));
|
|
3177
3184
|
return (0, import_node_crypto3.createHash)("sha256").update(serialized).digest("hex");
|
|
@@ -3188,10 +3195,15 @@ function toServerProjection(graph, manifest, cnosVersion = "0.0.0-dev", helpers
|
|
|
3188
3195
|
const publicKeys = Array.from(graph.entries.values()).filter((entry) => entry.namespace === "public").map((entry) => entry.key.slice("public.".length)).sort((left, right) => left.localeCompare(right));
|
|
3189
3196
|
for (const [key, entry] of graph.entries) {
|
|
3190
3197
|
if (entry.namespace === "secret" && isSecretReference(entry.value)) {
|
|
3198
|
+
const vaultId = entry.value.vault ?? "default";
|
|
3199
|
+
const envVar = resolveProjectedEnvVar(manifest, vaultId, entry.value.ref);
|
|
3191
3200
|
secretRefs[key.slice("secret.".length)] = {
|
|
3192
3201
|
provider: entry.value.provider,
|
|
3193
|
-
vault:
|
|
3194
|
-
ref: entry.value.ref
|
|
3202
|
+
vault: vaultId,
|
|
3203
|
+
ref: entry.value.ref,
|
|
3204
|
+
...envVar ? {
|
|
3205
|
+
envVar
|
|
3206
|
+
} : {}
|
|
3195
3207
|
};
|
|
3196
3208
|
continue;
|
|
3197
3209
|
}
|
|
@@ -3646,7 +3658,7 @@ async function createCnos(options = {}) {
|
|
|
3646
3658
|
});
|
|
3647
3659
|
const schemaApplied = applySchemaRules(graph, loadedManifest.manifest.schema);
|
|
3648
3660
|
const promotedGraph = promoteToPublic(schemaApplied.graph, loadedManifest.manifest);
|
|
3649
|
-
const secretCache = options.secretResolution === "lazy" ?
|
|
3661
|
+
const secretCache = options.secretResolution === "lazy" ? new SecretCache() : await batchResolveSecrets(promotedGraph, loadedManifest.manifest, options.processEnv);
|
|
3650
3662
|
return createRuntime(
|
|
3651
3663
|
loadedManifest.manifest,
|
|
3652
3664
|
appendMetaEntries({
|
|
@@ -3699,7 +3711,7 @@ function envVarToLogicalKey(envVar, config = {}) {
|
|
|
3699
3711
|
// package.json
|
|
3700
3712
|
var package_default = {
|
|
3701
3713
|
name: "@kitsy/cnos",
|
|
3702
|
-
version: "1.8.
|
|
3714
|
+
version: "1.8.4",
|
|
3703
3715
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
3704
3716
|
type: "module",
|
|
3705
3717
|
main: "./dist/index.cjs",
|
|
@@ -4889,7 +4901,14 @@ function attachBootstrappedProjection(projection, force = false) {
|
|
|
4889
4901
|
if (!ref) {
|
|
4890
4902
|
return void 0;
|
|
4891
4903
|
}
|
|
4892
|
-
const definition = {
|
|
4904
|
+
const definition = {
|
|
4905
|
+
provider: ref.provider,
|
|
4906
|
+
...ref.envVar ? {
|
|
4907
|
+
mapping: {
|
|
4908
|
+
[ref.envVar]: ref.ref
|
|
4909
|
+
}
|
|
4910
|
+
} : {}
|
|
4911
|
+
};
|
|
4893
4912
|
const provider = createSecretVaultProvider(ref.vault ?? "default", definition, process.env);
|
|
4894
4913
|
const auth = await resolveVaultAuth(ref.vault ?? "default", definition, process.env);
|
|
4895
4914
|
await provider.authenticate(auth);
|
package/dist/runtime/index.d.cts
CHANGED
package/dist/runtime/index.d.ts
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runtime_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-LDFKY65G.js";
|
|
4
|
+
import "../chunk-DL5G3QSZ.js";
|
|
5
|
+
import "../chunk-O2KTQ6PB.js";
|
|
6
|
+
import "../chunk-JQLV4OQU.js";
|
|
7
|
+
import "../chunk-4AAA2RHV.js";
|
|
8
|
+
import "../chunk-UMVFSHP2.js";
|
|
9
|
+
import "../chunk-N5DX5QEB.js";
|
|
10
|
+
import "../chunk-36AR262B.js";
|
|
11
|
+
import "../chunk-EJT2VJTM.js";
|
|
12
|
+
import "../chunk-ZH5QZQ7C.js";
|
|
13
13
|
export {
|
|
14
14
|
runtime_default as default
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './core-
|
|
1
|
+
import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './core-zDTUSVx9.js';
|
|
2
2
|
|
|
3
3
|
declare function toEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToEnvOptions, helpers?: {
|
|
4
4
|
read?: (key: string) => unknown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './core-
|
|
1
|
+
import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './core-zDTUSVx9.cjs';
|
|
2
2
|
|
|
3
3
|
declare function toEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToEnvOptions, helpers?: {
|
|
4
4
|
read?: (key: string) => unknown;
|