@xemahq/biome-supply-chain 0.1.3 → 0.3.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/README.md CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  ensureCosignAvailable,
23
23
  verifyCosignSignature,
24
24
  verifyCosignBlob,
25
+ CosignTrustAnchorKind,
25
26
  SignatureVerdict,
26
27
  CosignVerifyOutcome,
27
28
  } from '@xemahq/biome-supply-chain';
@@ -35,20 +36,41 @@ await verifyCosignSignature({
35
36
  oidcIssuer: 'https://token.actions.githubusercontent.com',
36
37
  });
37
38
 
38
- // Detached blob (caller owns artifact/bundle files on disk)
39
- const { outcome, matchedIdentity } = await verifyCosignBlob({
39
+ // Detached blob (caller owns artifact/bundle/public-key files on disk).
40
+ // A trust anchor is EITHER a keyless certificate-identity pattern OR a NAMED
41
+ // public key; both kinds share one list and one result shape, and the anchors
42
+ // are tried in order until one verifies.
43
+ const { outcome, matchedAnchor } = await verifyCosignBlob({
40
44
  artifactPath: '/tmp/remoteEntry.js',
41
45
  bundlePath: '/tmp/remoteEntry.js.bundle',
42
- trustedIdentityRegexps: ['^https://github.com/xema-dev/.*$'],
46
+ anchors: [
47
+ {
48
+ kind: CosignTrustAnchorKind.KeylessIdentity,
49
+ name: '^https://github.com/xema-dev/.*$', // the name IS the regexp
50
+ },
51
+ {
52
+ kind: CosignTrustAnchorKind.PublicKey,
53
+ name: 'release-2026',
54
+ publicKeyPath: '/etc/cosign/release.pub',
55
+ },
56
+ ],
57
+ // Optional: pin the Sigstore trusted root so KEYLESS anchors verify with
58
+ // `--offline --trusted-root` (air-gap capable). A missing, unreadable or
59
+ // digest-mismatched root THROWS `CosignTrustedRootError` before cosign is
60
+ // spawned — it never falls back to cosign's online default.
61
+ trustedRoot: { path: '/etc/sigstore/trusted-root.json', sha256: '<64 hex>' },
43
62
  });
44
63
  if (outcome === CosignVerifyOutcome.Verified) {
45
- // matchedIdentity is the regexp that verified
64
+ // matchedAnchor is { kind, name } — WHICH anchor vouched for the bytes
46
65
  }
47
66
  ```
48
67
 
68
+ An empty `anchors` list resolves to `Failed` without spawning cosign, and a
69
+ failed verification is a neutral outcome rather than a throw.
70
+
49
71
  Artifact resolution (resolving an OCI ref, or fetching + writing a blob to a
50
- temp file) stays with each consumer; this package owns only the cosign exec and
51
- the verdict enums.
72
+ temp file) stays with each consumer; this package owns only the cosign exec,
73
+ the trust-anchor vocabulary and the verdict enums.
52
74
 
53
75
  ## License
54
76
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './lib/verdicts';
2
+ export * from './lib/trust-anchors';
2
3
  export * from './lib/cosign-exec';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./lib/verdicts"), exports);
18
+ __exportStar(require("./lib/trust-anchors"), exports);
18
19
  __exportStar(require("./lib/cosign-exec"), exports);
19
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,sDAAoC;AACpC,oDAAkC"}
@@ -1,3 +1,4 @@
1
+ import { type CosignBlobTrustAnchor, type CosignMatchedAnchor, type CosignPinnedTrustedRoot } from './trust-anchors';
1
2
  import { CosignVerifyOutcome } from './verdicts';
2
3
  export declare function ensureCosignAvailable(bin?: string): Promise<void>;
3
4
  export interface VerifyCosignSignatureInput {
@@ -5,6 +6,7 @@ export interface VerifyCosignSignatureInput {
5
6
  readonly trustedIdentities: readonly string[];
6
7
  readonly oidcIssuer?: string | undefined;
7
8
  readonly keyPath?: string | undefined;
9
+ readonly trustedRoot?: CosignPinnedTrustedRoot | undefined;
8
10
  readonly bin?: string | undefined;
9
11
  }
10
12
  export declare function verifyCosignSignature(input: VerifyCosignSignatureInput): Promise<void>;
@@ -14,19 +16,21 @@ export interface VerifyCosignAttestationInput {
14
16
  readonly trustedIdentities: readonly string[];
15
17
  readonly oidcIssuer?: string | undefined;
16
18
  readonly keyPath?: string | undefined;
19
+ readonly trustedRoot?: CosignPinnedTrustedRoot | undefined;
17
20
  readonly bin?: string | undefined;
18
21
  }
19
22
  export declare function verifyCosignAttestation(input: VerifyCosignAttestationInput): Promise<void>;
20
23
  export interface VerifyCosignBlobInput {
21
24
  readonly artifactPath: string;
22
25
  readonly bundlePath: string;
23
- readonly trustedIdentityRegexps: readonly string[];
26
+ readonly anchors: readonly CosignBlobTrustAnchor[];
24
27
  readonly oidcIssuer?: string | undefined;
28
+ readonly trustedRoot?: CosignPinnedTrustedRoot | undefined;
25
29
  readonly bin?: string | undefined;
26
30
  }
27
31
  export interface VerifyCosignBlobResult {
28
32
  readonly outcome: CosignVerifyOutcome;
29
- readonly matchedIdentity?: string | undefined;
33
+ readonly matchedAnchor?: CosignMatchedAnchor | undefined;
30
34
  }
31
35
  export declare function verifyCosignBlob(input: VerifyCosignBlobInput): Promise<VerifyCosignBlobResult>;
32
36
  //# sourceMappingURL=cosign-exec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cosign-exec.d.ts","sourceRoot":"","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AAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtC,QAAQ,CAAC,WAAW,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAMD,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAO5B,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAKnD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAWzC,QAAQ,CAAC,WAAW,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAOtC,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAC1D;AA8DD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAoBjC"}
@@ -5,6 +5,7 @@ exports.verifyCosignSignature = verifyCosignSignature;
5
5
  exports.verifyCosignAttestation = verifyCosignAttestation;
6
6
  exports.verifyCosignBlob = verifyCosignBlob;
7
7
  const node_child_process_1 = require("node:child_process");
8
+ const trust_anchors_1 = require("./trust-anchors");
8
9
  const verdicts_1 = require("./verdicts");
9
10
  const DEFAULT_COSIGN_BIN = 'cosign';
10
11
  function runCosign(bin, args) {
@@ -34,8 +35,19 @@ async function ensureCosignAvailable(bin = DEFAULT_COSIGN_BIN) {
34
35
  `(${cause instanceof Error ? cause.message : String(cause)})`);
35
36
  }
36
37
  }
38
+ function pinnedOciFlags(trustedRoot, keyed) {
39
+ if (!trustedRoot) {
40
+ return [];
41
+ }
42
+ return keyed
43
+ ? ['--offline']
44
+ : ['--offline', '--trusted-root', trustedRoot.path];
45
+ }
37
46
  async function verifyCosignSignature(input) {
38
47
  const bin = input.bin ?? DEFAULT_COSIGN_BIN;
48
+ if (input.trustedRoot) {
49
+ (0, trust_anchors_1.assertPinnedTrustedRoot)(input.trustedRoot);
50
+ }
39
51
  const args = ['verify'];
40
52
  if (input.keyPath) {
41
53
  args.push('--key', input.keyPath);
@@ -51,6 +63,7 @@ async function verifyCosignSignature(input) {
51
63
  args.push('--certificate-oidc-issuer', input.oidcIssuer);
52
64
  }
53
65
  }
66
+ args.push(...pinnedOciFlags(input.trustedRoot, Boolean(input.keyPath)));
54
67
  args.push(input.ociRef);
55
68
  const { code, stderr } = await runCosign(bin, args);
56
69
  if (code !== 0) {
@@ -59,6 +72,9 @@ async function verifyCosignSignature(input) {
59
72
  }
60
73
  async function verifyCosignAttestation(input) {
61
74
  const bin = input.bin ?? DEFAULT_COSIGN_BIN;
75
+ if (input.trustedRoot) {
76
+ (0, trust_anchors_1.assertPinnedTrustedRoot)(input.trustedRoot);
77
+ }
62
78
  const args = ['verify-attestation', '--type', input.predicateType];
63
79
  if (input.keyPath) {
64
80
  args.push('--key', input.keyPath);
@@ -74,32 +90,45 @@ async function verifyCosignAttestation(input) {
74
90
  args.push('--certificate-oidc-issuer', input.oidcIssuer);
75
91
  }
76
92
  }
93
+ args.push(...pinnedOciFlags(input.trustedRoot, Boolean(input.keyPath)));
77
94
  args.push(input.ociRef);
78
95
  const { code, stderr } = await runCosign(bin, args);
79
96
  if (code !== 0) {
80
97
  throw new Error(`${bin} verify-attestation failed (code=${code}): ${stderr.slice(-200)}`);
81
98
  }
82
99
  }
100
+ function buildBlobVerifyArgs(anchor, input) {
101
+ const args = ['verify-blob'];
102
+ if (anchor.kind === trust_anchors_1.CosignTrustAnchorKind.PublicKey) {
103
+ args.push('--key', anchor.publicKeyPath, '--bundle', input.bundlePath, '--insecure-ignore-tlog');
104
+ args.push(input.artifactPath);
105
+ return args;
106
+ }
107
+ args.push('--bundle', input.bundlePath, '--certificate-identity-regexp', anchor.name);
108
+ if (input.oidcIssuer) {
109
+ args.push('--certificate-oidc-issuer', input.oidcIssuer);
110
+ }
111
+ if (input.trustedRoot) {
112
+ args.push('--offline', '--trusted-root', input.trustedRoot.path);
113
+ }
114
+ args.push(input.artifactPath);
115
+ return args;
116
+ }
83
117
  async function verifyCosignBlob(input) {
84
118
  const bin = input.bin ?? DEFAULT_COSIGN_BIN;
85
- if (input.trustedIdentityRegexps.length === 0) {
119
+ if (input.anchors.length === 0) {
86
120
  return { outcome: verdicts_1.CosignVerifyOutcome.Failed };
87
121
  }
88
- for (const identity of input.trustedIdentityRegexps) {
89
- const args = [
90
- 'verify-blob',
91
- '--bundle',
92
- input.bundlePath,
93
- '--certificate-identity-regexp',
94
- identity,
95
- ];
96
- if (input.oidcIssuer) {
97
- args.push('--certificate-oidc-issuer', input.oidcIssuer);
98
- }
99
- args.push(input.artifactPath);
100
- const { code } = await runCosign(bin, args);
122
+ if (input.trustedRoot) {
123
+ (0, trust_anchors_1.assertPinnedTrustedRoot)(input.trustedRoot);
124
+ }
125
+ for (const anchor of input.anchors) {
126
+ const { code } = await runCosign(bin, buildBlobVerifyArgs(anchor, input));
101
127
  if (code === 0) {
102
- return { outcome: verdicts_1.CosignVerifyOutcome.Verified, matchedIdentity: identity };
128
+ return {
129
+ outcome: verdicts_1.CosignVerifyOutcome.Verified,
130
+ matchedAnchor: { kind: anchor.kind, name: anchor.name },
131
+ };
103
132
  }
104
133
  }
105
134
  return { outcome: verdicts_1.C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CAAC;AAaM,KAAK,UAAU,gBAAgB,CACpC,KAA4B;IAE5B,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,kBAAkB,CAAC;IAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,8BAAmB,CAAC,MAAM,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QAGtB,IAAA,uCAAuB,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1E,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,8BAAmB,CAAC,QAAQ;gBACrC,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;aACxD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,8BAAmB,CAAC,MAAM,EAAE,CAAC;AACjD,CAAC"}
@@ -0,0 +1,31 @@
1
+ export declare enum CosignTrustAnchorKind {
2
+ KeylessIdentity = "keyless-identity",
3
+ PublicKey = "public-key"
4
+ }
5
+ export interface CosignKeylessIdentityAnchor {
6
+ readonly kind: CosignTrustAnchorKind.KeylessIdentity;
7
+ readonly name: string;
8
+ }
9
+ export interface CosignPublicKeyAnchor {
10
+ readonly kind: CosignTrustAnchorKind.PublicKey;
11
+ readonly name: string;
12
+ readonly publicKeyPath: string;
13
+ }
14
+ export type CosignBlobTrustAnchor = CosignKeylessIdentityAnchor | CosignPublicKeyAnchor;
15
+ export interface CosignMatchedAnchor {
16
+ readonly kind: CosignTrustAnchorKind;
17
+ readonly name: string;
18
+ }
19
+ export interface CosignPinnedTrustedRoot {
20
+ readonly path: string;
21
+ readonly sha256: string;
22
+ }
23
+ export declare class CosignTrustedRootError extends Error {
24
+ constructor(message: string);
25
+ }
26
+ export declare function assertPinnedTrustedRoot(root: CosignPinnedTrustedRoot): void;
27
+ export declare function parsePinnedTrustedRoot(path: string | undefined, sha256: string | undefined, varNames: {
28
+ readonly path: string;
29
+ readonly sha256: string;
30
+ }): CosignPinnedTrustedRoot | undefined;
31
+ //# sourceMappingURL=trust-anchors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust-anchors.d.ts","sourceRoot":"","sources":["../../src/lib/trust-anchors.ts"],"names":[],"mappings":"AAiBA,oBAAY,qBAAqB;IAC/B,eAAe,qBAAqB;IACpC,SAAS,eAAe;CACzB;AAQD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,eAAe,CAAC;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAQD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAGD,MAAM,MAAM,qBAAqB,GAC7B,2BAA2B,GAC3B,qBAAqB,CAAC;AAQ1B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAcD,MAAM,WAAW,uBAAuB;IAEtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAUD,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAuBD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,uBAAuB,GAAG,IAAI,CA0C3E;AA8BD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3D,uBAAuB,GAAG,SAAS,CAerC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CosignTrustedRootError = exports.CosignTrustAnchorKind = void 0;
4
+ exports.assertPinnedTrustedRoot = assertPinnedTrustedRoot;
5
+ exports.parsePinnedTrustedRoot = parsePinnedTrustedRoot;
6
+ const node_crypto_1 = require("node:crypto");
7
+ const node_fs_1 = require("node:fs");
8
+ var CosignTrustAnchorKind;
9
+ (function (CosignTrustAnchorKind) {
10
+ CosignTrustAnchorKind["KeylessIdentity"] = "keyless-identity";
11
+ CosignTrustAnchorKind["PublicKey"] = "public-key";
12
+ })(CosignTrustAnchorKind || (exports.CosignTrustAnchorKind = CosignTrustAnchorKind = {}));
13
+ class CosignTrustedRootError extends Error {
14
+ constructor(message) {
15
+ super(message);
16
+ this.name = 'CosignTrustedRootError';
17
+ }
18
+ }
19
+ exports.CosignTrustedRootError = CosignTrustedRootError;
20
+ const SHA256_HEX = /^[a-f0-9]{64}$/u;
21
+ const SIGSTORE_TRUSTED_ROOT_MEDIA_TYPE = 'application/vnd.dev.sigstore.trustedroot+json;version=0.1';
22
+ const MAX_TRUSTED_ROOT_BYTES = 8 * 1024 * 1024;
23
+ function assertPinnedTrustedRoot(root) {
24
+ if (!SHA256_HEX.test(root.sha256)) {
25
+ throw new CosignTrustedRootError(`pinned Sigstore trusted-root digest '${root.sha256}' is not a lowercase-hex sha256`);
26
+ }
27
+ let bytes;
28
+ try {
29
+ bytes = (0, node_fs_1.readFileSync)(root.path);
30
+ }
31
+ catch (cause) {
32
+ throw new CosignTrustedRootError(`pinned Sigstore trusted root '${root.path}' could not be read: ` +
33
+ `${cause instanceof Error ? cause.message : String(cause)}`);
34
+ }
35
+ if (bytes.byteLength > MAX_TRUSTED_ROOT_BYTES) {
36
+ throw new CosignTrustedRootError(`pinned Sigstore trusted root '${root.path}' is ${bytes.byteLength} bytes, over the ${MAX_TRUSTED_ROOT_BYTES}-byte ceiling`);
37
+ }
38
+ const actual = (0, node_crypto_1.createHash)('sha256').update(bytes).digest('hex');
39
+ if (actual !== root.sha256) {
40
+ throw new CosignTrustedRootError(`pinned Sigstore trusted-root digest mismatch for '${root.path}': expected ${root.sha256}, got ${actual}`);
41
+ }
42
+ let document;
43
+ try {
44
+ document = JSON.parse(bytes.toString('utf8'));
45
+ }
46
+ catch (cause) {
47
+ throw new CosignTrustedRootError(`pinned Sigstore trusted root '${root.path}' is not valid JSON: ` +
48
+ `${cause instanceof Error ? cause.message : String(cause)}`);
49
+ }
50
+ const mediaType = document?.mediaType;
51
+ if (mediaType !== SIGSTORE_TRUSTED_ROOT_MEDIA_TYPE) {
52
+ throw new CosignTrustedRootError(`pinned Sigstore trusted root '${root.path}' declares mediaType ` +
53
+ `'${String(mediaType)}' — expected '${SIGSTORE_TRUSTED_ROOT_MEDIA_TYPE}'`);
54
+ }
55
+ }
56
+ function parsePinnedTrustedRoot(path, sha256, varNames) {
57
+ const trimmedPath = (path ?? '').trim();
58
+ const trimmedSha = (sha256 ?? '').trim();
59
+ if (trimmedPath.length === 0 && trimmedSha.length === 0) {
60
+ return undefined;
61
+ }
62
+ if (trimmedPath.length === 0 || trimmedSha.length === 0) {
63
+ throw new CosignTrustedRootError(`${varNames.path} and ${varNames.sha256} must be set together. A path ` +
64
+ 'without a pinned digest is not a trust anchor (it is whatever last ' +
65
+ 'wrote that file), and a digest without a path gates nothing. Set ' +
66
+ 'both, or neither.');
67
+ }
68
+ return { path: trimmedPath, sha256: trimmedSha };
69
+ }
70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AE,CAAC;IACxC,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,sBAAsB,CAC9B,GAAG,QAAQ,CAAC,IAAI,QAAQ,QAAQ,CAAC,MAAM,gCAAgC;YACrE,qEAAqE;YACrE,mEAAmE;YACnE,mBAAmB,CACtB,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/biome-supply-chain",
3
- "version": "0.1.3",
3
+ "version": "0.3.0",
4
4
  "description": "Shared cosign supply-chain verification for Xema biomes: the single cosign CLI exec + the signature/provenance verdict enums used by biome-fetcher-api (OCI bundle verification) and xema-store-api. Node-builtins only.",
5
5
  "license": "LicenseRef-Xema-BSL-1.1",
6
6
  "author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",