@xemahq/biome-supply-chain 0.6.0 → 0.7.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 +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cosign-exec.d.ts +6 -15
- package/dist/lib/cosign-exec.d.ts.map +1 -1
- package/dist/lib/cosign-exec.js +22 -55
- package/dist/lib/cosign-exec.js.map +1 -1
- package/dist/lib/expected-signer.d.ts +15 -0
- package/dist/lib/expected-signer.d.ts.map +1 -0
- package/dist/lib/expected-signer.js +31 -0
- package/dist/lib/expected-signer.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ if (outcome === CosignVerifyOutcome.Verified) {
|
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
OCI verification (`verifyCosignSignature`, `verifyCosignAttestation`)
|
|
39
|
+
OCI verification (`verifyCosignSignature`, `verifyCosignAttestation`) checks a subject against exactly ONE `expectedSigner`, the signer that subject's own trust row declares: `{ kind: CosignTrustAnchorKind.PublicKey, publicKeyPath }` or `{ kind: CosignTrustAnchorKind.KeylessIdentity, identity, issuer }` (exact identity, issuer required). One cosign run each; no other trusted signer is tried, and a missing signer throws `CosignExpectedSignerError` before cosign is spawned. Pass the same signer to the attestation check.
|
|
40
40
|
|
|
41
41
|
Other exports: `verifyCosignSignature`, `verifyCosignAttestation`, `SignatureVerdict`, `ProvenanceVerdict`, `CosignErrorCode`. A failed verification returns an outcome; an empty `anchors` list returns `Failed`. A pinned `trustedRoot` that is missing or has the wrong digest throws `CosignTrustedRootError`.
|
|
42
42
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,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,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,4 +19,5 @@ __exportStar(require("./lib/trust-anchors"), exports);
|
|
|
19
19
|
__exportStar(require("./lib/registry-auth"), exports);
|
|
20
20
|
__exportStar(require("./lib/cosign-exec"), exports);
|
|
21
21
|
__exportStar(require("./lib/keyless-entry"), exports);
|
|
22
|
+
__exportStar(require("./lib/expected-signer"), exports);
|
|
22
23
|
//# 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,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,sDAAoC;AACpC,wDAAsC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RegistryCredential } from './registry-auth';
|
|
2
2
|
import { type CosignBlobTrustAnchor, type CosignMatchedAnchor, type CosignPinnedTrustedRoot } from './trust-anchors';
|
|
3
|
-
import { type
|
|
3
|
+
import { type CosignExpectedSigner } from './expected-signer';
|
|
4
4
|
import { CosignFailureKind, CosignVerifyOutcome } from './verdicts';
|
|
5
5
|
interface CosignRunResult {
|
|
6
6
|
readonly code: number;
|
|
@@ -21,26 +21,17 @@ export declare class CosignCommandError extends Error {
|
|
|
21
21
|
static fromRun(command: string, run: CosignRunResult): CosignCommandError;
|
|
22
22
|
}
|
|
23
23
|
export declare function ensureCosignAvailable(bin?: string): Promise<void>;
|
|
24
|
-
|
|
24
|
+
interface CosignOciSubjectInput {
|
|
25
25
|
readonly ociRef: string;
|
|
26
|
-
readonly
|
|
27
|
-
readonly keyPath?: string | undefined;
|
|
26
|
+
readonly expectedSigner: CosignExpectedSigner;
|
|
28
27
|
readonly trustedRoot?: CosignPinnedTrustedRoot | undefined;
|
|
29
28
|
readonly registryCredential?: RegistryCredential | undefined;
|
|
30
29
|
readonly bin?: string | undefined;
|
|
31
30
|
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export declare function verifyCosignSignature(input: VerifyCosignSignatureInput): Promise<VerifyCosignSignatureResult>;
|
|
36
|
-
export interface VerifyCosignAttestationInput {
|
|
37
|
-
readonly ociRef: string;
|
|
31
|
+
export type VerifyCosignSignatureInput = CosignOciSubjectInput;
|
|
32
|
+
export declare function verifyCosignSignature(input: VerifyCosignSignatureInput): Promise<void>;
|
|
33
|
+
export interface VerifyCosignAttestationInput extends CosignOciSubjectInput {
|
|
38
34
|
readonly predicateType: string;
|
|
39
|
-
readonly entry?: CosignKeylessEntry | undefined;
|
|
40
|
-
readonly keyPath?: string | undefined;
|
|
41
|
-
readonly trustedRoot?: CosignPinnedTrustedRoot | undefined;
|
|
42
|
-
readonly registryCredential?: RegistryCredential | undefined;
|
|
43
|
-
readonly bin?: string | undefined;
|
|
44
35
|
}
|
|
45
36
|
export declare function verifyCosignAttestation(input: VerifyCosignAttestationInput): Promise<void>;
|
|
46
37
|
export interface VerifyCosignBlobInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosign-exec.d.ts","source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Q,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAOtC,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAC1D;AAyDD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CA8BjC"}
|
package/dist/lib/cosign-exec.js
CHANGED
|
@@ -11,6 +11,7 @@ const node_child_process_1 = require("node:child_process");
|
|
|
11
11
|
const registry_auth_1 = require("./registry-auth");
|
|
12
12
|
const trust_anchors_1 = require("./trust-anchors");
|
|
13
13
|
const keyless_entry_1 = require("./keyless-entry");
|
|
14
|
+
const expected_signer_1 = require("./expected-signer");
|
|
14
15
|
const verdicts_1 = require("./verdicts");
|
|
15
16
|
const DEFAULT_COSIGN_BIN = 'cosign';
|
|
16
17
|
function runCosign(bin, args, env = {}) {
|
|
@@ -108,70 +109,36 @@ function buildKeylessArgv(leading, entry, trustedRoot, subject) {
|
|
|
108
109
|
subject,
|
|
109
110
|
];
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
throw new Error(`${command}: keyless mode requires at least one trusted entry`);
|
|
123
|
-
}
|
|
124
|
-
entries.forEach(keyless_entry_1.assertCosignKeylessEntry);
|
|
125
|
-
const failures = [];
|
|
126
|
-
for (const entry of entries) {
|
|
127
|
-
const args = buildKeylessArgv(leading, entry, trustedRoot, ociRef);
|
|
128
|
-
const run = await runCosignAgainstRegistry(bin, args, credential);
|
|
129
|
-
if (run.code === 0) {
|
|
130
|
-
return { identity: entry.identity, issuer: entry.issuer };
|
|
131
|
-
}
|
|
132
|
-
failures.push(CosignCommandError.fromRun(`${bin} ${leading[0]}`, run));
|
|
133
|
-
}
|
|
134
|
-
throw (failures.find((f) => f.kind === verdicts_1.CosignFailureKind.RegistryUnauthenticated) ??
|
|
135
|
-
failures[0]);
|
|
112
|
+
function buildSignerOciArgv(leading, signer, trustedRoot, ociRef) {
|
|
113
|
+
if (signer.kind === trust_anchors_1.CosignTrustAnchorKind.PublicKey) {
|
|
114
|
+
return [
|
|
115
|
+
...leading,
|
|
116
|
+
'--key',
|
|
117
|
+
signer.publicKeyPath,
|
|
118
|
+
...pinnedOciFlags(trustedRoot, true),
|
|
119
|
+
ociRef,
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
return buildKeylessArgv(leading, { identity: signer.identity, issuer: signer.issuer }, trustedRoot, ociRef);
|
|
136
123
|
}
|
|
137
|
-
async function
|
|
124
|
+
async function verifyOciAgainstSigner(leading, input) {
|
|
138
125
|
const bin = input.bin ?? DEFAULT_COSIGN_BIN;
|
|
126
|
+
(0, expected_signer_1.assertCosignExpectedSigner)(input.expectedSigner, input.ociRef);
|
|
139
127
|
if (input.trustedRoot) {
|
|
140
128
|
(0, trust_anchors_1.assertPinnedTrustedRoot)(input.trustedRoot);
|
|
141
129
|
}
|
|
142
|
-
|
|
143
|
-
const args = buildKeyedOciArgv(['verify'], input.keyPath, input.trustedRoot, input.ociRef);
|
|
144
|
-
const run = await runCosignAgainstRegistry(bin, args, input.registryCredential);
|
|
145
|
-
if (run.code !== 0) {
|
|
146
|
-
throw CosignCommandError.fromRun(`${bin} verify`, run);
|
|
147
|
-
}
|
|
148
|
-
return {};
|
|
149
|
-
}
|
|
150
|
-
const verifiedEntry = await verifyAgainstEntries(bin, 'verifyCosignSignature', ['verify'], input.trustedEntries, input.trustedRoot, input.ociRef, input.registryCredential);
|
|
151
|
-
return { verifiedEntry };
|
|
152
|
-
}
|
|
153
|
-
async function verifyCosignAttestation(input) {
|
|
154
|
-
const bin = input.bin ?? DEFAULT_COSIGN_BIN;
|
|
155
|
-
if (input.trustedRoot) {
|
|
156
|
-
(0, trust_anchors_1.assertPinnedTrustedRoot)(input.trustedRoot);
|
|
157
|
-
}
|
|
158
|
-
const leading = ['verify-attestation', '--type', input.predicateType];
|
|
159
|
-
let args;
|
|
160
|
-
if (input.keyPath) {
|
|
161
|
-
args = buildKeyedOciArgv(leading, input.keyPath, input.trustedRoot, input.ociRef);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
if (!input.entry) {
|
|
165
|
-
throw new Error('verifyCosignAttestation: keyless mode requires the entry that verified the signature');
|
|
166
|
-
}
|
|
167
|
-
(0, keyless_entry_1.assertCosignKeylessEntry)(input.entry);
|
|
168
|
-
args = buildKeylessArgv(leading, input.entry, input.trustedRoot, input.ociRef);
|
|
169
|
-
}
|
|
130
|
+
const args = buildSignerOciArgv(leading, input.expectedSigner, input.trustedRoot, input.ociRef);
|
|
170
131
|
const run = await runCosignAgainstRegistry(bin, args, input.registryCredential);
|
|
171
132
|
if (run.code !== 0) {
|
|
172
|
-
throw CosignCommandError.fromRun(`${bin}
|
|
133
|
+
throw CosignCommandError.fromRun(`${bin} ${leading[0]}`, run);
|
|
173
134
|
}
|
|
174
135
|
}
|
|
136
|
+
function verifyCosignSignature(input) {
|
|
137
|
+
return verifyOciAgainstSigner(['verify'], input);
|
|
138
|
+
}
|
|
139
|
+
function verifyCosignAttestation(input) {
|
|
140
|
+
return verifyOciAgainstSigner(['verify-attestation', '--type', input.predicateType], input);
|
|
141
|
+
}
|
|
175
142
|
function buildBlobVerifyArgs(anchor, input) {
|
|
176
143
|
const args = ['verify-blob'];
|
|
177
144
|
if (anchor.kind === trust_anchors_1.CosignTrustAnchorKind.PublicKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosign-exec.js","sourceRoot":"","sources":["../../src/lib/cosign-exec.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cosign-exec.js","sourceRoot":"","sources":["../../src/lib/cosign-exec.ts"],"names":[],"mappings":";;;AA0FA,gCAeC;AA0BD,sDAIC;AA+BD,sDAcC;AA2KD,sDAIC;AAWD,0DAOC;AAqGD,4CAgCC;AA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pC,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;IAGD,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,IAAI,KAAK,qCAAqB,CAAC,eAAe,EAAE,CAAC;YAC1D,IAAA,wCAAwB,EAAC;gBACvB,QAAQ,EAAE,MAAM,CAAC,IAAI;gBACrB,MAAM,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE;aAC/B,CAAC,CAAC;QACL,CAAC;IACH,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,15 @@
|
|
|
1
|
+
import { type CosignKeylessEntry } from './keyless-entry';
|
|
2
|
+
import { CosignTrustAnchorKind } from './trust-anchors';
|
|
3
|
+
export interface CosignKeySigner {
|
|
4
|
+
readonly kind: CosignTrustAnchorKind.PublicKey;
|
|
5
|
+
readonly publicKeyPath: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CosignKeylessSigner extends CosignKeylessEntry {
|
|
8
|
+
readonly kind: CosignTrustAnchorKind.KeylessIdentity;
|
|
9
|
+
}
|
|
10
|
+
export type CosignExpectedSigner = CosignKeySigner | CosignKeylessSigner;
|
|
11
|
+
export declare class CosignExpectedSignerError extends Error {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
export declare function assertCosignExpectedSigner(signer: CosignExpectedSigner | undefined, subject: string): asserts signer is CosignExpectedSigner;
|
|
15
|
+
//# sourceMappingURL=expected-signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expected-signer.d.ts","sourceRoot":"","sources":["../../src/lib/expected-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAYxD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAE/C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAGD,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,eAAe,CAAC;CACtD;AAGD,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,mBAAmB,CAAC;AAGzE,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,OAAO,EAAE,MAAM;CAI5B;AAQD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAsBxC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CosignExpectedSignerError = void 0;
|
|
4
|
+
exports.assertCosignExpectedSigner = assertCosignExpectedSigner;
|
|
5
|
+
const keyless_entry_1 = require("./keyless-entry");
|
|
6
|
+
const trust_anchors_1 = require("./trust-anchors");
|
|
7
|
+
class CosignExpectedSignerError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = 'CosignExpectedSignerError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.CosignExpectedSignerError = CosignExpectedSignerError;
|
|
14
|
+
function assertCosignExpectedSigner(signer, subject) {
|
|
15
|
+
if (!signer) {
|
|
16
|
+
throw new CosignExpectedSignerError(`no signer is declared for ${subject}; refusing to verify it against anything else`);
|
|
17
|
+
}
|
|
18
|
+
switch (signer.kind) {
|
|
19
|
+
case trust_anchors_1.CosignTrustAnchorKind.PublicKey:
|
|
20
|
+
if (!signer.publicKeyPath || signer.publicKeyPath.trim().length === 0) {
|
|
21
|
+
throw new CosignExpectedSignerError(`the key signer declared for ${subject} has no public key path`);
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
case trust_anchors_1.CosignTrustAnchorKind.KeylessIdentity:
|
|
25
|
+
(0, keyless_entry_1.assertCosignKeylessEntry)(signer);
|
|
26
|
+
return;
|
|
27
|
+
default:
|
|
28
|
+
throw new CosignExpectedSignerError(`the signer declared for ${subject} has unknown kind '${String(signer.kind)}'`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=expected-signer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expected-signer.js","sourceRoot":"","sources":["../../src/lib/expected-signer.ts"],"names":[],"mappings":";;;AA4CA,gEAyBC;AArED,mDAGyB;AACzB,mDAAwD;AA2BxD,MAAa,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AALD,8DAKC;AAQD,SAAgB,0BAA0B,CACxC,MAAwC,EACxC,OAAe;IAEf,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,yBAAyB,CACjC,6BAA6B,OAAO,+CAA+C,CACpF,CAAC;IACJ,CAAC;IACD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,qCAAqB,CAAC,SAAS;YAClC,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtE,MAAM,IAAI,yBAAyB,CACjC,+BAA+B,OAAO,yBAAyB,CAChE,CAAC;YACJ,CAAC;YACD,OAAO;QACT,KAAK,qCAAqB,CAAC,eAAe;YACxC,IAAA,wCAAwB,EAAC,MAAM,CAAC,CAAC;YACjC,OAAO;QACT;YACE,MAAM,IAAI,yBAAyB,CACjC,2BAA2B,OAAO,sBAAsB,MAAM,CAAE,MAA6B,CAAC,IAAI,CAAC,GAAG,CACvG,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/biome-supply-chain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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)",
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
"clean": "rm -rf dist dist-test"
|
|
57
57
|
},
|
|
58
58
|
"xemaRelease": {
|
|
59
|
-
"sourceDigest": "sha256:
|
|
59
|
+
"sourceDigest": "sha256:86a1eab069a713e28f5849cd141c7652ff66d3c132618120f2dbf0fc5ecf0673"
|
|
60
60
|
}
|
|
61
61
|
}
|