@xemahq/xema 0.27.0 → 0.29.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/dist/commands/edition.d.ts.map +1 -1
- package/dist/commands/edition.js +8 -7
- package/dist/commands/edition.js.map +1 -1
- package/dist/dev/env-defaults.d.ts.map +1 -1
- package/dist/dev/env-defaults.js +0 -1
- package/dist/dev/env-defaults.js.map +1 -1
- package/dist/edition/verify-image-evidence.bundle.mjs +231 -50
- package/dist/edition/verify-image-evidence.bundle.provenance.json +55 -43
- package/dist/runtime/edition/verb-map.d.ts +2 -1
- package/dist/runtime/edition/verb-map.d.ts.map +1 -1
- package/dist/runtime/edition/verb-map.js +2 -0
- package/dist/runtime/edition/verb-map.js.map +1 -1
- package/dist/runtime/runner/chart-set-lock.d.ts +4 -1
- package/dist/runtime/runner/chart-set-lock.d.ts.map +1 -1
- package/dist/runtime/runner/chart-set-lock.js +39 -4
- package/dist/runtime/runner/chart-set-lock.js.map +1 -1
- package/edition/README.md +76 -41
- package/edition/build-biome-index.mjs +1 -1
- package/edition/build-platform-service-index.mjs +1 -1
- package/edition/build-runtime-image-source-index.mjs +64 -20
- package/edition/catalogue-fetch.mjs +36 -9
- package/edition/catalogue-pin.mjs +71 -0
- package/edition/catalogue.mjs +11 -0
- package/edition/chart-set-source-commit.mjs +17 -7
- package/edition/checkout-indexed-source-repositories.mjs +17 -17
- package/edition/customer-flags.mjs +0 -1
- package/edition/develop-customer-edition.mjs +23 -5
- package/edition/develop-edition.mjs +147 -48
- package/edition/develop-freeze.mjs +69 -25
- package/edition/develop-seal.mjs +39 -25
- package/edition/dist-check.mjs +1 -1
- package/edition/edition-artifact.mjs +79 -18
- package/edition/edition-biome-manifests.mjs +2 -3
- package/edition/edition-chart-set.mjs +59 -6
- package/edition/edition-config.mjs +45 -21
- package/edition/edition-constants.mjs +10 -4
- package/edition/edition-contract-parse.mjs +52 -0
- package/edition/edition-contract.json +21 -5
- package/edition/edition-workspace.mjs +23 -9
- package/edition/evidence-checkout.mjs +22 -1
- package/edition/evidence-trust-policy.mjs +142 -78
- package/edition/external-source-walk.mjs +48 -61
- package/edition/git-source-auth.mjs +104 -25
- package/edition/image-delivery-entitlement-descriptor.mjs +106 -0
- package/edition/image-evidence.mjs +21 -3
- package/edition/kernel-contract-authority.mjs +23 -1
- package/edition/lib.mjs +16 -24
- package/edition/oras.mjs +1 -1
- package/edition/pin-source.mjs +6 -1
- package/edition/produce-image-delivery-entitlement-evidence.mjs +12 -12
- package/edition/registry-credentials.mjs +11 -1
- package/edition/release-channel-guard.mjs +11 -1
- package/edition/release-edition-artifact.mjs +5 -6
- package/edition/resolve-chart-set.mjs +50 -30
- package/edition/resolve-customer-edition.mjs +63 -7
- package/edition/resolve-distribution.mjs +1 -1
- package/edition/resolve-edition.mjs +12 -11
- package/edition/resolve-images.mjs +36 -15
- package/edition/seal-image-digests.mjs +31 -7
- package/edition/source-closure.mjs +1 -2
- package/edition/trust-policy-arming-verb.mjs +68 -0
- package/edition/verify-image-evidence.mjs +40 -12
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edition.d.ts","sourceRoot":"","sources":["../../src/commands/edition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"edition.d.ts","sourceRoot":"","sources":["../../src/commands/edition.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCzC,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiBtD"}
|
package/dist/commands/edition.js
CHANGED
|
@@ -5,12 +5,12 @@ const exit_codes_1 = require("../lib/exit-codes");
|
|
|
5
5
|
const run_entry_1 = require("../runtime/edition/run-entry");
|
|
6
6
|
const verb_map_1 = require("../runtime/edition/verb-map");
|
|
7
7
|
const VERB_SUMMARY = {
|
|
8
|
-
[verb_map_1.EditionVerb.Resolve]: 'Resolve the whole release lock set of an edition: xema edition resolve <id> [--check]; or a customer edition against
|
|
9
|
-
[verb_map_1.EditionVerb.Seal]: 'Seal the image digests of an edition: xema edition seal <id>',
|
|
10
|
-
[verb_map_1.EditionVerb.Develop]: 'Resolve a develop edition snapshot: xema edition develop <resolve|target|freeze-graph|freeze-sources|check-existing|check-overrides> ...; or a customer develop edition: xema edition develop resolve --definition <file>
|
|
11
|
-
[verb_map_1.EditionVerb.Artifact]: 'Write the OCI artifact files of a release edition from the committed sealed locks: xema edition artifact <id> --channel release --registry <
|
|
8
|
+
[verb_map_1.EditionVerb.Resolve]: 'Resolve the whole release lock set of an edition: xema edition resolve <id> [--check]; or a customer edition against the catalogue pinned in catalogue.pin.json beside the definition: xema edition resolve --definition <file> --channel <release|develop> --out <dir> [--source-image <source>=<registry>/<prefix>]...',
|
|
9
|
+
[verb_map_1.EditionVerb.Seal]: 'Seal the image digests of an edition: xema edition seal <id> [--definition <file>] (a customer edition seals against the release catalogue pinned in catalogue.pin.json beside the definition)',
|
|
10
|
+
[verb_map_1.EditionVerb.Develop]: 'Resolve a develop edition snapshot: xema edition develop <resolve|target|freeze-graph|freeze-sources|check-existing|check-overrides> ...; or a customer develop edition (catalogue pinned in catalogue.pin.json beside the definition): xema edition develop <resolve|target|check-existing|freeze-sources|kernel-commit> --definition <file> ... (resolve: --pins <file> --out <dir> --registry <root> --engine-image <repo>@sha256:<digest> [--source-image <source>=<registry>/<prefix>]...; kernel-commit prints the contract authority source commit of the catalogue)',
|
|
11
|
+
[verb_map_1.EditionVerb.Artifact]: 'Write the OCI artifact files of a release edition from the committed sealed locks: xema edition artifact <id> --channel release --registry <root> --coordinate <tag> --engine-image <repo>@sha256:<digest> --out <dir>',
|
|
12
12
|
[verb_map_1.EditionVerb.Catalogue]: 'Write the catalogue.json of a release offering from its committed sealed locks: xema edition catalogue <id> --out <dir>',
|
|
13
|
-
[verb_map_1.EditionVerb.Index]: `Rebuild a catalogue index: xema edition index <${Object.values(verb_map_1.EditionIndexKind).join('|')}> [--check]; xema edition index runtime-image-source --repin-contract-authority replaces only the contract authority of the committed index with the kernel checkout's`,
|
|
13
|
+
[verb_map_1.EditionVerb.Index]: `Rebuild a catalogue index: xema edition index <${Object.values(verb_map_1.EditionIndexKind).join('|')}> [--check]; xema edition index runtime-image-source --repin-contract-authority --kernel-commit <40-hex> replaces only the contract authority of the committed index with the kernel checkout's at the stated commit (its HEAD must equal it)`,
|
|
14
14
|
[verb_map_1.EditionVerb.Check]: 'Check the committed edition locks and catalogue indices',
|
|
15
15
|
[verb_map_1.EditionVerb.Why]: 'Explain why a biome is in an edition: xema edition why <id> <biome>',
|
|
16
16
|
[verb_map_1.EditionVerb.VerifyPlatforms]: 'Prove the registry serves every required platform of an edition: xema edition verify-platforms <id>',
|
|
@@ -21,8 +21,9 @@ const VERB_SUMMARY = {
|
|
|
21
21
|
[verb_map_1.EditionVerb.List]: 'Print the offering ids of an editions root as JSON: xema edition list --editions-root <dir>',
|
|
22
22
|
[verb_map_1.EditionVerb.Locks]: 'Print the validated locks of an edition as JSON: xema edition locks <id> --data-root <dir> --editions-root <dir> --kernel <dir>',
|
|
23
23
|
[verb_map_1.EditionVerb.ChartSet]: `Pin the chart set of the editions to the charts the registry serves: xema edition chart-set <${Object.values(verb_map_1.EditionChartSetOperation).join('|')}> [--check] --data-root <dir> --editions-root <dir> --deploy-root <dir> --kernel <dir>; source-commit prints the commit each publisher closed its locked set at (--data-root, --kernel)`,
|
|
24
|
-
[verb_map_1.EditionVerb.BiomeManifests]: 'Print the pinned xema-biome.json of every biome of an edition as JSON: xema edition biome-manifests <id> --json --data-root <dir> --editions-root <dir> --sources-root <dir> --
|
|
25
|
-
[verb_map_1.EditionVerb.
|
|
24
|
+
[verb_map_1.EditionVerb.BiomeManifests]: 'Print the pinned xema-biome.json of every biome of an edition as JSON: xema edition biome-manifests <id> --json --data-root <dir> --editions-root <dir> --sources-root <dir> --kernel <dir>',
|
|
25
|
+
[verb_map_1.EditionVerb.Arming]: 'Print whether the data root evidence trust policy is armed on one channel as one JSON line, exiting 0 only when armed: xema edition arming --channel <release|develop> --data-root <dir> --kernel <dir>',
|
|
26
|
+
[verb_map_1.EditionVerb.SourceClosure]: 'Print the source tree hash and workspace closure of a source directory at a commit as JSON: xema edition source-closure --repo <repo> --path <dir> --commit <sha> --sources-root <dir> --kernel <dir>',
|
|
26
27
|
};
|
|
27
28
|
function registerCommand(program) {
|
|
28
29
|
const edition = program.command('edition').summary('Resolve, seal and check editions');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edition.js","sourceRoot":"","sources":["../../src/commands/edition.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"edition.js","sourceRoot":"","sources":["../../src/commands/edition.ts"],"names":[],"mappings":";;AAyCA,0CAiBC;AA1DD,kDAA8D;AAC9D,4DAA8D;AAC9D,0DAA2H;AAW3H,MAAM,YAAY,GAA0C;IAC1D,CAAC,sBAAW,CAAC,OAAO,CAAC,EACnB,0TAA0T;IAC5T,CAAC,sBAAW,CAAC,IAAI,CAAC,EAAE,gMAAgM;IACpN,CAAC,sBAAW,CAAC,OAAO,CAAC,EAAE,6iBAA6iB;IACpkB,CAAC,sBAAW,CAAC,QAAQ,CAAC,EACpB,wNAAwN;IAC1N,CAAC,sBAAW,CAAC,SAAS,CAAC,EAAE,yHAAyH;IAClJ,CAAC,sBAAW,CAAC,KAAK,CAAC,EAAE,kDAAkD,MAAM,CAAC,MAAM,CAAC,2BAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,+OAA+O;IAC/V,CAAC,sBAAW,CAAC,KAAK,CAAC,EAAE,yDAAyD;IAC9E,CAAC,sBAAW,CAAC,GAAG,CAAC,EAAE,qEAAqE;IACxF,CAAC,sBAAW,CAAC,eAAe,CAAC,EAAE,qGAAqG;IACpI,CAAC,sBAAW,CAAC,eAAe,CAAC,EAAE,wEAAwE;IACvG,CAAC,sBAAW,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ghcr.io,docker.io,registry.k8s.io,quay.io,127.0.0.1:5000',
|
|
139
|
-
MAILOPS_OAUTH_REDIRECT_URI: 'http://127.0.0.1:3000/mailops/oauth/callback',
|
|
140
139
|
LLM_GATEWAY_API_URL: backingUrl('llm-gateway-api'),
|
|
141
140
|
});
|
|
142
141
|
function applyDevEnvDefaults(env = process.env) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-defaults.js","sourceRoot":"","sources":["../../src/dev/env-defaults.ts"],"names":[],"mappings":";;;AAsOA,gEAaC;
|
|
1
|
+
{"version":3,"file":"env-defaults.js","sourceRoot":"","sources":["../../src/dev/env-defaults.ts"],"names":[],"mappings":";;;AAsOA,gEAaC;AAmND,kDAsEC;AAzeD,6CAAkD;AAElD,gEAAmE;AACnE,wFAKoD;AAcvC,QAAA,QAAQ,GAAqC,MAAM,CAAC,MAAM,CAAC;IAEtE,oBAAoB,EAAE,IAAI;IAC1B,wBAAwB,EAAE,IAAI;IAE9B,qBAAqB,EAAE,IAAI;IAC3B,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;IAErB,mBAAmB,EAAE,IAAI;IACzB,yBAAyB,EAAE,IAAI;IAC/B,cAAc,EAAE,IAAI;IACpB,4BAA4B,EAAE,IAAI;IAClC,qBAAqB,EAAE,IAAI;IAC3B,mBAAmB,EAAE,IAAI;IAIzB,YAAY,EAAE,IAAI;IAClB,oBAAoB,EAAE,IAAI;IAC1B,sBAAsB,EAAE,IAAI;IAC5B,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,IAAI;IACzB,gBAAgB,EAAE,IAAI;IAKtB,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;IACzB,oBAAoB,EAAE,IAAI;IAC1B,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,uBAAuB,EAAE,IAAI;IAC7B,gBAAgB,EAAE,IAAI;IACtB,4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,oBAAoB,CAAC,CAAC,CAAC;IACzE,YAAY,CACV,iBAAiB,EACjB,GAAG,MAAM,CAAC,oBAAoB,CAAC,wBAAwB,CACxD,CAAC;IAEF,YAAY,CACV,iCAAiC,EACjC,MAAM,CAAC,wBAAwB,CAAC,CACjC,CAAC;IACF,YAAY,CAAC,wBAAwB,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAElE,YAAY,CAAC,sBAAsB,EAAE,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;IACtE,YAAY,CACV,yBAAyB,EACzB,GAAG,MAAM,CAAC,uBAAuB,CAAC,wBAAwB,CAC3D,CAAC;IAMF,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAQ,EAAE;QACzD,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YAChD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAmB,EAAC,KAAK,EAAE;gBAChD,aAAa,EAAE,IAAI;aACpB,CAAC,CAAC;YACH,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU;iBACnB,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;iBACxC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IACF,2BAA2B,CAAC,oCAAoC,CAAC,CAAC;IAClE,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -51003,8 +51003,7 @@ var WorkspaceRoot = Object.freeze({
|
|
|
51003
51003
|
Sources: "sourcesRoot",
|
|
51004
51004
|
Kernel: "kernelPackageDir",
|
|
51005
51005
|
Deploy: "deployRoot",
|
|
51006
|
-
Cache: "cacheDir"
|
|
51007
|
-
SourceHash: "sourceHashPackageDir"
|
|
51006
|
+
Cache: "cacheDir"
|
|
51008
51007
|
});
|
|
51009
51008
|
var WORKSPACE_FLAGS = Object.freeze({
|
|
51010
51009
|
[WorkspaceRoot.Data]: "--data-root",
|
|
@@ -51012,8 +51011,7 @@ var WORKSPACE_FLAGS = Object.freeze({
|
|
|
51012
51011
|
[WorkspaceRoot.Sources]: "--sources-root",
|
|
51013
51012
|
[WorkspaceRoot.Kernel]: "--kernel",
|
|
51014
51013
|
[WorkspaceRoot.Deploy]: "--deploy-root",
|
|
51015
|
-
[WorkspaceRoot.Cache]: "--cache-dir"
|
|
51016
|
-
[WorkspaceRoot.SourceHash]: "--source-hash"
|
|
51014
|
+
[WorkspaceRoot.Cache]: "--cache-dir"
|
|
51017
51015
|
});
|
|
51018
51016
|
var ROOT_MEANING = Object.freeze({
|
|
51019
51017
|
[WorkspaceRoot.Data]: "the directory holding the catalogue indices and the trust policy",
|
|
@@ -51021,8 +51019,7 @@ var ROOT_MEANING = Object.freeze({
|
|
|
51021
51019
|
[WorkspaceRoot.Sources]: "the directory holding source checkouts at repos/<r> and submodules/<r>",
|
|
51022
51020
|
[WorkspaceRoot.Kernel]: "the BUILT kernel-contracts package directory",
|
|
51023
51021
|
[WorkspaceRoot.Deploy]: "the deploy (chart tree) checkout",
|
|
51024
|
-
[WorkspaceRoot.Cache]: "a writable directory for fetched artifacts"
|
|
51025
|
-
[WorkspaceRoot.SourceHash]: "the BUILT distribution-source-hash package directory (the source-tree and image-input hash implementation)"
|
|
51022
|
+
[WorkspaceRoot.Cache]: "a writable directory for fetched artifacts"
|
|
51026
51023
|
});
|
|
51027
51024
|
var configured = Object.freeze({});
|
|
51028
51025
|
function assertDirectory(name, value) {
|
|
@@ -51062,7 +51059,7 @@ function root(name) {
|
|
|
51062
51059
|
var dataRoot = () => root(WorkspaceRoot.Data);
|
|
51063
51060
|
var editionsRoot = () => root(WorkspaceRoot.Editions);
|
|
51064
51061
|
var kernelPackageDir = () => root(WorkspaceRoot.Kernel);
|
|
51065
|
-
function configureEditionWorkspaceFromArgv(argv, needs) {
|
|
51062
|
+
function configureEditionWorkspaceFromArgv(argv, needs, { refuseOthers = false } = {}) {
|
|
51066
51063
|
const byFlag = new Map(
|
|
51067
51064
|
Object.entries(WORKSPACE_FLAGS).map(([name, flag]) => [flag, name])
|
|
51068
51065
|
);
|
|
@@ -51077,6 +51074,11 @@ function configureEditionWorkspaceFromArgv(argv, needs) {
|
|
|
51077
51074
|
rest.push(arg);
|
|
51078
51075
|
continue;
|
|
51079
51076
|
}
|
|
51077
|
+
if (refuseOthers && !needs.includes(name)) {
|
|
51078
|
+
throw new Error(
|
|
51079
|
+
`${flag} is not a root this command takes (it takes: ${needs.length === 0 ? "no root" : needs.map((root2) => WORKSPACE_FLAGS[root2]).join(" ")})`
|
|
51080
|
+
);
|
|
51081
|
+
}
|
|
51080
51082
|
const value = eq > 0 ? arg.slice(eq + 1) : argv[i += 1];
|
|
51081
51083
|
if (typeof value !== "string" || value.length === 0 || value.startsWith("--")) {
|
|
51082
51084
|
throw new Error(`${flag} requires a directory path`);
|
|
@@ -51108,16 +51110,80 @@ var CHART_VERSION_COORDINATE = Object.freeze({
|
|
|
51108
51110
|
[EditionChannel.Release]: /-h[0-9a-f]{16}$/,
|
|
51109
51111
|
[EditionChannel.Develop]: /-dev\.[0-9a-f]{12}$/
|
|
51110
51112
|
});
|
|
51113
|
+
var DEVELOP_CHART_VERSION_PREFIX = "0.0.0-dev.";
|
|
51114
|
+
var DEVELOP_CHART_SHA_LENGTH = 12;
|
|
51115
|
+
var DEVELOP_CHART_VERSION_PATTERN = new RegExp(
|
|
51116
|
+
`^${DEVELOP_CHART_VERSION_PREFIX.replaceAll(".", "\\.")}[0-9a-f]{${DEVELOP_CHART_SHA_LENGTH}}$`
|
|
51117
|
+
);
|
|
51118
|
+
|
|
51119
|
+
// edition/edition-contract-parse.mjs
|
|
51120
|
+
var EDITION_CONTRACT_SCHEMA = "xema.edition-contract/v2";
|
|
51121
|
+
var SEGMENT = /^[a-z0-9][a-z0-9.-]*$/;
|
|
51122
|
+
function parseEditionContract(contract) {
|
|
51123
|
+
if (contract === null || typeof contract !== "object" || Array.isArray(contract)) {
|
|
51124
|
+
throw new Error("edition-contract.json must be a JSON object");
|
|
51125
|
+
}
|
|
51126
|
+
if (contract.schema !== EDITION_CONTRACT_SCHEMA) {
|
|
51127
|
+
throw new Error(`edition-contract.json: schema is ${JSON.stringify(contract.schema)}, expected ${JSON.stringify(EDITION_CONTRACT_SCHEMA)}`);
|
|
51128
|
+
}
|
|
51129
|
+
if (typeof contract.vendoring !== "string" || contract.vendoring === "") {
|
|
51130
|
+
throw new Error('edition-contract.json: "vendoring" must be the non-empty statement of how a consumer vendors this file');
|
|
51131
|
+
}
|
|
51132
|
+
if (typeof contract.repositoryPrefix !== "string" || contract.repositoryPrefix === "") {
|
|
51133
|
+
throw new Error('edition-contract.json: "repositoryPrefix" must be a non-empty string');
|
|
51134
|
+
}
|
|
51135
|
+
const repositories = contract.repositories;
|
|
51136
|
+
if (repositories === null || typeof repositories !== "object" || Array.isArray(repositories)) {
|
|
51137
|
+
throw new Error('edition-contract.json has no "repositories": the namespace segment of each channel is read from it and nowhere else');
|
|
51138
|
+
}
|
|
51139
|
+
const channels = Object.values(EditionChannel);
|
|
51140
|
+
const keys = Object.keys(repositories);
|
|
51141
|
+
const unknown = keys.filter((key) => !channels.includes(key));
|
|
51142
|
+
if (unknown.length > 0 || keys.length !== channels.length) {
|
|
51143
|
+
throw new Error(
|
|
51144
|
+
`edition-contract.json: "repositories" is exactly one entry per channel (${channels.join(" | ")}); ` + (unknown.length > 0 ? `unknown channel ${unknown.map((key) => JSON.stringify(key)).join(", ")}` : `got ${keys.join(", ") || "none"}`)
|
|
51145
|
+
);
|
|
51146
|
+
}
|
|
51147
|
+
const segments = /* @__PURE__ */ new Set();
|
|
51148
|
+
for (const channel of channels) {
|
|
51149
|
+
const entry = repositories[channel];
|
|
51150
|
+
const entryKeys = entry !== null && typeof entry === "object" && !Array.isArray(entry) ? Object.keys(entry) : [];
|
|
51151
|
+
if (entryKeys.join() !== "namespaceSegment" || typeof entry.namespaceSegment !== "string" || !SEGMENT.test(entry.namespaceSegment)) {
|
|
51152
|
+
throw new Error(`edition-contract.json: repositories.${channel} is exactly {namespaceSegment}, one lowercase path segment`);
|
|
51153
|
+
}
|
|
51154
|
+
segments.add(entry.namespaceSegment);
|
|
51155
|
+
}
|
|
51156
|
+
if (segments.size !== channels.length) {
|
|
51157
|
+
throw new Error("edition-contract.json: the channels' namespace segments must differ");
|
|
51158
|
+
}
|
|
51159
|
+
return contract;
|
|
51160
|
+
}
|
|
51111
51161
|
|
|
51112
51162
|
// edition/edition-contract.json
|
|
51113
51163
|
var edition_contract_default = {
|
|
51114
|
-
schema: "xema.edition-contract/
|
|
51164
|
+
schema: "xema.edition-contract/v2",
|
|
51165
|
+
vendoring: "This file is the single source of the edition artifact coordinates and names. A consumer vendors it BYTE-IDENTICAL from a stated xema-cli commit and never edits it. It reads both repository namespace segments (repositories.<channel>.namespaceSegment) and the repository prefix (repositoryPrefix) only from this file, and refuses a contract that has no `repositories`.",
|
|
51115
51166
|
artifactType: "application/vnd.xema.edition.v1+json",
|
|
51116
51167
|
repositoryPrefix: "xema-edition-",
|
|
51168
|
+
repositories: {
|
|
51169
|
+
release: {
|
|
51170
|
+
namespaceSegment: "editions"
|
|
51171
|
+
},
|
|
51172
|
+
develop: {
|
|
51173
|
+
namespaceSegment: "develop-editions"
|
|
51174
|
+
}
|
|
51175
|
+
},
|
|
51117
51176
|
descriptorFile: "xema-edition.json",
|
|
51118
51177
|
descriptorSchema: "xema.edition/v1",
|
|
51119
|
-
locks: [
|
|
51120
|
-
|
|
51178
|
+
locks: [
|
|
51179
|
+
"distribution.lock.json",
|
|
51180
|
+
"images.lock.json",
|
|
51181
|
+
"authorization.lock.json",
|
|
51182
|
+
"chart-set.lock.json"
|
|
51183
|
+
],
|
|
51184
|
+
offeringLayers: {
|
|
51185
|
+
catalogue: "catalogue.json"
|
|
51186
|
+
},
|
|
51121
51187
|
provenancePins: {
|
|
51122
51188
|
catalogue: "the sha256 digest (sha256:<64 hex>) of the offering artifact a customer edition was resolved against; every other pin is a 40-hex commit"
|
|
51123
51189
|
},
|
|
@@ -51125,21 +51191,24 @@ var edition_contract_default = {
|
|
|
51125
51191
|
evidenceTrust: {
|
|
51126
51192
|
states: {
|
|
51127
51193
|
armed: "the data root declares an evidence trust policy that is pinned and ARMED on the channel of the edition",
|
|
51128
|
-
"not-armed": "a
|
|
51194
|
+
"not-armed": "a develop edition only: its data root declares no policy, or one that is not armed on the develop channel. A release edition never records not-armed"
|
|
51129
51195
|
},
|
|
51130
51196
|
refusal: {
|
|
51131
51197
|
code: "EVIDENCE_TRUST_REQUIRED_UNARMED",
|
|
51132
|
-
when: "
|
|
51198
|
+
when: "a release edition is written while the data root's evidence trust policy is not armed on the release channel (none declared, or declared but UNARMED or PARTIALLY ARMED there): no release descriptor or artifact is written, and no configuration key admits one. Arming is judged per channel: a develop edition admits not-armed"
|
|
51133
51199
|
}
|
|
51134
51200
|
}
|
|
51135
51201
|
};
|
|
51136
51202
|
|
|
51137
51203
|
// edition/edition-constants.mjs
|
|
51138
|
-
var EDITION_CONTRACT = Object.freeze(structuredClone(edition_contract_default));
|
|
51204
|
+
var EDITION_CONTRACT = Object.freeze(structuredClone(parseEditionContract(edition_contract_default)));
|
|
51139
51205
|
var EDITION_DESCRIPTOR_FILE = EDITION_CONTRACT.descriptorFile;
|
|
51140
51206
|
var EDITION_DESCRIPTOR_SCHEMA = EDITION_CONTRACT.descriptorSchema;
|
|
51141
51207
|
var EDITION_ARTIFACT_TYPE = EDITION_CONTRACT.artifactType;
|
|
51142
51208
|
var EDITION_REPOSITORY_PREFIX = EDITION_CONTRACT.repositoryPrefix;
|
|
51209
|
+
var EDITION_REPOSITORY_SEGMENTS = Object.freeze(
|
|
51210
|
+
Object.fromEntries(Object.values(EditionChannel).map((channel) => [channel, EDITION_CONTRACT.repositories[channel].namespaceSegment]))
|
|
51211
|
+
);
|
|
51143
51212
|
var EvidenceTrustState = Object.freeze({ Armed: "armed", NotArmed: "not-armed" });
|
|
51144
51213
|
var DEVELOP_IMAGE_NAMESPACE_SEGMENT = EDITION_CONTRACT.imageNamespaceSegment;
|
|
51145
51214
|
var EDITION_OFFERING_LAYERS = Object.freeze({ ...EDITION_CONTRACT.offeringLayers });
|
|
@@ -51706,6 +51775,22 @@ function requireSourceAuthUsername(config) {
|
|
|
51706
51775
|
}
|
|
51707
51776
|
return value;
|
|
51708
51777
|
}
|
|
51778
|
+
function optionalChartSet(document) {
|
|
51779
|
+
const registry = document.chartRegistry !== void 0;
|
|
51780
|
+
const publishers = document.chartPublishers !== void 0;
|
|
51781
|
+
if (registry !== publishers) {
|
|
51782
|
+
throw new EditionWorkspaceConfigError(
|
|
51783
|
+
`${EDITION_WORKSPACE_CONFIG_FILE}: "chartRegistry" and "chartPublishers" are a vendor-only pair, both declared or both absent; only "${registry ? "chartRegistry" : "chartPublishers"}" is`
|
|
51784
|
+
);
|
|
51785
|
+
}
|
|
51786
|
+
if (!registry) {
|
|
51787
|
+
return {};
|
|
51788
|
+
}
|
|
51789
|
+
return {
|
|
51790
|
+
chartRegistry: requireString(document, "chartRegistry", CHART_REGISTRY, "oci://<host>/<path>"),
|
|
51791
|
+
chartPublishers: requirePublishers(document)
|
|
51792
|
+
};
|
|
51793
|
+
}
|
|
51709
51794
|
function requirePublishers(config) {
|
|
51710
51795
|
const value = config.chartPublishers;
|
|
51711
51796
|
if (!Array.isArray(value) || value.length === 0) {
|
|
@@ -51726,35 +51811,35 @@ function requirePublishers(config) {
|
|
|
51726
51811
|
})
|
|
51727
51812
|
);
|
|
51728
51813
|
}
|
|
51729
|
-
var EVIDENCE_TRUST_POLICY_KEYS = Object.freeze(["pin", "policy"
|
|
51814
|
+
var EVIDENCE_TRUST_POLICY_KEYS = Object.freeze(["pin", "policy"]);
|
|
51730
51815
|
function isDataRootRelativePath(value) {
|
|
51731
51816
|
return typeof value === "string" && DATA_ROOT_RELATIVE_PATH.test(value) && value.split("/").every((segment) => segment !== "." && segment !== "..");
|
|
51732
51817
|
}
|
|
51733
51818
|
function requireEvidenceTrustPolicy(config) {
|
|
51734
51819
|
if (!Object.hasOwn(config, "evidenceTrustPolicy")) {
|
|
51735
51820
|
throw new EditionWorkspaceConfigError(
|
|
51736
|
-
`${EDITION_WORKSPACE_CONFIG_FILE}: "evidenceTrustPolicy" is required: {"
|
|
51821
|
+
`${EDITION_WORKSPACE_CONFIG_FILE}: "evidenceTrustPolicy" is required: {"policy": ..., "pin": ...}, or null to state that this data root declares no policy (no release edition can then be sealed from it)`
|
|
51737
51822
|
);
|
|
51738
51823
|
}
|
|
51739
51824
|
const value = config.evidenceTrustPolicy;
|
|
51740
|
-
|
|
51741
|
-
|
|
51825
|
+
if (value === null) {
|
|
51826
|
+
return Object.freeze({ policy: null, pin: null });
|
|
51827
|
+
}
|
|
51828
|
+
const shapeError = (detail) => new EditionWorkspaceConfigError(
|
|
51829
|
+
`${EDITION_WORKSPACE_CONFIG_FILE}: "evidenceTrustPolicy" is exactly null or {policy, pin} with both paths data-root-relative${detail}`
|
|
51742
51830
|
);
|
|
51743
|
-
if (
|
|
51744
|
-
throw shapeError();
|
|
51831
|
+
if (typeof value !== "object" || Array.isArray(value)) {
|
|
51832
|
+
throw shapeError("");
|
|
51745
51833
|
}
|
|
51746
51834
|
const keys = Object.keys(value).sort();
|
|
51747
|
-
|
|
51748
|
-
|
|
51749
|
-
|
|
51750
|
-
const declared = keys.length > 1;
|
|
51751
|
-
if (declared && keys.join() !== EVIDENCE_TRUST_POLICY_KEYS.join()) {
|
|
51752
|
-
throw shapeError();
|
|
51835
|
+
const unknown = keys.filter((key) => !EVIDENCE_TRUST_POLICY_KEYS.includes(key));
|
|
51836
|
+
if (unknown.length > 0) {
|
|
51837
|
+
throw shapeError(`; unknown key ${unknown.map((key) => `"${key}"`).join(", ")}`);
|
|
51753
51838
|
}
|
|
51754
|
-
if (
|
|
51755
|
-
|
|
51839
|
+
if (keys.join() !== EVIDENCE_TRUST_POLICY_KEYS.join()) {
|
|
51840
|
+
throw shapeError("");
|
|
51756
51841
|
}
|
|
51757
|
-
for (const key of
|
|
51842
|
+
for (const key of EVIDENCE_TRUST_POLICY_KEYS) {
|
|
51758
51843
|
if (!isDataRootRelativePath(value[key])) {
|
|
51759
51844
|
throw new EditionWorkspaceConfigError(
|
|
51760
51845
|
`${EDITION_WORKSPACE_CONFIG_FILE}: "evidenceTrustPolicy.${key}" must be a data-root-relative POSIX path without "." or ".." segments; got ${JSON.stringify(value[key])}`
|
|
@@ -51764,7 +51849,7 @@ function requireEvidenceTrustPolicy(config) {
|
|
|
51764
51849
|
if (value.policy === value.pin) {
|
|
51765
51850
|
throw new EditionWorkspaceConfigError(`${EDITION_WORKSPACE_CONFIG_FILE}: "evidenceTrustPolicy.policy" and ".pin" must be different files`);
|
|
51766
51851
|
}
|
|
51767
|
-
return Object.freeze({
|
|
51852
|
+
return Object.freeze({ policy: value.policy, pin: value.pin });
|
|
51768
51853
|
}
|
|
51769
51854
|
function parseEditionWorkspaceConfig(document) {
|
|
51770
51855
|
if (document === null || typeof document !== "object" || Array.isArray(document)) {
|
|
@@ -51784,8 +51869,7 @@ function parseEditionWorkspaceConfig(document) {
|
|
|
51784
51869
|
return Object.freeze({
|
|
51785
51870
|
...sections,
|
|
51786
51871
|
imageRegistry: requireString(document, "imageRegistry", IMAGE_REGISTRY, "<host>/<namespace> with no scheme or trailing slash"),
|
|
51787
|
-
|
|
51788
|
-
chartPublishers: requirePublishers(document),
|
|
51872
|
+
...optionalChartSet(document),
|
|
51789
51873
|
sourceRepositoryUrlPrefix: requireString(document, "sourceRepositoryUrlPrefix", SOURCE_URL_PREFIX, "https://<host>/<organisation>/ with a trailing slash"),
|
|
51790
51874
|
sourceAuthUsername: requireSourceAuthUsername(document),
|
|
51791
51875
|
evidenceTrustPolicy: requireEvidenceTrustPolicy(document)
|
|
@@ -52015,6 +52099,11 @@ function parseEditionDescriptor(value) {
|
|
|
52015
52099
|
if (!Object.values(EvidenceTrustState).includes(value.evidenceTrustPolicy)) {
|
|
52016
52100
|
throw new Error(`${EDITION_DESCRIPTOR_FILE}: evidenceTrustPolicy must be one of ${Object.values(EvidenceTrustState).join(" | ")}`);
|
|
52017
52101
|
}
|
|
52102
|
+
if (value.provenance.channel === EditionChannel.Release && value.evidenceTrustPolicy !== EvidenceTrustState.Armed) {
|
|
52103
|
+
throw new Error(
|
|
52104
|
+
`${EDITION_DESCRIPTOR_FILE}: a release edition requires an armed evidence trust policy; "${value.distributionId}" records ${JSON.stringify(value.evidenceTrustPolicy)}`
|
|
52105
|
+
);
|
|
52106
|
+
}
|
|
52018
52107
|
exactKeys(value.engine, ["image"], `${EDITION_DESCRIPTOR_FILE} engine`);
|
|
52019
52108
|
assertEngineImage(value.engine.image);
|
|
52020
52109
|
return value;
|
|
@@ -52453,6 +52542,21 @@ function gradeTrustedCheckouts({ grades, trustedGit, expected }) {
|
|
|
52453
52542
|
group.requirements.push({ root: canonicalRoot, label, requiredPaths });
|
|
52454
52543
|
byRepository.set(location.repositoryRoot, group);
|
|
52455
52544
|
}
|
|
52545
|
+
if (expected !== void 0) {
|
|
52546
|
+
const regraded = new Set(
|
|
52547
|
+
[...byRepository.values()].flatMap((group) => group.requirements.map(({ root: root2 }) => root2))
|
|
52548
|
+
);
|
|
52549
|
+
for (const root2 of regraded) {
|
|
52550
|
+
if (typeof expected.get(root2)?.commit !== "string") {
|
|
52551
|
+
throw new Error(`${root2} was not graded first, so its HEAD cannot be held unchanged`);
|
|
52552
|
+
}
|
|
52553
|
+
}
|
|
52554
|
+
for (const root2 of expected.keys()) {
|
|
52555
|
+
if (!regraded.has(root2)) {
|
|
52556
|
+
throw new Error(`${root2} was graded first and is missing from the re-grade`);
|
|
52557
|
+
}
|
|
52558
|
+
}
|
|
52559
|
+
}
|
|
52456
52560
|
const result = /* @__PURE__ */ new Map();
|
|
52457
52561
|
for (const [repositoryRoot, group] of byRepository) {
|
|
52458
52562
|
assertTrustedCheckoutLocation(group.location, group.labels.join(" + "));
|
|
@@ -52460,9 +52564,12 @@ function gradeTrustedCheckouts({ grades, trustedGit, expected }) {
|
|
|
52460
52564
|
repositoryRoot,
|
|
52461
52565
|
requirements: group.requirements,
|
|
52462
52566
|
trustedGit,
|
|
52463
|
-
expectedCommit: expected?.get(group.requirements[0].root)
|
|
52567
|
+
expectedCommit: expected?.get(group.requirements[0].root).commit
|
|
52464
52568
|
});
|
|
52465
52569
|
for (const { root: root2 } of group.requirements) {
|
|
52570
|
+
if (expected !== void 0 && expected.get(root2).commit !== graded.commit) {
|
|
52571
|
+
throw new Error(`${repositoryRoot} HEAD changed during verification`);
|
|
52572
|
+
}
|
|
52466
52573
|
result.set(root2, graded);
|
|
52467
52574
|
}
|
|
52468
52575
|
}
|
|
@@ -53553,6 +53660,59 @@ function assertPinnedVerifier({ pin, actual }) {
|
|
|
53553
53660
|
}
|
|
53554
53661
|
}
|
|
53555
53662
|
|
|
53663
|
+
// edition/image-delivery-entitlement-descriptor.mjs
|
|
53664
|
+
import { dirname as dirname4, join as join6 } from "node:path";
|
|
53665
|
+
var ENTITLEMENT_DESCRIPTOR_FILE = "entitlement.json";
|
|
53666
|
+
var ENTITLEMENT_DESCRIPTOR_SCHEMA_VERSION = 2;
|
|
53667
|
+
var ENTITLEMENT_DESCRIPTOR_KEYS = Object.freeze([
|
|
53668
|
+
"schemaVersion",
|
|
53669
|
+
"distributionId",
|
|
53670
|
+
"customerId",
|
|
53671
|
+
"mode",
|
|
53672
|
+
"targetRegistry",
|
|
53673
|
+
"idempotencyKey",
|
|
53674
|
+
"distributionStatementDigest",
|
|
53675
|
+
"evidence"
|
|
53676
|
+
]);
|
|
53677
|
+
function parseEntitlementDescriptorDocument(raw, schemas2) {
|
|
53678
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
53679
|
+
throw new Error(`${ENTITLEMENT_DESCRIPTOR_FILE} must be a JSON object`);
|
|
53680
|
+
}
|
|
53681
|
+
if (raw.schemaVersion !== ENTITLEMENT_DESCRIPTOR_SCHEMA_VERSION) {
|
|
53682
|
+
throw new Error(
|
|
53683
|
+
`${ENTITLEMENT_DESCRIPTOR_FILE} has schemaVersion ${JSON.stringify(raw.schemaVersion)}; this verifier reads schemaVersion ${ENTITLEMENT_DESCRIPTOR_SCHEMA_VERSION} only (accept the entitlement again with this CLI)`
|
|
53684
|
+
);
|
|
53685
|
+
}
|
|
53686
|
+
const keys = Object.keys(raw).sort();
|
|
53687
|
+
const expected = [...ENTITLEMENT_DESCRIPTOR_KEYS].sort();
|
|
53688
|
+
if (keys.length !== expected.length || keys.some((key, index) => key !== expected[index])) {
|
|
53689
|
+
throw new Error(
|
|
53690
|
+
`${ENTITLEMENT_DESCRIPTOR_FILE} must hold exactly the keys ${ENTITLEMENT_DESCRIPTOR_KEYS.join(", ")}; it holds ${keys.join(", ")}`
|
|
53691
|
+
);
|
|
53692
|
+
}
|
|
53693
|
+
for (const key of ["distributionId", "customerId", "mode", "idempotencyKey", "distributionStatementDigest"]) {
|
|
53694
|
+
if (typeof raw[key] !== "string" || raw[key] === "") {
|
|
53695
|
+
throw new Error(`${ENTITLEMENT_DESCRIPTOR_FILE} "${key}" must be a non-empty string`);
|
|
53696
|
+
}
|
|
53697
|
+
}
|
|
53698
|
+
if (raw.targetRegistry !== null && (typeof raw.targetRegistry !== "string" || raw.targetRegistry === "")) {
|
|
53699
|
+
throw new Error(`${ENTITLEMENT_DESCRIPTOR_FILE} "targetRegistry" must be null or a non-empty string`);
|
|
53700
|
+
}
|
|
53701
|
+
return { ...raw, evidence: schemas2.SigstoreEvidenceDescriptorSchema.parse(raw.evidence) };
|
|
53702
|
+
}
|
|
53703
|
+
function assertEntitlementDescriptorStates(document, expected) {
|
|
53704
|
+
for (const key of ["distributionId", "customerId", "mode", "targetRegistry", "distributionStatementDigest"]) {
|
|
53705
|
+
if (document[key] !== expected[key]) {
|
|
53706
|
+
throw new Error(
|
|
53707
|
+
`${ENTITLEMENT_DESCRIPTOR_FILE} states ${key} ${JSON.stringify(document[key])}, not the ${JSON.stringify(expected[key])} this verification was asked for`
|
|
53708
|
+
);
|
|
53709
|
+
}
|
|
53710
|
+
}
|
|
53711
|
+
}
|
|
53712
|
+
function entitlementEvidenceRoot(evidenceRoot, entitlementDescriptorPath) {
|
|
53713
|
+
return dirname4(join6(evidenceRoot, entitlementDescriptorPath));
|
|
53714
|
+
}
|
|
53715
|
+
|
|
53556
53716
|
// edition/image-evidence-replay-state.mjs
|
|
53557
53717
|
import { randomUUID } from "node:crypto";
|
|
53558
53718
|
import {
|
|
@@ -53567,7 +53727,7 @@ import {
|
|
|
53567
53727
|
unlinkSync,
|
|
53568
53728
|
writeFileSync as writeFileSync3
|
|
53569
53729
|
} from "node:fs";
|
|
53570
|
-
import { basename as basename3, dirname as
|
|
53730
|
+
import { basename as basename3, dirname as dirname5, isAbsolute as isAbsolute5, join as join7 } from "node:path";
|
|
53571
53731
|
var MAX_REPLAY_STATE_BYTES = 64 * 1024;
|
|
53572
53732
|
function openRegularFileNoFollow(path) {
|
|
53573
53733
|
const descriptor = openSync3(
|
|
@@ -53614,8 +53774,8 @@ function assertTrustedStateDirectory(path) {
|
|
|
53614
53774
|
}
|
|
53615
53775
|
}
|
|
53616
53776
|
function writeDurableReplacement(path, value) {
|
|
53617
|
-
const directory = realpathSync5(
|
|
53618
|
-
const temporaryPath =
|
|
53777
|
+
const directory = realpathSync5(dirname5(path));
|
|
53778
|
+
const temporaryPath = join7(
|
|
53619
53779
|
directory,
|
|
53620
53780
|
`.${basename3(path)}.${randomUUID()}.tmp`
|
|
53621
53781
|
);
|
|
@@ -53663,12 +53823,12 @@ async function verifyAndAdvanceReplayState({
|
|
|
53663
53823
|
if (!isAbsolute5(statePath)) {
|
|
53664
53824
|
throw new Error("replay state path must be absolute");
|
|
53665
53825
|
}
|
|
53666
|
-
const stateDirectory = realpathSync5(
|
|
53667
|
-
if (stateDirectory !==
|
|
53826
|
+
const stateDirectory = realpathSync5(dirname5(statePath));
|
|
53827
|
+
if (stateDirectory !== dirname5(statePath)) {
|
|
53668
53828
|
throw new Error("replay state parent path must be canonical");
|
|
53669
53829
|
}
|
|
53670
53830
|
assertTrustedStateDirectory(stateDirectory);
|
|
53671
|
-
const canonicalStatePath =
|
|
53831
|
+
const canonicalStatePath = join7(stateDirectory, basename3(statePath));
|
|
53672
53832
|
const lockPath = `${canonicalStatePath}.lock`;
|
|
53673
53833
|
let lockDescriptor;
|
|
53674
53834
|
try {
|
|
@@ -53772,7 +53932,7 @@ async function verifyAndAdvanceReplayState({
|
|
|
53772
53932
|
|
|
53773
53933
|
// edition/verifier-binding.mjs
|
|
53774
53934
|
import { readFileSync as readFileSync5, realpathSync as realpathSync6 } from "node:fs";
|
|
53775
|
-
import { dirname as
|
|
53935
|
+
import { dirname as dirname6, join as join8 } from "node:path";
|
|
53776
53936
|
|
|
53777
53937
|
// edition/verifier-files.mjs
|
|
53778
53938
|
var VERIFIER_PROVENANCE_FILE = "verify-image-evidence.bundle.provenance.json";
|
|
@@ -53823,7 +53983,7 @@ function readRunningVerifier(bundlePath) {
|
|
|
53823
53983
|
assertProtectedPathAncestry(realBundle, "the evidence verifier install");
|
|
53824
53984
|
const bundleBytes = readFileSync5(realBundle);
|
|
53825
53985
|
const provenanceBytes = readFileSync5(
|
|
53826
|
-
|
|
53986
|
+
join8(dirname6(realBundle), VERIFIER_PROVENANCE_FILE)
|
|
53827
53987
|
);
|
|
53828
53988
|
parseVerifierProvenance({ provenanceBytes, bundleBytes });
|
|
53829
53989
|
return { bundleBytes, provenanceBytes };
|
|
@@ -53841,11 +54001,12 @@ async function loadVerifierKernelSchemas() {
|
|
|
53841
54001
|
}
|
|
53842
54002
|
|
|
53843
54003
|
// edition/verify-image-evidence.mjs
|
|
53844
|
-
var USAGE = "usage: verify-image-evidence <distributionId> --evidence-root <dir> --descriptor <absolute-path> --state <absolute-path> --cosign <absolute-path> --git <absolute-path> [--evidence-set <relative-path>] [--json] [--entitlement <relative-path> --customer <id> --mode <mode> [--target-registry <registry>]] --data-root <dir> --editions-root <dir> --kernel <dir>";
|
|
54004
|
+
var USAGE = "usage: verify-image-evidence <distributionId> --evidence-root <dir> --descriptor <absolute-path> --state <absolute-path> --cosign <absolute-path> --git <absolute-path> [--evidence-set <relative-path>] [--json] [--entitlement <relative-path> --entitlement-workflow-sha <40-hex git sha> --customer <id> --mode <mode> [--target-registry <registry>]] --data-root <dir> --editions-root <dir> --kernel <dir>";
|
|
53845
54005
|
var EVIDENCE_CHANNEL_OF_EDITION_CHANNEL = Object.freeze({
|
|
53846
54006
|
[EditionChannel.Release]: "release",
|
|
53847
54007
|
[EditionChannel.Develop]: "develop"
|
|
53848
54008
|
});
|
|
54009
|
+
var GIT_COMMIT_SHA = /^[a-f0-9]{40}$/;
|
|
53849
54010
|
var DATA_ROOT_FILES = Object.freeze(["edition-workspace.json", "runtime-image-source-index.json"]);
|
|
53850
54011
|
function requireOptionValue(args, index, flag) {
|
|
53851
54012
|
const value = args[index + 1];
|
|
@@ -53876,6 +54037,7 @@ function parseArgs(args) {
|
|
|
53876
54037
|
cosignBinary: null,
|
|
53877
54038
|
gitBinary: null,
|
|
53878
54039
|
entitlementDescriptorPath: null,
|
|
54040
|
+
entitlementWorkflowSha: null,
|
|
53879
54041
|
customerId: null,
|
|
53880
54042
|
mode: null,
|
|
53881
54043
|
targetRegistry: null
|
|
@@ -53902,6 +54064,8 @@ function parseArgs(args) {
|
|
|
53902
54064
|
options.gitBinary = value;
|
|
53903
54065
|
} else if (flag === "--entitlement") {
|
|
53904
54066
|
options.entitlementDescriptorPath = value;
|
|
54067
|
+
} else if (flag === "--entitlement-workflow-sha") {
|
|
54068
|
+
options.entitlementWorkflowSha = value;
|
|
53905
54069
|
} else if (flag === "--customer") {
|
|
53906
54070
|
options.customerId = value;
|
|
53907
54071
|
} else if (flag === "--mode") {
|
|
@@ -53927,6 +54091,7 @@ function parseArgs(args) {
|
|
|
53927
54091
|
}
|
|
53928
54092
|
const entitlementFlags = [
|
|
53929
54093
|
["--entitlement", options.entitlementDescriptorPath],
|
|
54094
|
+
["--entitlement-workflow-sha", options.entitlementWorkflowSha],
|
|
53930
54095
|
["--customer", options.customerId],
|
|
53931
54096
|
["--mode", options.mode]
|
|
53932
54097
|
];
|
|
@@ -53937,7 +54102,10 @@ function parseArgs(args) {
|
|
|
53937
54102
|
);
|
|
53938
54103
|
}
|
|
53939
54104
|
if (stated.length === 0 && options.targetRegistry !== null) {
|
|
53940
|
-
throw new Error("--target-registry needs --entitlement, --customer and --mode");
|
|
54105
|
+
throw new Error("--target-registry needs --entitlement, --entitlement-workflow-sha, --customer and --mode");
|
|
54106
|
+
}
|
|
54107
|
+
if (options.entitlementWorkflowSha !== null && !GIT_COMMIT_SHA.test(options.entitlementWorkflowSha)) {
|
|
54108
|
+
throw new Error("--entitlement-workflow-sha must be a 40-character lowercase hexadecimal git commit SHA");
|
|
53941
54109
|
}
|
|
53942
54110
|
if (options.entitlementDescriptorPath !== null && isAbsolute6(options.entitlementDescriptorPath)) {
|
|
53943
54111
|
throw new Error("--entitlement must be an evidence-root-relative path");
|
|
@@ -54105,13 +54273,26 @@ async function verifyEvidence({ argv, env, bundlePath }) {
|
|
|
54105
54273
|
cosignBinary: options.cosignBinary,
|
|
54106
54274
|
schemas: schemas2
|
|
54107
54275
|
});
|
|
54108
|
-
const
|
|
54109
|
-
|
|
54110
|
-
|
|
54111
|
-
|
|
54276
|
+
const entitlement = options.entitlementDescriptorPath === null ? null : parseEntitlementDescriptorDocument(
|
|
54277
|
+
readCanonicalJsonFromRoot(
|
|
54278
|
+
evidenceRoot,
|
|
54279
|
+
options.entitlementDescriptorPath,
|
|
54280
|
+
"delivery entitlement descriptor"
|
|
54281
|
+
),
|
|
54282
|
+
schemas2
|
|
54112
54283
|
);
|
|
54284
|
+
if (entitlement !== null) {
|
|
54285
|
+
assertEntitlementDescriptorStates(entitlement, {
|
|
54286
|
+
distributionId: options.distributionId,
|
|
54287
|
+
customerId: options.customerId,
|
|
54288
|
+
mode: options.mode,
|
|
54289
|
+
targetRegistry: options.targetRegistry,
|
|
54290
|
+
distributionStatementDigest: result.completenessStatementDigest
|
|
54291
|
+
});
|
|
54292
|
+
}
|
|
54293
|
+
const entitlementDescriptor = entitlement === null ? null : entitlement.evidence;
|
|
54113
54294
|
const entitlementStatement = entitlementDescriptor === null ? null : await verifyImageDeliveryEntitlement({
|
|
54114
|
-
evidenceRoot,
|
|
54295
|
+
evidenceRoot: entitlementEvidenceRoot(evidenceRoot, options.entitlementDescriptorPath),
|
|
54115
54296
|
descriptor: entitlementDescriptor,
|
|
54116
54297
|
policy: anchors.policy,
|
|
54117
54298
|
policyRoot: dataRoot(),
|
|
@@ -54122,9 +54303,9 @@ async function verifyEvidence({ argv, env, bundlePath }) {
|
|
|
54122
54303
|
mode: options.mode,
|
|
54123
54304
|
targetRegistry: options.targetRegistry,
|
|
54124
54305
|
now: /* @__PURE__ */ new Date(),
|
|
54125
|
-
// The entitlement predicate carries no producer run
|
|
54126
|
-
//
|
|
54127
|
-
expectedWorkflowSha:
|
|
54306
|
+
// The entitlement predicate carries no producer run: the commit
|
|
54307
|
+
// its certificate is held to is the caller's statement.
|
|
54308
|
+
expectedWorkflowSha: options.entitlementWorkflowSha,
|
|
54128
54309
|
// A nonce spent by a producer or completeness statement of
|
|
54129
54310
|
// this release cannot be reused by its entitlement.
|
|
54130
54311
|
consumedNonces: result.verifiedNonces,
|