@kici-dev/engine 0.1.24 → 0.1.25
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/approval/types.d.ts +1 -1
- package/dist/approval/types.js +1 -1
- package/dist/audit/access-log-policy.js +3 -2
- package/dist/audit/activity.d.ts +2 -0
- package/dist/audit/activity.js +15 -1
- package/dist/audit/retention-policy.js +3 -3
- package/dist/bundler/index.js +1 -1
- package/dist/bundler/rolldown-config.js +1 -1
- package/dist/check-mode.js +1 -1
- package/dist/dev-ops/operations.d.ts +56 -0
- package/dist/dev-ops/operations.js +135 -0
- package/dist/env/environment-allowlist.js +1 -1
- package/dist/environment/host-match.js +1 -1
- package/dist/environment/index.js +1 -1
- package/dist/environment/multi-env.js +1 -1
- package/dist/environment/scope-resolver.js +1 -1
- package/dist/environment/scope-template.js +1 -1
- package/dist/environment/types.js +1 -1
- package/dist/fanout/materialize.js +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.js +16 -10
- package/dist/inputs/build.js +1 -1
- package/dist/inputs/coerce.js +1 -1
- package/dist/inputs/descriptor.js +1 -1
- package/dist/inputs/extract.js +1 -1
- package/dist/inputs/index.js +1 -1
- package/dist/inputs/schedule.js +1 -1
- package/dist/inventory.js +1 -1
- package/dist/labels/compile.js +1 -1
- package/dist/labels-match.js +1 -1
- package/dist/labels.js +2 -2
- package/dist/matrix/expand.js +1 -1
- package/dist/matrix/format.js +1 -1
- package/dist/mcp/fence.d.ts +22 -0
- package/dist/mcp/fence.js +65 -0
- package/dist/mcp/held-run-resolve.d.ts +52 -0
- package/dist/mcp/held-run-resolve.js +53 -0
- package/dist/mcp/tool-schemas.d.ts +38 -5
- package/dist/mcp/tool-schemas.js +38 -9
- package/dist/metrics/catalog-policy.js +1 -1
- package/dist/metrics/metric-catalog.generated.d.ts +85 -0
- package/dist/metrics/metric-catalog.generated.js +103 -1
- package/dist/protocol/analytics-events.js +1 -1
- package/dist/protocol/cluster-name.js +1 -1
- package/dist/protocol/dashboard-global-workflows.js +1 -1
- package/dist/protocol/dashboard-write-operations.d.ts +5 -1
- package/dist/protocol/dashboard-write-operations.js +13 -2
- package/dist/protocol/event-log-payload.js +1 -1
- package/dist/protocol/messages/access-log.d.ts +14 -5
- package/dist/protocol/messages/access-log.js +13 -1
- package/dist/protocol/messages/actor.d.ts +13 -0
- package/dist/protocol/messages/actor.js +25 -5
- package/dist/protocol/messages/agent-dev-ops.d.ts +118 -0
- package/dist/protocol/messages/agent-dev-ops.js +89 -0
- package/dist/protocol/messages/agent-run-result.d.ts +77 -2
- package/dist/protocol/messages/agent-run-result.js +44 -2
- package/dist/protocol/messages/auth.d.ts +1 -0
- package/dist/protocol/messages/auth.js +1 -1
- package/dist/protocol/messages/browser.js +1 -1
- package/dist/protocol/messages/capabilities.d.ts +1 -0
- package/dist/protocol/messages/capabilities.js +1 -1
- package/dist/protocol/messages/common.js +1 -1
- package/dist/protocol/messages/dashboard-global-workflows.d.ts +6 -0
- package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
- package/dist/protocol/messages/dashboard.d.ts +634 -18
- package/dist/protocol/messages/dashboard.js +111 -12
- package/dist/protocol/messages/deployment-identity.js +1 -1
- package/dist/protocol/messages/event-log.js +1 -1
- package/dist/protocol/messages/execution-status.d.ts +15 -3
- package/dist/protocol/messages/execution-status.js +19 -4
- package/dist/protocol/messages/join.js +1 -1
- package/dist/protocol/messages/log-pull.js +1 -1
- package/dist/protocol/messages/oidc-mint.d.ts +51 -0
- package/dist/protocol/messages/oidc-mint.js +55 -0
- package/dist/protocol/messages/oidc-token-relay.d.ts +31 -4
- package/dist/protocol/messages/oidc-token-relay.js +22 -7
- package/dist/protocol/messages/orchestrator-agent.d.ts +45 -0
- package/dist/protocol/messages/orchestrator-agent.js +30 -2
- package/dist/protocol/messages/pat-kind.js +1 -1
- package/dist/protocol/messages/peer.js +1 -1
- package/dist/protocol/messages/platform-orchestrator.d.ts +292 -10
- package/dist/protocol/messages/platform-orchestrator.js +5 -2
- package/dist/protocol/messages/run-events.d.ts +3 -0
- package/dist/protocol/messages/run-events.js +1 -1
- package/dist/protocol/messages/scaler-event.js +1 -1
- package/dist/protocol/messages/source-registration.js +1 -1
- package/dist/protocol/source-origin.d.ts +20 -0
- package/dist/protocol/source-origin.js +21 -0
- package/dist/protocol/version.js +1 -1
- package/dist/provenance/attestation-origin.d.ts +18 -0
- package/dist/provenance/attestation-origin.js +22 -0
- package/dist/provenance/bundle.js +1 -1
- package/dist/provenance/dsse.js +1 -1
- package/dist/provenance/schema.d.ts +48 -0
- package/dist/provenance/schema.js +21 -7
- package/dist/provenance/statement-hash.d.ts +9 -0
- package/dist/provenance/statement-hash.js +17 -0
- package/dist/provenance/verify.d.ts +7 -0
- package/dist/provenance/verify.js +49 -10
- package/dist/provider/changed-files-fetcher.js +1 -1
- package/dist/provider/check-run-conclusion.js +1 -1
- package/dist/provider/check-status-poster.js +1 -1
- package/dist/provider/clone-token-provider.js +1 -1
- package/dist/provider/contributor-resolver.js +1 -1
- package/dist/provider/index.js +1 -1
- package/dist/provider/lock-file-fetcher.js +1 -1
- package/dist/provider/lock-file-parse-error.js +1 -1
- package/dist/provider/repo-url-builder.js +1 -1
- package/dist/provider/types.js +1 -1
- package/dist/provider/webhook-normalizer.js +1 -1
- package/dist/registration/registerable-trigger-type.d.ts +1 -1
- package/dist/registration/registerable-trigger-type.js +1 -1
- package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
- package/dist/scaler/resource-types.js +1 -1
- package/dist/scaler/scaler-backend-type.js +1 -1
- package/dist/secrets/index.d.ts +1 -1
- package/dist/secrets/index.js +1 -1
- package/dist/secrets/types.d.ts +0 -24
- package/dist/secrets/types.js +1 -1
- package/dist/state-machine/index.js +1 -1
- package/dist/state-machine/machine.js +1 -1
- package/dist/state-machine/types.js +1 -1
- package/dist/trigger/decision-trace.js +1 -1
- package/dist/trigger/jsonpath-matcher.js +1 -1
- package/dist/trigger/matcher.js +1 -1
- package/dist/trigger/trigger-event-type.js +1 -1
- package/dist/trigger/types.js +1 -1
- package/dist/webhook/signature.js +1 -1
- package/dist/webhook/webhook-url-format.d.ts +7 -0
- package/dist/webhook/webhook-url-format.js +11 -2
- package/dist/ws/close-codes.d.ts +8 -2
- package/dist/ws/close-codes.js +10 -4
- package/dist/ws/rate-limiter.js +1 -1
- package/dist/ws/ws-like.js +1 -1
- package/package.json +9 -1
- package/sbom.spdx.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { heartbeatSchema } from "./common.js";
|
|
3
3
|
import { executionStatusSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./execution-status.js";
|
|
4
4
|
import { jobContextMessageSchema, runEventMessageSchema } from "./run-events.js";
|
|
@@ -6,6 +6,7 @@ import { sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAc
|
|
|
6
6
|
import { dashboardPlatformToOrchSchema } from "./dashboard.js";
|
|
7
7
|
import { orchCapabilitiesSchema } from "./capabilities.js";
|
|
8
8
|
import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./auth.js";
|
|
9
|
+
import { oidcMintRequestSchema, oidcMintResponseSchema } from "./oidc-mint.js";
|
|
9
10
|
import { z } from "zod";
|
|
10
11
|
//#region src/protocol/messages/platform-orchestrator.ts
|
|
11
12
|
/** Trust policy update pushed from Platform to orchestrator when policy or identity links change. */
|
|
@@ -338,6 +339,7 @@ const platformToOrchestratorMessageSchema = z.discriminatedUnion("type", [
|
|
|
338
339
|
peerDiscoverSchema,
|
|
339
340
|
peerUpdateSchema,
|
|
340
341
|
staleCheckrunCleanupSchema,
|
|
342
|
+
oidcMintResponseSchema,
|
|
341
343
|
...dashboardPlatformToOrchSchema.options
|
|
342
344
|
]);
|
|
343
345
|
/** All messages that flow from Orchestrator to Platform.
|
|
@@ -363,7 +365,8 @@ const orchestratorToPlatformMessageSchema = z.discriminatedUnion("type", [
|
|
|
363
365
|
heartbeatSchema,
|
|
364
366
|
runEventMessageSchema,
|
|
365
367
|
jobContextMessageSchema,
|
|
366
|
-
orchMetricsSchema
|
|
368
|
+
orchMetricsSchema,
|
|
369
|
+
oidcMintRequestSchema
|
|
367
370
|
]);
|
|
368
371
|
//#endregion
|
|
369
372
|
export { WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WebhookRelayResult, cacheStatsSchema, executionEventSchema, logChunkSchema, orchCapabilitiesUpdateSchema, orchMetricsSchema, orchestratorToPlatformMessageSchema, peerDiscoverSchema, peerUpdateSchema, platformToOrchestratorMessageSchema, staleCheckrunCleanupSchema, trustPolicyUpdateSchema, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
|
@@ -133,6 +133,9 @@ export declare const dashboardOrchLogsRequestSchema: z.ZodObject<{
|
|
|
133
133
|
type: z.ZodLiteral<"api_key">;
|
|
134
134
|
keyId: z.ZodString;
|
|
135
135
|
ownerSub: z.ZodString;
|
|
136
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
label: z.ZodString;
|
|
138
|
+
}, z.core.$strip>>;
|
|
136
139
|
}, z.core.$strip>, z.ZodObject<{
|
|
137
140
|
type: z.ZodLiteral<"service_account">;
|
|
138
141
|
id: z.ZodString;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* How a run was initiated, as branded into provenance attestations.
|
|
4
|
+
*
|
|
5
|
+
* `triggered` — a webhook event that resolved to a cloned commit; the
|
|
6
|
+
* repository/ref/sha coordinates come from a real VCS event.
|
|
7
|
+
* `run-remote` — a developer's local working-tree overlay (`kici run remote`):
|
|
8
|
+
* the source coordinates are caller-supplied, not a triggered VCS event.
|
|
9
|
+
*
|
|
10
|
+
* The brand is org-asserted (derived from the orchestrator-reported
|
|
11
|
+
* `local_working_tree` flag on the run). The one un-forgeable trust anchor is
|
|
12
|
+
* the origin org id; the brand and the repo/ref/sha are scoped to that org's
|
|
13
|
+
* infrastructure.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SourceOrigin: z.ZodEnum<{
|
|
16
|
+
triggered: "triggered";
|
|
17
|
+
"run-remote": "run-remote";
|
|
18
|
+
}>;
|
|
19
|
+
export type SourceOrigin = z.infer<typeof SourceOrigin>;
|
|
20
|
+
//# sourceMappingURL=source-origin.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/protocol/source-origin.ts
|
|
4
|
+
/**
|
|
5
|
+
* How a run was initiated, as branded into provenance attestations.
|
|
6
|
+
*
|
|
7
|
+
* `triggered` — a webhook event that resolved to a cloned commit; the
|
|
8
|
+
* repository/ref/sha coordinates come from a real VCS event.
|
|
9
|
+
* `run-remote` — a developer's local working-tree overlay (`kici run remote`):
|
|
10
|
+
* the source coordinates are caller-supplied, not a triggered VCS event.
|
|
11
|
+
*
|
|
12
|
+
* The brand is org-asserted (derived from the orchestrator-reported
|
|
13
|
+
* `local_working_tree` flag on the run). The one un-forgeable trust anchor is
|
|
14
|
+
* the origin org id; the brand and the repo/ref/sha are scoped to that org's
|
|
15
|
+
* infrastructure.
|
|
16
|
+
*/
|
|
17
|
+
const SourceOrigin = z.enum(["triggered", "run-remote"]);
|
|
18
|
+
//#endregion
|
|
19
|
+
export { SourceOrigin };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=source-origin.js.map
|
package/dist/protocol/version.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* When the Platform identity token bound into a provenance bundle was minted,
|
|
4
|
+
* relative to the build. Orthogonal to the run's `SourceOrigin` brand.
|
|
5
|
+
* `live` — minted synchronously during the build (no deferral).
|
|
6
|
+
* `deferred` — the build's mint failed transiently; the token was minted later
|
|
7
|
+
* against run/job rows the Platform already had (transient-blip recovery).
|
|
8
|
+
* `offline-backfill` — the run was ingested while the Platform was fully down;
|
|
9
|
+
* the run/job rows were backfilled before the deferred mint. The temporal gap
|
|
10
|
+
* is disclosed, never hidden.
|
|
11
|
+
*/
|
|
12
|
+
export declare const AttestationOrigin: z.ZodEnum<{
|
|
13
|
+
live: "live";
|
|
14
|
+
deferred: "deferred";
|
|
15
|
+
"offline-backfill": "offline-backfill";
|
|
16
|
+
}>;
|
|
17
|
+
export type AttestationOrigin = z.infer<typeof AttestationOrigin>;
|
|
18
|
+
//# sourceMappingURL=attestation-origin.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/provenance/attestation-origin.ts
|
|
4
|
+
/**
|
|
5
|
+
* When the Platform identity token bound into a provenance bundle was minted,
|
|
6
|
+
* relative to the build. Orthogonal to the run's `SourceOrigin` brand.
|
|
7
|
+
* `live` — minted synchronously during the build (no deferral).
|
|
8
|
+
* `deferred` — the build's mint failed transiently; the token was minted later
|
|
9
|
+
* against run/job rows the Platform already had (transient-blip recovery).
|
|
10
|
+
* `offline-backfill` — the run was ingested while the Platform was fully down;
|
|
11
|
+
* the run/job rows were backfilled before the deferred mint. The temporal gap
|
|
12
|
+
* is disclosed, never hidden.
|
|
13
|
+
*/
|
|
14
|
+
const AttestationOrigin = z.enum([
|
|
15
|
+
"live",
|
|
16
|
+
"deferred",
|
|
17
|
+
"offline-backfill"
|
|
18
|
+
]);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AttestationOrigin };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=attestation-origin.js.map
|
package/dist/provenance/dsse.js
CHANGED
|
@@ -204,6 +204,7 @@ export declare const kiciWorkflowExternalParametersSchema: z.ZodObject<{
|
|
|
204
204
|
ref: z.ZodString;
|
|
205
205
|
path: z.ZodString;
|
|
206
206
|
}, z.core.$strip>;
|
|
207
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
207
208
|
}, z.core.$loose>;
|
|
208
209
|
export type KiciWorkflowExternalParameters = z.infer<typeof kiciWorkflowExternalParametersSchema>;
|
|
209
210
|
/** KiCI workflow internal parameters: run-scoped build context. */
|
|
@@ -211,6 +212,17 @@ export declare const kiciWorkflowInternalParametersSchema: z.ZodObject<{
|
|
|
211
212
|
commit: z.ZodOptional<z.ZodString>;
|
|
212
213
|
runId: z.ZodOptional<z.ZodString>;
|
|
213
214
|
jobId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
sourceOrigin: z.ZodOptional<z.ZodEnum<{
|
|
217
|
+
triggered: "triggered";
|
|
218
|
+
"run-remote": "run-remote";
|
|
219
|
+
}>>;
|
|
220
|
+
attestationOrigin: z.ZodOptional<z.ZodEnum<{
|
|
221
|
+
live: "live";
|
|
222
|
+
deferred: "deferred";
|
|
223
|
+
"offline-backfill": "offline-backfill";
|
|
224
|
+
}>>;
|
|
225
|
+
statementHash: z.ZodOptional<z.ZodString>;
|
|
214
226
|
}, z.core.$loose>;
|
|
215
227
|
export type KiciWorkflowInternalParameters = z.infer<typeof kiciWorkflowInternalParametersSchema>;
|
|
216
228
|
/** KiCI build definition: pins the buildType and types the workflow params. */
|
|
@@ -231,11 +243,23 @@ export declare const kiciBuildDefinitionSchema: z.ZodObject<{
|
|
|
231
243
|
ref: z.ZodString;
|
|
232
244
|
path: z.ZodString;
|
|
233
245
|
}, z.core.$strip>;
|
|
246
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
234
247
|
}, z.core.$loose>;
|
|
235
248
|
internalParameters: z.ZodOptional<z.ZodObject<{
|
|
236
249
|
commit: z.ZodOptional<z.ZodString>;
|
|
237
250
|
runId: z.ZodOptional<z.ZodString>;
|
|
238
251
|
jobId: z.ZodOptional<z.ZodString>;
|
|
252
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
253
|
+
sourceOrigin: z.ZodOptional<z.ZodEnum<{
|
|
254
|
+
triggered: "triggered";
|
|
255
|
+
"run-remote": "run-remote";
|
|
256
|
+
}>>;
|
|
257
|
+
attestationOrigin: z.ZodOptional<z.ZodEnum<{
|
|
258
|
+
live: "live";
|
|
259
|
+
deferred: "deferred";
|
|
260
|
+
"offline-backfill": "offline-backfill";
|
|
261
|
+
}>>;
|
|
262
|
+
statementHash: z.ZodOptional<z.ZodString>;
|
|
239
263
|
}, z.core.$loose>>;
|
|
240
264
|
}, z.core.$strip>;
|
|
241
265
|
export type KiciBuildDefinition = z.infer<typeof kiciBuildDefinitionSchema>;
|
|
@@ -292,11 +316,23 @@ export declare const kiciProvenancePredicateSchema: z.ZodObject<{
|
|
|
292
316
|
ref: z.ZodString;
|
|
293
317
|
path: z.ZodString;
|
|
294
318
|
}, z.core.$strip>;
|
|
319
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
295
320
|
}, z.core.$loose>;
|
|
296
321
|
internalParameters: z.ZodOptional<z.ZodObject<{
|
|
297
322
|
commit: z.ZodOptional<z.ZodString>;
|
|
298
323
|
runId: z.ZodOptional<z.ZodString>;
|
|
299
324
|
jobId: z.ZodOptional<z.ZodString>;
|
|
325
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
326
|
+
sourceOrigin: z.ZodOptional<z.ZodEnum<{
|
|
327
|
+
triggered: "triggered";
|
|
328
|
+
"run-remote": "run-remote";
|
|
329
|
+
}>>;
|
|
330
|
+
attestationOrigin: z.ZodOptional<z.ZodEnum<{
|
|
331
|
+
live: "live";
|
|
332
|
+
deferred: "deferred";
|
|
333
|
+
"offline-backfill": "offline-backfill";
|
|
334
|
+
}>>;
|
|
335
|
+
statementHash: z.ZodOptional<z.ZodString>;
|
|
300
336
|
}, z.core.$loose>>;
|
|
301
337
|
}, z.core.$strip>;
|
|
302
338
|
runDetails: z.ZodObject<{
|
|
@@ -362,11 +398,23 @@ export declare const kiciProvenanceStatementSchema: z.ZodObject<{
|
|
|
362
398
|
ref: z.ZodString;
|
|
363
399
|
path: z.ZodString;
|
|
364
400
|
}, z.core.$strip>;
|
|
401
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
365
402
|
}, z.core.$loose>;
|
|
366
403
|
internalParameters: z.ZodOptional<z.ZodObject<{
|
|
367
404
|
commit: z.ZodOptional<z.ZodString>;
|
|
368
405
|
runId: z.ZodOptional<z.ZodString>;
|
|
369
406
|
jobId: z.ZodOptional<z.ZodString>;
|
|
407
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
408
|
+
sourceOrigin: z.ZodOptional<z.ZodEnum<{
|
|
409
|
+
triggered: "triggered";
|
|
410
|
+
"run-remote": "run-remote";
|
|
411
|
+
}>>;
|
|
412
|
+
attestationOrigin: z.ZodOptional<z.ZodEnum<{
|
|
413
|
+
live: "live";
|
|
414
|
+
deferred: "deferred";
|
|
415
|
+
"offline-backfill": "offline-backfill";
|
|
416
|
+
}>>;
|
|
417
|
+
statementHash: z.ZodOptional<z.ZodString>;
|
|
370
418
|
}, z.core.$loose>>;
|
|
371
419
|
}, z.core.$strip>;
|
|
372
420
|
runDetails: z.ZodObject<{
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { SourceOrigin } from "../protocol/source-origin.js";
|
|
3
|
+
import { AttestationOrigin } from "./attestation-origin.js";
|
|
2
4
|
import { z } from "zod";
|
|
3
5
|
//#region src/provenance/schema.ts
|
|
4
6
|
/**
|
|
@@ -105,16 +107,28 @@ const inTotoStatementSchema = z.object({
|
|
|
105
107
|
predicate: z.record(z.string(), z.unknown())
|
|
106
108
|
});
|
|
107
109
|
/** KiCI workflow external parameters: the workflow source coordinates. */
|
|
108
|
-
const kiciWorkflowExternalParametersSchema = z.object({
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
const kiciWorkflowExternalParametersSchema = z.object({
|
|
111
|
+
workflow: z.object({
|
|
112
|
+
repository: z.string(),
|
|
113
|
+
ref: z.string(),
|
|
114
|
+
path: z.string()
|
|
115
|
+
}),
|
|
116
|
+
/** Informational source provider (github / gitlab / bitbucket / local). Not a trust signal. */
|
|
117
|
+
provider: z.string().optional()
|
|
118
|
+
}).passthrough();
|
|
113
119
|
/** KiCI workflow internal parameters: run-scoped build context. */
|
|
114
120
|
const kiciWorkflowInternalParametersSchema = z.object({
|
|
115
121
|
commit: z.string().optional(),
|
|
116
122
|
runId: z.string().optional(),
|
|
117
|
-
jobId: z.string().optional()
|
|
123
|
+
jobId: z.string().optional(),
|
|
124
|
+
/** Authoritative origin: the customer's public org id (Platform-asserted). */
|
|
125
|
+
orgId: z.string().optional(),
|
|
126
|
+
/** Source-origin brand: triggered vs kici run remote (local working-tree overlay). */
|
|
127
|
+
sourceOrigin: SourceOrigin.optional(),
|
|
128
|
+
/** Mint-timing marker frozen into a deferred statement at build time. */
|
|
129
|
+
attestationOrigin: AttestationOrigin.optional(),
|
|
130
|
+
/** SHA-256 of this statement's payload — the deferred-mint binding. */
|
|
131
|
+
statementHash: z.string().optional()
|
|
118
132
|
}).passthrough();
|
|
119
133
|
/** KiCI build definition: pins the buildType and types the workflow params. */
|
|
120
134
|
const kiciBuildDefinitionSchema = buildDefinitionSchema.extend({
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lowercase-hex SHA-256 of the DSSE statement payload bytes. This is the binding
|
|
3
|
+
* a deferred OIDC mint commits to (truth-contract property 2): the later token
|
|
4
|
+
* carries this hash as a claim so the Platform identity cannot be re-bound to a
|
|
5
|
+
* different frozen statement at retry time. Browser-safe: `crypto.subtle` only,
|
|
6
|
+
* so the verifier (dashboard + CLI) can recompute it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeStatementHash(payload: Uint8Array): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=statement-hash.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
//#region src/provenance/statement-hash.ts
|
|
3
|
+
/**
|
|
4
|
+
* Lowercase-hex SHA-256 of the DSSE statement payload bytes. This is the binding
|
|
5
|
+
* a deferred OIDC mint commits to (truth-contract property 2): the later token
|
|
6
|
+
* carries this hash as a claim so the Platform identity cannot be re-bound to a
|
|
7
|
+
* different frozen statement at retry time. Browser-safe: `crypto.subtle` only,
|
|
8
|
+
* so the verifier (dashboard + CLI) can recompute it.
|
|
9
|
+
*/
|
|
10
|
+
async function computeStatementHash(payload) {
|
|
11
|
+
const digest = await crypto.subtle.digest("SHA-256", payload);
|
|
12
|
+
return Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { computeStatementHash };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=statement-hash.js.map
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { type JSONWebKeySet } from 'jose';
|
|
25
25
|
import { type KiciProvenanceStatement } from './schema.js';
|
|
26
|
+
import { AttestationOrigin } from './attestation-origin.js';
|
|
26
27
|
/** Tri-state outcome of a single verification check. */
|
|
27
28
|
export type CheckStatus = 'pass' | 'fail' | 'skipped';
|
|
28
29
|
/** Per-check verification outcomes. */
|
|
@@ -46,6 +47,12 @@ export interface VerifyResult {
|
|
|
46
47
|
claims?: Record<string, unknown>;
|
|
47
48
|
statement?: KiciProvenanceStatement;
|
|
48
49
|
failures: string[];
|
|
50
|
+
/**
|
|
51
|
+
* Mint-timing origin of the identity token: `live` (minted during the build,
|
|
52
|
+
* cross-checked field-by-field), or `deferred` / `offline-backfill` (minted
|
|
53
|
+
* later, bound to the frozen statement by hash — the temporal gap is disclosed).
|
|
54
|
+
*/
|
|
55
|
+
attestationOrigin?: AttestationOrigin;
|
|
49
56
|
}
|
|
50
57
|
export interface VerifyKiciBundleOptions {
|
|
51
58
|
/** The bundle to verify (validated against `kiciBundleSchema`). */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { AttestationOrigin } from "./attestation-origin.js";
|
|
2
3
|
import { dssePae } from "./dsse.js";
|
|
3
4
|
import { kiciBundleSchema } from "./bundle.js";
|
|
4
5
|
import { kiciProvenanceStatementSchema } from "./schema.js";
|
|
6
|
+
import { computeStatementHash } from "./statement-hash.js";
|
|
5
7
|
import { calculateJwkThumbprint, createLocalJWKSet, importJWK, jwtVerify } from "jose";
|
|
6
8
|
//#region src/provenance/verify.ts
|
|
7
9
|
/**
|
|
@@ -63,13 +65,19 @@ async function verifyKiciBundle(opts) {
|
|
|
63
65
|
}
|
|
64
66
|
const bundle = parsed.data;
|
|
65
67
|
checks.schema = "pass";
|
|
66
|
-
const statementBytes = b64ToBytes(bundle.dsseEnvelope.payload);
|
|
67
68
|
let statement;
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
let statementBytes;
|
|
70
|
+
try {
|
|
71
|
+
statementBytes = b64ToBytes(bundle.dsseEnvelope.payload);
|
|
72
|
+
const stmt = kiciProvenanceStatementSchema.safeParse(JSON.parse(new TextDecoder().decode(statementBytes)));
|
|
73
|
+
if (!stmt.success) {
|
|
74
|
+
checks.schema = "fail";
|
|
75
|
+
failures.push("statement_schema_invalid");
|
|
76
|
+
} else statement = stmt.data;
|
|
77
|
+
} catch {
|
|
70
78
|
checks.schema = "fail";
|
|
71
|
-
failures.push("
|
|
72
|
-
}
|
|
79
|
+
failures.push("statement_payload_invalid");
|
|
80
|
+
}
|
|
73
81
|
let claims;
|
|
74
82
|
try {
|
|
75
83
|
const { payload } = await jwtVerify(bundle.verificationMaterial.identityToken, createLocalJWKSet(opts.jwks), {
|
|
@@ -83,6 +91,7 @@ async function verifyKiciBundle(opts) {
|
|
|
83
91
|
failures.push("identity_token_invalid");
|
|
84
92
|
}
|
|
85
93
|
try {
|
|
94
|
+
if (!statementBytes) throw new Error("no statement bytes");
|
|
86
95
|
const pubJwk = bundle.verificationMaterial.publicKey;
|
|
87
96
|
const thumbprint = await calculateJwkThumbprint(pubJwk, "sha256");
|
|
88
97
|
if (bundle.dsseEnvelope.signatures[0].keyid !== thumbprint) throw new Error("keyid does not match public-key thumbprint");
|
|
@@ -96,11 +105,18 @@ async function verifyKiciBundle(opts) {
|
|
|
96
105
|
checks.dsse = "fail";
|
|
97
106
|
failures.push("dsse_signature_invalid");
|
|
98
107
|
}
|
|
99
|
-
|
|
108
|
+
const attestationOrigin = resolveAttestationOrigin(claims, statement);
|
|
109
|
+
if (statement && claims && statementBytes) if (attestationOrigin === AttestationOrigin.enum.live) {
|
|
100
110
|
const ok = crossCheckBuildContext(statement, claims);
|
|
101
111
|
checks.buildContext = ok ? "pass" : "fail";
|
|
102
112
|
if (!ok) failures.push("build_context_mismatch");
|
|
103
113
|
} else {
|
|
114
|
+
const actual = await computeStatementHash(statementBytes);
|
|
115
|
+
const ok = typeof claims.statement_hash === "string" && claims.statement_hash === actual;
|
|
116
|
+
checks.buildContext = ok ? "pass" : "fail";
|
|
117
|
+
if (!ok) failures.push("statement_hash_mismatch");
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
104
120
|
checks.buildContext = "fail";
|
|
105
121
|
failures.push("build_context_uncheckable");
|
|
106
122
|
}
|
|
@@ -115,15 +131,38 @@ async function verifyKiciBundle(opts) {
|
|
|
115
131
|
checks,
|
|
116
132
|
claims,
|
|
117
133
|
statement,
|
|
118
|
-
failures
|
|
134
|
+
failures,
|
|
135
|
+
attestationOrigin
|
|
119
136
|
};
|
|
120
137
|
}
|
|
121
|
-
/**
|
|
138
|
+
/** Derive the mint-timing origin from the token claim, then the frozen statement. */
|
|
139
|
+
function resolveAttestationOrigin(claims, statement) {
|
|
140
|
+
const fromClaim = AttestationOrigin.safeParse(claims?.attestation_origin);
|
|
141
|
+
if (fromClaim.success) return fromClaim.data;
|
|
142
|
+
const internal = statement?.predicate.buildDefinition.internalParameters;
|
|
143
|
+
const fromStatement = AttestationOrigin.safeParse(internal?.attestationOrigin);
|
|
144
|
+
return fromStatement.success ? fromStatement.data : AttestationOrigin.enum.live;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The statement's build context must equal the (server-truth) JWT claims.
|
|
148
|
+
*
|
|
149
|
+
* Only the **claims** side is normalized (`?? ''`): the producer coerces a
|
|
150
|
+
* null/absent `repository` / `ref` / `workflow_ref` claim into the
|
|
151
|
+
* schema-required empty string and omits `commit` entirely when `sha` is
|
|
152
|
+
* falsy, so a null/absent claim is compared against that coerced `''` /
|
|
153
|
+
* omitted-commit. The **statement** side stays strict — a non-empty
|
|
154
|
+
* attacker-controlled statement field never matches a null claim
|
|
155
|
+
* (`'evil/repo' === (null ?? '')` → `'evil/repo' === ''` → false), and an
|
|
156
|
+
* empty statement field never matches a non-null claim — so this relaxation
|
|
157
|
+
* is forgery-safe in exactly one direction: empty/absent statement ⇔
|
|
158
|
+
* null/absent claim, and nothing else. `runId` / `jobId` are always minted,
|
|
159
|
+
* so they stay strict.
|
|
160
|
+
*/
|
|
122
161
|
function crossCheckBuildContext(statement, claims) {
|
|
123
162
|
const bd = statement.predicate.buildDefinition;
|
|
124
163
|
const wf = bd.externalParameters.workflow;
|
|
125
164
|
const ip = bd.internalParameters ?? {};
|
|
126
|
-
return wf.repository === claims.repository && wf.ref === claims.ref && wf.path === claims.workflow_ref && ip.commit === claims.sha && ip.runId === claims.kici_run_id && ip.jobId === claims.kici_job_id;
|
|
165
|
+
return wf.repository === (claims.repository ?? "") && wf.ref === (claims.ref ?? "") && wf.path === (claims.workflow_ref ?? "") && (ip.commit ?? "") === (claims.sha ?? "") && ip.runId === claims.kici_run_id && ip.jobId === claims.kici_job_id;
|
|
127
166
|
}
|
|
128
167
|
/** At least one subject must carry a digest matching the supplied artifact digest. */
|
|
129
168
|
function checkSubjectDigest(statement, expected) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/provider/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/provider/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
|
@@ -26,10 +26,10 @@ import { z } from 'zod';
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const RegisterableTriggerType: z.ZodEnum<{
|
|
28
28
|
dispatch: "dispatch";
|
|
29
|
+
push: "push";
|
|
29
30
|
status: "status";
|
|
30
31
|
generic_webhook: "generic_webhook";
|
|
31
32
|
pr: "pr";
|
|
32
|
-
push: "push";
|
|
33
33
|
tag: "tag";
|
|
34
34
|
comment: "comment";
|
|
35
35
|
review: "review";
|
package/dist/secrets/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Re-exports scope-based secret store types and audit entry.
|
|
5
5
|
*/
|
|
6
|
-
export type { SecretStore, AuditEntry, BackendType, BackendHealthStatus, BackendDescriptor, AddBackendParams,
|
|
6
|
+
export type { SecretStore, AuditEntry, BackendType, BackendHealthStatus, BackendDescriptor, AddBackendParams, BackendSyncManager, } from './types.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/secrets/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/secrets/types.d.ts
CHANGED
|
@@ -69,30 +69,6 @@ export interface AddBackendParams {
|
|
|
69
69
|
scopeFilter?: string;
|
|
70
70
|
syncIntervalMs?: number;
|
|
71
71
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Backend lifecycle manager interface.
|
|
74
|
-
* Provides CRUD, health checks, and connection testing for secret backends.
|
|
75
|
-
*/
|
|
76
|
-
export interface BackendManager {
|
|
77
|
-
/** Check backend connectivity. Returns health status. */
|
|
78
|
-
checkHealth(name: string): Promise<BackendHealthStatus>;
|
|
79
|
-
/** Trigger scope discovery sync for a backend (or all if name omitted). */
|
|
80
|
-
syncScopes(name?: string): Promise<void>;
|
|
81
|
-
/** List all registered backends (no credentials). */
|
|
82
|
-
listBackends(): Promise<BackendDescriptor[]>;
|
|
83
|
-
/** Get a single backend by name. */
|
|
84
|
-
getBackend(name: string): Promise<BackendDescriptor | null>;
|
|
85
|
-
/** Register a new backend. Returns the descriptor. */
|
|
86
|
-
addBackend(params: AddBackendParams): Promise<BackendDescriptor>;
|
|
87
|
-
/** Remove a backend by name. Returns true if removed. */
|
|
88
|
-
removeBackend(name: string): Promise<boolean>;
|
|
89
|
-
/** Test connectivity without persisting. */
|
|
90
|
-
testConnection(params: AddBackendParams): Promise<{
|
|
91
|
-
ok: boolean;
|
|
92
|
-
error?: string;
|
|
93
|
-
latencyMs: number;
|
|
94
|
-
}>;
|
|
95
|
-
}
|
|
96
72
|
/**
|
|
97
73
|
* Periodic scope sync manager for secret backends.
|
|
98
74
|
*/
|
package/dist/secrets/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|