@ggui-ai/gadget-signing 0.9.0 → 0.10.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/index.d.ts.map +1 -1
- package/dist/index.js +35 -6
- package/package.json +2 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAuBH,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,qEAAqE;IACrE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAWnE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB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AC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,YAAY,CAAC,CAyGvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,iBAAiB,GAC3B,MAAM,GAAG,SAAS,CA8BpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,iBAAiB,GAC3B,SAAS,MAAM,EAAE,CASnB"}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import { signAsync, verifyAsync, getPublicKeyAsync, utils } from "@noble/ed25519
|
|
|
32
32
|
import { sha384, sha256 } from "@noble/hashes/sha2";
|
|
33
33
|
import { bundleFromJSON, bundleToJSON, } from "@sigstore/bundle";
|
|
34
34
|
import { X509Certificate } from "@sigstore/core";
|
|
35
|
+
import { DEFAULT_FULCIO_URL, DEFAULT_REKOR_URL, FulcioSigner, MessageSignatureBundleBuilder, RekorWitness, } from "@sigstore/sign";
|
|
35
36
|
import * as sigstoreClient from "sigstore";
|
|
36
37
|
// ---------------------------------------------------------------------------
|
|
37
38
|
// Canonical type guards.
|
|
@@ -318,14 +319,42 @@ export async function signBundleSigstore(input) {
|
|
|
318
319
|
const { bundleBytes, identityToken, endpoints } = input;
|
|
319
320
|
const digest = sha384(bundleBytes);
|
|
320
321
|
const bundleSha384 = bytesToBase64(digest);
|
|
322
|
+
// Assembled from `@sigstore/sign` primitives rather than the
|
|
323
|
+
// high-level `sigstore.sign()` facade, for exactly one flag the
|
|
324
|
+
// facade hardcodes off: `fetchOnConflict` (ggui#555). Rekor answers
|
|
325
|
+
// 409 "an equivalent entry already exists" when the SAME signed
|
|
326
|
+
// entry is re-submitted — and under keyless signing (a fresh
|
|
327
|
+
// ephemeral key per sign) that can only be this client's own retry
|
|
328
|
+
// re-POSTing a create whose first attempt landed but whose response
|
|
329
|
+
// was lost. The facade surfaces that as a fatal
|
|
330
|
+
// TLOG_CREATE_ENTRY_ERROR; with `fetchOnConflict: true` the witness
|
|
331
|
+
// follows the 409's Location header to the entry the first attempt
|
|
332
|
+
// created — the designed recovery, and the publish is (correctly)
|
|
333
|
+
// idempotent. Everything else mirrors the facade's own composition
|
|
334
|
+
// (its initSigner/initWitnesses: same URL defaults, same
|
|
335
|
+
// retry/timeout). The verify path stays on the facade.
|
|
336
|
+
const retry = { retries: 2 }; // sigstore's DEFAULT_RETRY
|
|
337
|
+
const timeout = 5_000; // sigstore's DEFAULT_TIMEOUT
|
|
338
|
+
const bundler = new MessageSignatureBundleBuilder({
|
|
339
|
+
signer: new FulcioSigner({
|
|
340
|
+
fulcioBaseURL: endpoints?.fulcioURL ?? DEFAULT_FULCIO_URL,
|
|
341
|
+
identityProvider: { getToken: () => Promise.resolve(identityToken) },
|
|
342
|
+
retry,
|
|
343
|
+
timeout,
|
|
344
|
+
}),
|
|
345
|
+
witnesses: [
|
|
346
|
+
new RekorWitness({
|
|
347
|
+
rekorBaseURL: endpoints?.rekorURL ?? DEFAULT_REKOR_URL,
|
|
348
|
+
fetchOnConflict: true,
|
|
349
|
+
retry,
|
|
350
|
+
timeout,
|
|
351
|
+
}),
|
|
352
|
+
],
|
|
353
|
+
});
|
|
321
354
|
let serialized;
|
|
322
355
|
try {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
...(endpoints?.fulcioURL ? { fulcioURL: endpoints.fulcioURL } : {}),
|
|
326
|
-
...(endpoints?.rekorURL ? { rekorURL: endpoints.rekorURL } : {}),
|
|
327
|
-
tlogUpload: true,
|
|
328
|
-
});
|
|
356
|
+
const bundle = await bundler.create({ data: Buffer.from(bundleBytes) });
|
|
357
|
+
serialized = bundleToJSON(bundle);
|
|
329
358
|
}
|
|
330
359
|
catch (err) {
|
|
331
360
|
throw classifySigstoreSigningError(err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/gadget-signing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Gadget bundle signing + verification for the ggui gadget marketplace. Ed25519 author-key path + sigstore/cosign keyless path. Pure-TS @noble crypto for Ed25519 — browser-safe.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@noble/hashes": "^1.6.0",
|
|
38
38
|
"@sigstore/bundle": "^4.0.0",
|
|
39
39
|
"@sigstore/core": "^3.2.1",
|
|
40
|
+
"@sigstore/sign": "^4.0.0",
|
|
40
41
|
"sigstore": "^4.0.0"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|