@clef-sh/core 0.1.11-beta.62 → 0.1.11-beta.66
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/artifact/packer.d.ts.map +1 -1
- package/dist/artifact/signer.d.ts +2 -2
- package/dist/artifact/signer.d.ts.map +1 -1
- package/dist/artifact/types.d.ts +0 -2
- package/dist/artifact/types.d.ts.map +1 -1
- package/dist/index.js +36 -19
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +36 -19
- package/dist/index.mjs.map +3 -3
- package/dist/manifest/parser.d.ts.map +1 -1
- package/dist/migration/backend.d.ts +1 -3
- package/dist/migration/backend.d.ts.map +1 -1
- package/dist/sops/client.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packer.d.ts","sourceRoot":"","sources":["../../src/artifact/packer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAiB,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,SAAS,CAAC;AAIjE;;;;;;GAMG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAFJ,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,aAAa,EAC5B,GAAG,CAAC,EAAE,WAAW,YAAA;IAGpC;;;OAGG;IACG,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"packer.d.ts","sourceRoot":"","sources":["../../src/artifact/packer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAiB,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,SAAS,CAAC;AAIjE;;;;;;GAMG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAFJ,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,aAAa,EAC5B,GAAG,CAAC,EAAE,WAAW,YAAA;IAGpC;;;OAGG;IACG,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAmI9F"}
|
|
@@ -11,8 +11,8 @@ import type { KmsProvider } from "../kms";
|
|
|
11
11
|
* `ciphertextHash` transitively covers the ciphertext content, so the
|
|
12
12
|
* (potentially large) ciphertext itself is not included.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Key names are intentionally excluded from the signing payload — they are
|
|
15
|
+
* not present in the envelope and are derived from decrypted values at runtime.
|
|
16
16
|
*/
|
|
17
17
|
export declare function buildSigningPayload(artifact: PackedArtifact): Buffer;
|
|
18
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/artifact/signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/artifact/signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAkBpE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAUlF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,WAAW,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CASjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,GACtB,OAAO,CAgBT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,kBAAkB,CAU3E"}
|
package/dist/artifact/types.d.ts
CHANGED
|
@@ -30,8 +30,6 @@ export interface PackedArtifact {
|
|
|
30
30
|
ciphertextHash: string;
|
|
31
31
|
/** Base64-encoded ciphertext. Age format for age-only artifacts; AES-256-GCM for KMS envelope artifacts. */
|
|
32
32
|
ciphertext: string;
|
|
33
|
-
/** Secret key names for introspection (not the values). */
|
|
34
|
-
keys: string[];
|
|
35
33
|
/** KMS envelope metadata. Present when the identity uses KMS envelope encryption. */
|
|
36
34
|
envelope?: ArtifactEnvelope;
|
|
37
35
|
/** ISO-8601 expiry timestamp. Artifact is rejected after this time. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/artifact/types.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,+CAA+C;AAC/C,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,cAAc,CAAC;AAE5D,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,UAAU,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/artifact/types.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;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M,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/index.js
CHANGED
|
@@ -7462,8 +7462,26 @@ var ManifestParser = class {
|
|
|
7462
7462
|
"sops.default_backend"
|
|
7463
7463
|
);
|
|
7464
7464
|
}
|
|
7465
|
+
const ageObj = sopsObj.age;
|
|
7466
|
+
const ageRecipients = ageObj && Array.isArray(ageObj.recipients) ? ageObj.recipients : void 0;
|
|
7467
|
+
const parsedAge = ageRecipients ? {
|
|
7468
|
+
age: {
|
|
7469
|
+
recipients: ageRecipients.map((r) => {
|
|
7470
|
+
if (typeof r === "string") return r;
|
|
7471
|
+
if (typeof r === "object" && r !== null) {
|
|
7472
|
+
const obj2 = r;
|
|
7473
|
+
return {
|
|
7474
|
+
key: String(obj2.key ?? ""),
|
|
7475
|
+
...typeof obj2.label === "string" ? { label: obj2.label } : {}
|
|
7476
|
+
};
|
|
7477
|
+
}
|
|
7478
|
+
return String(r);
|
|
7479
|
+
})
|
|
7480
|
+
}
|
|
7481
|
+
} : {};
|
|
7465
7482
|
const sopsConfig = {
|
|
7466
7483
|
default_backend: sopsObj.default_backend,
|
|
7484
|
+
...parsedAge,
|
|
7467
7485
|
...typeof sopsObj.aws_kms_arn === "string" ? { aws_kms_arn: sopsObj.aws_kms_arn } : {},
|
|
7468
7486
|
...typeof sopsObj.gcp_kms_resource_id === "string" ? { gcp_kms_resource_id: sopsObj.gcp_kms_resource_id } : {},
|
|
7469
7487
|
...typeof sopsObj.azure_kv_url === "string" ? { azure_kv_url: sopsObj.azure_kv_url } : {},
|
|
@@ -7829,8 +7847,8 @@ function matchesGlob(filePath, pattern) {
|
|
|
7829
7847
|
var ALWAYS_SKIP_EXTENSIONS = [".enc.yaml", ".enc.json"];
|
|
7830
7848
|
var ALWAYS_SKIP_NAMES = [
|
|
7831
7849
|
".clef-meta.yaml",
|
|
7832
|
-
".
|
|
7833
|
-
// contains
|
|
7850
|
+
"clef.yaml"
|
|
7851
|
+
// manifest — contains public keys and config, not secrets
|
|
7834
7852
|
];
|
|
7835
7853
|
var ALWAYS_SKIP_DIRS = ["node_modules", ".git"];
|
|
7836
7854
|
var MAX_FILE_SIZE = 1024 * 1024;
|
|
@@ -9162,9 +9180,12 @@ var SopsClient = class {
|
|
|
9162
9180
|
}
|
|
9163
9181
|
let result;
|
|
9164
9182
|
try {
|
|
9183
|
+
const configPath = process.platform === "win32" ? "NUL" : "/dev/null";
|
|
9165
9184
|
result = await this.runner.run(
|
|
9166
9185
|
this.sopsCommand,
|
|
9167
9186
|
[
|
|
9187
|
+
"--config",
|
|
9188
|
+
configPath,
|
|
9168
9189
|
"encrypt",
|
|
9169
9190
|
...args,
|
|
9170
9191
|
"--input-type",
|
|
@@ -9401,8 +9422,15 @@ var SopsClient = class {
|
|
|
9401
9422
|
pgp_fingerprint: manifest.sops.pgp_fingerprint
|
|
9402
9423
|
};
|
|
9403
9424
|
switch (config.backend) {
|
|
9404
|
-
case "age":
|
|
9425
|
+
case "age": {
|
|
9426
|
+
const envRecipients = environment ? resolveRecipientsForEnvironment(manifest, environment) : void 0;
|
|
9427
|
+
const recipients = envRecipients ?? manifest.sops.age?.recipients ?? [];
|
|
9428
|
+
const keys = recipients.map((r) => typeof r === "string" ? r : r.key);
|
|
9429
|
+
if (keys.length > 0) {
|
|
9430
|
+
args.push("--age", keys.join(","));
|
|
9431
|
+
}
|
|
9405
9432
|
break;
|
|
9433
|
+
}
|
|
9406
9434
|
case "awskms":
|
|
9407
9435
|
if (config.aws_kms_arn) {
|
|
9408
9436
|
args.push("--kms", config.aws_kms_arn);
|
|
@@ -11437,14 +11465,13 @@ var crypto4 = __toESM(require("crypto"));
|
|
|
11437
11465
|
var crypto3 = __toESM(require("crypto"));
|
|
11438
11466
|
function buildSigningPayload(artifact) {
|
|
11439
11467
|
const fields = [
|
|
11440
|
-
"clef-sig-
|
|
11468
|
+
"clef-sig-v3",
|
|
11441
11469
|
String(artifact.version),
|
|
11442
11470
|
artifact.identity,
|
|
11443
11471
|
artifact.environment,
|
|
11444
11472
|
artifact.revision,
|
|
11445
11473
|
artifact.packedAt,
|
|
11446
11474
|
artifact.ciphertextHash,
|
|
11447
|
-
[...artifact.keys].sort().join(","),
|
|
11448
11475
|
artifact.expiresAt ?? "",
|
|
11449
11476
|
artifact.envelope?.provider ?? "",
|
|
11450
11477
|
artifact.envelope?.keyId ?? "",
|
|
@@ -11567,7 +11594,6 @@ var ArtifactPacker = class {
|
|
|
11567
11594
|
revision,
|
|
11568
11595
|
ciphertextHash,
|
|
11569
11596
|
ciphertext,
|
|
11570
|
-
keys: Object.keys(resolved.values),
|
|
11571
11597
|
envelope: {
|
|
11572
11598
|
provider: kmsConfig.provider,
|
|
11573
11599
|
keyId: kmsConfig.keyId,
|
|
@@ -11601,8 +11627,7 @@ var ArtifactPacker = class {
|
|
|
11601
11627
|
packedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11602
11628
|
revision,
|
|
11603
11629
|
ciphertextHash,
|
|
11604
|
-
ciphertext
|
|
11605
|
-
keys: Object.keys(resolved.values)
|
|
11630
|
+
ciphertext
|
|
11606
11631
|
};
|
|
11607
11632
|
}
|
|
11608
11633
|
const outputDir = path19.dirname(config.outputPath);
|
|
@@ -11665,7 +11690,7 @@ var BackendMigrator = class {
|
|
|
11665
11690
|
this.encryption = encryption;
|
|
11666
11691
|
this.matrixManager = matrixManager;
|
|
11667
11692
|
}
|
|
11668
|
-
async migrate(manifest, repoRoot, options,
|
|
11693
|
+
async migrate(manifest, repoRoot, options, onProgress) {
|
|
11669
11694
|
const { target, environment, dryRun, skipVerify } = options;
|
|
11670
11695
|
if (environment) {
|
|
11671
11696
|
const env = manifest.environments.find((e) => e.name === environment);
|
|
@@ -11735,14 +11760,11 @@ var BackendMigrator = class {
|
|
|
11735
11760
|
}
|
|
11736
11761
|
const manifestPath = path20.join(repoRoot, CLEF_MANIFEST_FILENAME);
|
|
11737
11762
|
const manifestBackup = fs17.readFileSync(manifestPath, "utf-8");
|
|
11738
|
-
const sopsYamlPath = path20.join(repoRoot, ".sops.yaml");
|
|
11739
|
-
const sopsYamlBackup = fs17.existsSync(sopsYamlPath) ? fs17.readFileSync(sopsYamlPath, "utf-8") : void 0;
|
|
11740
11763
|
const fileBackups = /* @__PURE__ */ new Map();
|
|
11741
11764
|
const doc = readManifestYaml(repoRoot);
|
|
11742
11765
|
this.updateManifestDoc(doc, target, environment);
|
|
11743
11766
|
writeManifestYaml(repoRoot, doc);
|
|
11744
11767
|
const updatedManifest = YAML11.parse(YAML11.stringify(doc));
|
|
11745
|
-
callbacks.regenerateSopsConfig();
|
|
11746
11768
|
const migratedFiles = [];
|
|
11747
11769
|
for (const cell of toMigrate) {
|
|
11748
11770
|
try {
|
|
@@ -11761,7 +11783,7 @@ var BackendMigrator = class {
|
|
|
11761
11783
|
);
|
|
11762
11784
|
migratedFiles.push(cell.filePath);
|
|
11763
11785
|
} catch (err) {
|
|
11764
|
-
this.rollback(manifestPath, manifestBackup,
|
|
11786
|
+
this.rollback(manifestPath, manifestBackup, fileBackups);
|
|
11765
11787
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
11766
11788
|
onProgress?.({
|
|
11767
11789
|
type: "warn",
|
|
@@ -11825,15 +11847,10 @@ var BackendMigrator = class {
|
|
|
11825
11847
|
}
|
|
11826
11848
|
}
|
|
11827
11849
|
}
|
|
11828
|
-
rollback(manifestPath, manifestBackup,
|
|
11850
|
+
rollback(manifestPath, manifestBackup, fileBackups) {
|
|
11829
11851
|
for (const [filePath, backup] of fileBackups) {
|
|
11830
11852
|
fs17.writeFileSync(filePath, backup, "utf-8");
|
|
11831
11853
|
}
|
|
11832
|
-
if (sopsYamlBackup !== void 0) {
|
|
11833
|
-
fs17.writeFileSync(sopsYamlPath, sopsYamlBackup, "utf-8");
|
|
11834
|
-
} else if (fs17.existsSync(sopsYamlPath)) {
|
|
11835
|
-
fs17.unlinkSync(sopsYamlPath);
|
|
11836
|
-
}
|
|
11837
11854
|
fs17.writeFileSync(manifestPath, manifestBackup, "utf-8");
|
|
11838
11855
|
}
|
|
11839
11856
|
checkAgeRecipientsWarning(manifest, target, environment, warnings) {
|