@countinghouse/ch-local 0.0.0-stage → 1.0.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/LICENSE +202 -0
- package/README.md +361 -2
- package/bin/ch-local.js +472 -0
- package/clients/claude-code/.claude-plugin/plugin.json +6 -0
- package/clients/claude-code/.mcp.json +11 -0
- package/clients/claude-code/bin/launch.js +235 -0
- package/clients/claude-code/bin/win-acl.js +420 -0
- package/clients/claude-code/skills/ci-failure-triage/SKILL.md +21 -0
- package/clients/claude-code/skills/countinghouse-module/SKILL.md +177 -0
- package/clients/claude-code/skills/countinghouse-setup/SKILL.md +74 -0
- package/lib/allowlist.js +65 -0
- package/lib/aside.js +16 -0
- package/lib/atomic.js +45 -0
- package/lib/auto-apply.js +245 -0
- package/lib/auto-upgrade.js +98 -0
- package/lib/availability.js +307 -0
- package/lib/ceiling.js +280 -0
- package/lib/clean-text.js +20 -0
- package/lib/cli-change.js +38 -0
- package/lib/client-conditions-fixtures.js +143 -0
- package/lib/client-conditions.js +656 -0
- package/lib/clients.js +179 -0
- package/lib/command-line.js +202 -0
- package/lib/conditions-command.js +116 -0
- package/lib/control.js +134 -0
- package/lib/credential-store.js +414 -0
- package/lib/credentials-command.js +344 -0
- package/lib/daemon-requests.js +137 -0
- package/lib/daemon.js +888 -0
- package/lib/describe-module.js +137 -0
- package/lib/description-check.js +175 -0
- package/lib/failed-json.js +43 -0
- package/lib/gc.js +274 -0
- package/lib/github-token.js +57 -0
- package/lib/handoff-io.js +73 -0
- package/lib/held-back.js +116 -0
- package/lib/hidden-input.js +64 -0
- package/lib/history.js +49 -0
- package/lib/home.js +372 -0
- package/lib/in-place.js +1036 -0
- package/lib/install-plan.js +142 -0
- package/lib/install.js +846 -0
- package/lib/installed-description.js +153 -0
- package/lib/integrity.js +7 -0
- package/lib/lock.js +456 -0
- package/lib/lockfile-rules.js +98 -0
- package/lib/machine.js +20 -0
- package/lib/module-credentials.js +403 -0
- package/lib/module-record.js +298 -0
- package/lib/module-roles.js +44 -0
- package/lib/module-seams.js +26 -0
- package/lib/module-store.js +202 -0
- package/lib/module-values.js +334 -0
- package/lib/names.js +31 -0
- package/lib/next-steps.js +8 -0
- package/lib/node-check.js +56 -0
- package/lib/npm-fetch.js +123 -0
- package/lib/npm-release.js +99 -0
- package/lib/npm-upgrade.js +146 -0
- package/lib/npm.js +41 -0
- package/lib/outside-edits.js +162 -0
- package/lib/own-applied.js +175 -0
- package/lib/own-command.js +380 -0
- package/lib/own-file.js +120 -0
- package/lib/own-record.js +96 -0
- package/lib/own-tree.js +336 -0
- package/lib/pack-table.js +290 -0
- package/lib/packs-command.js +570 -0
- package/lib/packs.js +219 -0
- package/lib/pins.js +64 -0
- package/lib/pipe-probe.js +82 -0
- package/lib/plain-read.js +63 -0
- package/lib/private-file.js +90 -0
- package/lib/private-write.js +33 -0
- package/lib/provenance.js +234 -0
- package/lib/record.js +82 -0
- package/lib/registry.js +22 -0
- package/lib/release-pins.js +350 -0
- package/lib/release-pins.json +4225 -0
- package/lib/release-tags.js +12 -0
- package/lib/release.js +36 -0
- package/lib/restart-command.js +161 -0
- package/lib/rollback.js +227 -0
- package/lib/run-liveness.js +15 -0
- package/lib/runtime-log.js +287 -0
- package/lib/sandbox-support.js +17 -0
- package/lib/semver-order.js +40 -0
- package/lib/session-socket.js +69 -0
- package/lib/session-table.js +238 -0
- package/lib/session.js +281 -0
- package/lib/settings-command.js +82 -0
- package/lib/settings.js +564 -0
- package/lib/shim-binary.js +152 -0
- package/lib/shim-config.js +159 -0
- package/lib/shim-install.js +365 -0
- package/lib/sigstore/README.md +44 -0
- package/lib/sigstore/npm-keys.json +18 -0
- package/lib/sigstore/trusted-root.json +126 -0
- package/lib/snippets.js +76 -0
- package/lib/start.js +721 -0
- package/lib/store-files.js +48 -0
- package/lib/store-paths.js +33 -0
- package/lib/swap-preload.js +38 -0
- package/lib/tar.js +220 -0
- package/lib/uninstall.js +314 -0
- package/lib/unpack.js +41 -0
- package/lib/upgrade-stamp.js +63 -0
- package/lib/upgrade.js +281 -0
- package/lib/watch.js +40 -0
- package/lib/win-acl.js +420 -0
- package/node_modules/@sigstore/bundle/LICENSE +202 -0
- package/node_modules/@sigstore/bundle/README.md +19 -0
- package/node_modules/@sigstore/bundle/dist/build.d.ts +18 -0
- package/node_modules/@sigstore/bundle/dist/build.js +100 -0
- package/node_modules/@sigstore/bundle/dist/bundle.d.ts +74 -0
- package/node_modules/@sigstore/bundle/dist/bundle.js +24 -0
- package/node_modules/@sigstore/bundle/dist/error.d.ts +4 -0
- package/node_modules/@sigstore/bundle/dist/error.js +25 -0
- package/node_modules/@sigstore/bundle/dist/index.d.ts +8 -0
- package/node_modules/@sigstore/bundle/dist/index.js +43 -0
- package/node_modules/@sigstore/bundle/dist/serialized.d.ts +74 -0
- package/node_modules/@sigstore/bundle/dist/serialized.js +49 -0
- package/node_modules/@sigstore/bundle/dist/utility.d.ts +14 -0
- package/node_modules/@sigstore/bundle/dist/utility.js +2 -0
- package/node_modules/@sigstore/bundle/dist/validate.d.ts +7 -0
- package/node_modules/@sigstore/bundle/dist/validate.js +199 -0
- package/node_modules/@sigstore/bundle/package.json +35 -0
- package/node_modules/@sigstore/core/LICENSE +202 -0
- package/node_modules/@sigstore/core/README.md +10 -0
- package/node_modules/@sigstore/core/dist/asn1/error.d.ts +4 -0
- package/node_modules/@sigstore/core/dist/asn1/error.js +24 -0
- package/node_modules/@sigstore/core/dist/asn1/index.d.ts +1 -0
- package/node_modules/@sigstore/core/dist/asn1/index.js +20 -0
- package/node_modules/@sigstore/core/dist/asn1/length.d.ts +3 -0
- package/node_modules/@sigstore/core/dist/asn1/length.js +62 -0
- package/node_modules/@sigstore/core/dist/asn1/obj.d.ts +14 -0
- package/node_modules/@sigstore/core/dist/asn1/obj.js +155 -0
- package/node_modules/@sigstore/core/dist/asn1/parse.d.ts +6 -0
- package/node_modules/@sigstore/core/dist/asn1/parse.js +124 -0
- package/node_modules/@sigstore/core/dist/asn1/tag.d.ts +16 -0
- package/node_modules/@sigstore/core/dist/asn1/tag.js +89 -0
- package/node_modules/@sigstore/core/dist/crypto.d.ts +6 -0
- package/node_modules/@sigstore/core/dist/crypto.js +69 -0
- package/node_modules/@sigstore/core/dist/dsse.d.ts +1 -0
- package/node_modules/@sigstore/core/dist/dsse.js +29 -0
- package/node_modules/@sigstore/core/dist/encoding.d.ts +2 -0
- package/node_modules/@sigstore/core/dist/encoding.js +27 -0
- package/node_modules/@sigstore/core/dist/index.d.ts +9 -0
- package/node_modules/@sigstore/core/dist/index.js +66 -0
- package/node_modules/@sigstore/core/dist/json.d.ts +1 -0
- package/node_modules/@sigstore/core/dist/json.js +60 -0
- package/node_modules/@sigstore/core/dist/oid.d.ts +3 -0
- package/node_modules/@sigstore/core/dist/oid.js +20 -0
- package/node_modules/@sigstore/core/dist/pem.d.ts +2 -0
- package/node_modules/@sigstore/core/dist/pem.js +43 -0
- package/node_modules/@sigstore/core/dist/rfc3161/error.d.ts +2 -0
- package/node_modules/@sigstore/core/dist/rfc3161/error.js +21 -0
- package/node_modules/@sigstore/core/dist/rfc3161/index.d.ts +1 -0
- package/node_modules/@sigstore/core/dist/rfc3161/index.js +20 -0
- package/node_modules/@sigstore/core/dist/rfc3161/timestamp.d.ts +36 -0
- package/node_modules/@sigstore/core/dist/rfc3161/timestamp.js +212 -0
- package/node_modules/@sigstore/core/dist/rfc3161/tstinfo.d.ts +12 -0
- package/node_modules/@sigstore/core/dist/rfc3161/tstinfo.js +72 -0
- package/node_modules/@sigstore/core/dist/stream.d.ts +21 -0
- package/node_modules/@sigstore/core/dist/stream.js +117 -0
- package/node_modules/@sigstore/core/dist/x509/cert.d.ts +43 -0
- package/node_modules/@sigstore/core/dist/x509/cert.js +245 -0
- package/node_modules/@sigstore/core/dist/x509/ext.d.ts +41 -0
- package/node_modules/@sigstore/core/dist/x509/ext.js +146 -0
- package/node_modules/@sigstore/core/dist/x509/index.d.ts +2 -0
- package/node_modules/@sigstore/core/dist/x509/index.js +23 -0
- package/node_modules/@sigstore/core/dist/x509/sct.d.ts +25 -0
- package/node_modules/@sigstore/core/dist/x509/sct.js +158 -0
- package/node_modules/@sigstore/core/package.json +31 -0
- package/node_modules/@sigstore/protobuf-specs/LICENSE +202 -0
- package/node_modules/@sigstore/protobuf-specs/README.md +5 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/envelope.d.ts +44 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/envelope.js +59 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/events.d.ts +64 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/events.js +174 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/api/field_behavior.d.ts +74 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/api/field_behavior.js +141 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/any.d.ts +74 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/any.js +35 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/descriptor.d.ts +1309 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/descriptor.js +2191 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/timestamp.d.ts +113 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/timestamp.js +29 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/dsse.d.ts +23 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/dsse.js +55 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/entry.d.ts +43 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/entry.js +81 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/hashedrekord.d.ts +22 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/hashedrekord.js +56 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/verifier.d.ts +35 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/rekor/v2/verifier.js +74 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_bundle.d.ts +146 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_bundle.js +103 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_common.d.ts +304 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_common.js +612 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_monitor.d.ts +33 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_monitor.js +55 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_rekor.d.ts +144 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_rekor.js +137 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_trustroot.d.ts +386 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_trustroot.js +284 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_verification.d.ts +191 -0
- package/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_verification.js +281 -0
- package/node_modules/@sigstore/protobuf-specs/dist/index.d.ts +6 -0
- package/node_modules/@sigstore/protobuf-specs/dist/index.js +37 -0
- package/node_modules/@sigstore/protobuf-specs/dist/rekor/v2/index.d.ts +4 -0
- package/node_modules/@sigstore/protobuf-specs/dist/rekor/v2/index.js +35 -0
- package/node_modules/@sigstore/protobuf-specs/package.json +35 -0
- package/node_modules/@sigstore/verify/README.md +9 -0
- package/node_modules/@sigstore/verify/dist/bundle/dsse.d.ts +12 -0
- package/node_modules/@sigstore/verify/dist/bundle/dsse.js +44 -0
- package/node_modules/@sigstore/verify/dist/bundle/index.d.ts +4 -0
- package/node_modules/@sigstore/verify/dist/bundle/index.js +59 -0
- package/node_modules/@sigstore/verify/dist/bundle/message.d.ts +13 -0
- package/node_modules/@sigstore/verify/dist/bundle/message.js +54 -0
- package/node_modules/@sigstore/verify/dist/error.d.ts +16 -0
- package/node_modules/@sigstore/verify/dist/error.js +34 -0
- package/node_modules/@sigstore/verify/dist/index.d.ts +6 -0
- package/node_modules/@sigstore/verify/dist/index.js +28 -0
- package/node_modules/@sigstore/verify/dist/key/certificate.d.ts +21 -0
- package/node_modules/@sigstore/verify/dist/key/certificate.js +216 -0
- package/node_modules/@sigstore/verify/dist/key/index.d.ts +10 -0
- package/node_modules/@sigstore/verify/dist/key/index.js +75 -0
- package/node_modules/@sigstore/verify/dist/key/sct.d.ts +4 -0
- package/node_modules/@sigstore/verify/dist/key/sct.js +78 -0
- package/node_modules/@sigstore/verify/dist/policy.d.ts +5 -0
- package/node_modules/@sigstore/verify/dist/policy.js +50 -0
- package/node_modules/@sigstore/verify/dist/shared.types.d.ts +50 -0
- package/node_modules/@sigstore/verify/dist/shared.types.js +2 -0
- package/node_modules/@sigstore/verify/dist/timestamp/index.d.ts +11 -0
- package/node_modules/@sigstore/verify/dist/timestamp/index.js +24 -0
- package/node_modules/@sigstore/verify/dist/timestamp/tsa.d.ts +3 -0
- package/node_modules/@sigstore/verify/dist/timestamp/tsa.js +63 -0
- package/node_modules/@sigstore/verify/dist/tlog/checkpoint.d.ts +11 -0
- package/node_modules/@sigstore/verify/dist/tlog/checkpoint.js +154 -0
- package/node_modules/@sigstore/verify/dist/tlog/dsse.d.ts +6 -0
- package/node_modules/@sigstore/verify/dist/tlog/dsse.js +106 -0
- package/node_modules/@sigstore/verify/dist/tlog/hashedrekord.d.ts +6 -0
- package/node_modules/@sigstore/verify/dist/tlog/hashedrekord.js +94 -0
- package/node_modules/@sigstore/verify/dist/tlog/index.d.ts +5 -0
- package/node_modules/@sigstore/verify/dist/tlog/index.js +92 -0
- package/node_modules/@sigstore/verify/dist/tlog/intoto.d.ts +3 -0
- package/node_modules/@sigstore/verify/dist/tlog/intoto.js +62 -0
- package/node_modules/@sigstore/verify/dist/tlog/merkle.d.ts +3 -0
- package/node_modules/@sigstore/verify/dist/tlog/merkle.js +104 -0
- package/node_modules/@sigstore/verify/dist/tlog/set.d.ts +3 -0
- package/node_modules/@sigstore/verify/dist/tlog/set.js +60 -0
- package/node_modules/@sigstore/verify/dist/trust/filter.d.ts +8 -0
- package/node_modules/@sigstore/verify/dist/trust/filter.js +23 -0
- package/node_modules/@sigstore/verify/dist/trust/index.d.ts +5 -0
- package/node_modules/@sigstore/verify/dist/trust/index.js +90 -0
- package/node_modules/@sigstore/verify/dist/trust/trust.types.d.ts +29 -0
- package/node_modules/@sigstore/verify/dist/trust/trust.types.js +2 -0
- package/node_modules/@sigstore/verify/dist/verifier.d.ts +31 -0
- package/node_modules/@sigstore/verify/dist/verifier.js +160 -0
- package/node_modules/@sigstore/verify/package.json +36 -0
- package/package.json +37 -4
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc v7.35.1
|
|
6
|
+
// source: sigstore_verification.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Input = exports.Artifact = exports.ArtifactVerificationOptions_ObserverTimestampOptions = exports.ArtifactVerificationOptions_TlogIntegratedTimestampOptions = exports.ArtifactVerificationOptions_TimestampAuthorityOptions = exports.ArtifactVerificationOptions_CtlogOptions = exports.ArtifactVerificationOptions_TlogOptions = exports.ArtifactVerificationOptions = exports.PublicKeyIdentities = exports.CertificateIdentities = exports.CertificateIdentity = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const sigstore_bundle_1 = require("./sigstore_bundle");
|
|
11
|
+
const sigstore_common_1 = require("./sigstore_common");
|
|
12
|
+
const sigstore_trustroot_1 = require("./sigstore_trustroot");
|
|
13
|
+
exports.CertificateIdentity = {
|
|
14
|
+
fromJSON(object) {
|
|
15
|
+
return {
|
|
16
|
+
issuer: isSet(object.issuer) ? globalThis.String(object.issuer) : "",
|
|
17
|
+
san: isSet(object.san) ? sigstore_common_1.SubjectAlternativeName.fromJSON(object.san) : undefined,
|
|
18
|
+
oids: globalThis.Array.isArray(object?.oids)
|
|
19
|
+
? object.oids.map((e) => sigstore_common_1.ObjectIdentifierValuePair.fromJSON(e))
|
|
20
|
+
: [],
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
toJSON(message) {
|
|
24
|
+
const obj = {};
|
|
25
|
+
if (message.issuer !== "") {
|
|
26
|
+
obj.issuer = message.issuer;
|
|
27
|
+
}
|
|
28
|
+
if (message.san !== undefined) {
|
|
29
|
+
obj.san = sigstore_common_1.SubjectAlternativeName.toJSON(message.san);
|
|
30
|
+
}
|
|
31
|
+
if (message.oids?.length) {
|
|
32
|
+
obj.oids = message.oids.map((e) => sigstore_common_1.ObjectIdentifierValuePair.toJSON(e));
|
|
33
|
+
}
|
|
34
|
+
return obj;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
exports.CertificateIdentities = {
|
|
38
|
+
fromJSON(object) {
|
|
39
|
+
return {
|
|
40
|
+
identities: globalThis.Array.isArray(object?.identities)
|
|
41
|
+
? object.identities.map((e) => exports.CertificateIdentity.fromJSON(e))
|
|
42
|
+
: [],
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
toJSON(message) {
|
|
46
|
+
const obj = {};
|
|
47
|
+
if (message.identities?.length) {
|
|
48
|
+
obj.identities = message.identities.map((e) => exports.CertificateIdentity.toJSON(e));
|
|
49
|
+
}
|
|
50
|
+
return obj;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
exports.PublicKeyIdentities = {
|
|
54
|
+
fromJSON(object) {
|
|
55
|
+
return {
|
|
56
|
+
publicKeys: globalThis.Array.isArray(object?.publicKeys)
|
|
57
|
+
? object.publicKeys.map((e) => sigstore_common_1.PublicKey.fromJSON(e))
|
|
58
|
+
: [],
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
toJSON(message) {
|
|
62
|
+
const obj = {};
|
|
63
|
+
if (message.publicKeys?.length) {
|
|
64
|
+
obj.publicKeys = message.publicKeys.map((e) => sigstore_common_1.PublicKey.toJSON(e));
|
|
65
|
+
}
|
|
66
|
+
return obj;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
exports.ArtifactVerificationOptions = {
|
|
70
|
+
fromJSON(object) {
|
|
71
|
+
return {
|
|
72
|
+
signers: isSet(object.certificateIdentities)
|
|
73
|
+
? {
|
|
74
|
+
$case: "certificateIdentities",
|
|
75
|
+
certificateIdentities: exports.CertificateIdentities.fromJSON(object.certificateIdentities),
|
|
76
|
+
}
|
|
77
|
+
: isSet(object.publicKeys)
|
|
78
|
+
? { $case: "publicKeys", publicKeys: exports.PublicKeyIdentities.fromJSON(object.publicKeys) }
|
|
79
|
+
: undefined,
|
|
80
|
+
tlogOptions: isSet(object.tlogOptions)
|
|
81
|
+
? exports.ArtifactVerificationOptions_TlogOptions.fromJSON(object.tlogOptions)
|
|
82
|
+
: undefined,
|
|
83
|
+
ctlogOptions: isSet(object.ctlogOptions)
|
|
84
|
+
? exports.ArtifactVerificationOptions_CtlogOptions.fromJSON(object.ctlogOptions)
|
|
85
|
+
: undefined,
|
|
86
|
+
tsaOptions: isSet(object.tsaOptions)
|
|
87
|
+
? exports.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(object.tsaOptions)
|
|
88
|
+
: undefined,
|
|
89
|
+
integratedTsOptions: isSet(object.integratedTsOptions)
|
|
90
|
+
? exports.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(object.integratedTsOptions)
|
|
91
|
+
: undefined,
|
|
92
|
+
observerOptions: isSet(object.observerOptions)
|
|
93
|
+
? exports.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(object.observerOptions)
|
|
94
|
+
: undefined,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
toJSON(message) {
|
|
98
|
+
const obj = {};
|
|
99
|
+
if (message.signers?.$case === "certificateIdentities") {
|
|
100
|
+
obj.certificateIdentities = exports.CertificateIdentities.toJSON(message.signers.certificateIdentities);
|
|
101
|
+
}
|
|
102
|
+
else if (message.signers?.$case === "publicKeys") {
|
|
103
|
+
obj.publicKeys = exports.PublicKeyIdentities.toJSON(message.signers.publicKeys);
|
|
104
|
+
}
|
|
105
|
+
if (message.tlogOptions !== undefined) {
|
|
106
|
+
obj.tlogOptions = exports.ArtifactVerificationOptions_TlogOptions.toJSON(message.tlogOptions);
|
|
107
|
+
}
|
|
108
|
+
if (message.ctlogOptions !== undefined) {
|
|
109
|
+
obj.ctlogOptions = exports.ArtifactVerificationOptions_CtlogOptions.toJSON(message.ctlogOptions);
|
|
110
|
+
}
|
|
111
|
+
if (message.tsaOptions !== undefined) {
|
|
112
|
+
obj.tsaOptions = exports.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(message.tsaOptions);
|
|
113
|
+
}
|
|
114
|
+
if (message.integratedTsOptions !== undefined) {
|
|
115
|
+
obj.integratedTsOptions = exports.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(message.integratedTsOptions);
|
|
116
|
+
}
|
|
117
|
+
if (message.observerOptions !== undefined) {
|
|
118
|
+
obj.observerOptions = exports.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(message.observerOptions);
|
|
119
|
+
}
|
|
120
|
+
return obj;
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
exports.ArtifactVerificationOptions_TlogOptions = {
|
|
124
|
+
fromJSON(object) {
|
|
125
|
+
return {
|
|
126
|
+
threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
127
|
+
performOnlineVerification: isSet(object.performOnlineVerification)
|
|
128
|
+
? globalThis.Boolean(object.performOnlineVerification)
|
|
129
|
+
: false,
|
|
130
|
+
disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false,
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
toJSON(message) {
|
|
134
|
+
const obj = {};
|
|
135
|
+
if (message.threshold !== 0) {
|
|
136
|
+
obj.threshold = Math.round(message.threshold);
|
|
137
|
+
}
|
|
138
|
+
if (message.performOnlineVerification !== false) {
|
|
139
|
+
obj.performOnlineVerification = message.performOnlineVerification;
|
|
140
|
+
}
|
|
141
|
+
if (message.disable !== false) {
|
|
142
|
+
obj.disable = message.disable;
|
|
143
|
+
}
|
|
144
|
+
return obj;
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
exports.ArtifactVerificationOptions_CtlogOptions = {
|
|
148
|
+
fromJSON(object) {
|
|
149
|
+
return {
|
|
150
|
+
threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
151
|
+
disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false,
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
toJSON(message) {
|
|
155
|
+
const obj = {};
|
|
156
|
+
if (message.threshold !== 0) {
|
|
157
|
+
obj.threshold = Math.round(message.threshold);
|
|
158
|
+
}
|
|
159
|
+
if (message.disable !== false) {
|
|
160
|
+
obj.disable = message.disable;
|
|
161
|
+
}
|
|
162
|
+
return obj;
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
exports.ArtifactVerificationOptions_TimestampAuthorityOptions = {
|
|
166
|
+
fromJSON(object) {
|
|
167
|
+
return {
|
|
168
|
+
threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
169
|
+
disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false,
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
toJSON(message) {
|
|
173
|
+
const obj = {};
|
|
174
|
+
if (message.threshold !== 0) {
|
|
175
|
+
obj.threshold = Math.round(message.threshold);
|
|
176
|
+
}
|
|
177
|
+
if (message.disable !== false) {
|
|
178
|
+
obj.disable = message.disable;
|
|
179
|
+
}
|
|
180
|
+
return obj;
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
exports.ArtifactVerificationOptions_TlogIntegratedTimestampOptions = {
|
|
184
|
+
fromJSON(object) {
|
|
185
|
+
return {
|
|
186
|
+
threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
187
|
+
disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false,
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
toJSON(message) {
|
|
191
|
+
const obj = {};
|
|
192
|
+
if (message.threshold !== 0) {
|
|
193
|
+
obj.threshold = Math.round(message.threshold);
|
|
194
|
+
}
|
|
195
|
+
if (message.disable !== false) {
|
|
196
|
+
obj.disable = message.disable;
|
|
197
|
+
}
|
|
198
|
+
return obj;
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
exports.ArtifactVerificationOptions_ObserverTimestampOptions = {
|
|
202
|
+
fromJSON(object) {
|
|
203
|
+
return {
|
|
204
|
+
threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
205
|
+
disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false,
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
toJSON(message) {
|
|
209
|
+
const obj = {};
|
|
210
|
+
if (message.threshold !== 0) {
|
|
211
|
+
obj.threshold = Math.round(message.threshold);
|
|
212
|
+
}
|
|
213
|
+
if (message.disable !== false) {
|
|
214
|
+
obj.disable = message.disable;
|
|
215
|
+
}
|
|
216
|
+
return obj;
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
exports.Artifact = {
|
|
220
|
+
fromJSON(object) {
|
|
221
|
+
return {
|
|
222
|
+
data: isSet(object.artifactUri)
|
|
223
|
+
? { $case: "artifactUri", artifactUri: globalThis.String(object.artifactUri) }
|
|
224
|
+
: isSet(object.artifact)
|
|
225
|
+
? { $case: "artifact", artifact: Buffer.from(bytesFromBase64(object.artifact)) }
|
|
226
|
+
: isSet(object.artifactDigest)
|
|
227
|
+
? { $case: "artifactDigest", artifactDigest: sigstore_common_1.HashOutput.fromJSON(object.artifactDigest) }
|
|
228
|
+
: undefined,
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
toJSON(message) {
|
|
232
|
+
const obj = {};
|
|
233
|
+
if (message.data?.$case === "artifactUri") {
|
|
234
|
+
obj.artifactUri = message.data.artifactUri;
|
|
235
|
+
}
|
|
236
|
+
else if (message.data?.$case === "artifact") {
|
|
237
|
+
obj.artifact = base64FromBytes(message.data.artifact);
|
|
238
|
+
}
|
|
239
|
+
else if (message.data?.$case === "artifactDigest") {
|
|
240
|
+
obj.artifactDigest = sigstore_common_1.HashOutput.toJSON(message.data.artifactDigest);
|
|
241
|
+
}
|
|
242
|
+
return obj;
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
exports.Input = {
|
|
246
|
+
fromJSON(object) {
|
|
247
|
+
return {
|
|
248
|
+
artifactTrustRoot: isSet(object.artifactTrustRoot) ? sigstore_trustroot_1.TrustedRoot.fromJSON(object.artifactTrustRoot) : undefined,
|
|
249
|
+
artifactVerificationOptions: isSet(object.artifactVerificationOptions)
|
|
250
|
+
? exports.ArtifactVerificationOptions.fromJSON(object.artifactVerificationOptions)
|
|
251
|
+
: undefined,
|
|
252
|
+
bundle: isSet(object.bundle) ? sigstore_bundle_1.Bundle.fromJSON(object.bundle) : undefined,
|
|
253
|
+
artifact: isSet(object.artifact) ? exports.Artifact.fromJSON(object.artifact) : undefined,
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
toJSON(message) {
|
|
257
|
+
const obj = {};
|
|
258
|
+
if (message.artifactTrustRoot !== undefined) {
|
|
259
|
+
obj.artifactTrustRoot = sigstore_trustroot_1.TrustedRoot.toJSON(message.artifactTrustRoot);
|
|
260
|
+
}
|
|
261
|
+
if (message.artifactVerificationOptions !== undefined) {
|
|
262
|
+
obj.artifactVerificationOptions = exports.ArtifactVerificationOptions.toJSON(message.artifactVerificationOptions);
|
|
263
|
+
}
|
|
264
|
+
if (message.bundle !== undefined) {
|
|
265
|
+
obj.bundle = sigstore_bundle_1.Bundle.toJSON(message.bundle);
|
|
266
|
+
}
|
|
267
|
+
if (message.artifact !== undefined) {
|
|
268
|
+
obj.artifact = exports.Artifact.toJSON(message.artifact);
|
|
269
|
+
}
|
|
270
|
+
return obj;
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
function bytesFromBase64(b64) {
|
|
274
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
275
|
+
}
|
|
276
|
+
function base64FromBytes(arr) {
|
|
277
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
278
|
+
}
|
|
279
|
+
function isSet(value) {
|
|
280
|
+
return value !== null && value !== undefined;
|
|
281
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './__generated__/envelope';
|
|
2
|
+
export * from './__generated__/sigstore_bundle';
|
|
3
|
+
export * from './__generated__/sigstore_common';
|
|
4
|
+
export * from './__generated__/sigstore_rekor';
|
|
5
|
+
export * from './__generated__/sigstore_trustroot';
|
|
6
|
+
export * from './__generated__/sigstore_verification';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/*
|
|
18
|
+
Copyright 2023 The Sigstore Authors.
|
|
19
|
+
|
|
20
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
you may not use this file except in compliance with the License.
|
|
22
|
+
You may obtain a copy of the License at
|
|
23
|
+
|
|
24
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
|
|
26
|
+
Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
See the License for the specific language governing permissions and
|
|
30
|
+
limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
__exportStar(require("./__generated__/envelope"), exports);
|
|
33
|
+
__exportStar(require("./__generated__/sigstore_bundle"), exports);
|
|
34
|
+
__exportStar(require("./__generated__/sigstore_common"), exports);
|
|
35
|
+
__exportStar(require("./__generated__/sigstore_rekor"), exports);
|
|
36
|
+
__exportStar(require("./__generated__/sigstore_trustroot"), exports);
|
|
37
|
+
__exportStar(require("./__generated__/sigstore_verification"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/*
|
|
18
|
+
Copyright 2025 The Sigstore Authors.
|
|
19
|
+
|
|
20
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
you may not use this file except in compliance with the License.
|
|
22
|
+
You may obtain a copy of the License at
|
|
23
|
+
|
|
24
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
|
|
26
|
+
Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
See the License for the specific language governing permissions and
|
|
30
|
+
limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
__exportStar(require("../../__generated__/rekor/v2/dsse"), exports);
|
|
33
|
+
__exportStar(require("../../__generated__/rekor/v2/entry"), exports);
|
|
34
|
+
__exportStar(require("../../__generated__/rekor/v2/hashedrekord"), exports);
|
|
35
|
+
__exportStar(require("../../__generated__/rekor/v2/verifier"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sigstore/protobuf-specs",
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "code-signing for npm packages",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/index.js",
|
|
9
|
+
"./rekor/v2": "./dist/rekor/v2/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/sigstore/protobuf-specs.git"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"author": "bdehamer@github.com",
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/sigstore/protobuf-specs/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/sigstore/protobuf-specs#readme",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@tsconfig/node18": "^18.2.4",
|
|
29
|
+
"@types/node": "^18.14.0",
|
|
30
|
+
"typescript": "^5.7.2"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @sigstore/verify · [](https://www.npmjs.com/package/@sigstore/verify) [](https://github.com/sigstore/sigstore-js/actions/workflows/ci.yml) [](https://github.com/sigstore/sigstore-js/actions/workflows/smoke-test.yml)
|
|
2
|
+
|
|
3
|
+
A library for verifying [Sigstore][1] signatures.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js version ^20.17.0 || >=22.9.0
|
|
8
|
+
|
|
9
|
+
[1]: https://www.sigstore.dev
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { crypto } from '@sigstore/core';
|
|
2
|
+
import type { Envelope } from '@sigstore/bundle';
|
|
3
|
+
import type { SignatureContent } from '../shared.types';
|
|
4
|
+
export declare class DSSESignatureContent implements SignatureContent {
|
|
5
|
+
private readonly env;
|
|
6
|
+
constructor(env: Envelope);
|
|
7
|
+
compareDigest(digest: Buffer): boolean;
|
|
8
|
+
compareSignature(signature: Buffer): boolean;
|
|
9
|
+
verifySignature(key: crypto.KeyObject): boolean;
|
|
10
|
+
get signature(): Buffer;
|
|
11
|
+
private get preAuthEncoding();
|
|
12
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DSSESignatureContent = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2023 The Sigstore Authors.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
const core_1 = require("@sigstore/core");
|
|
20
|
+
class DSSESignatureContent {
|
|
21
|
+
env;
|
|
22
|
+
constructor(env) {
|
|
23
|
+
this.env = env;
|
|
24
|
+
}
|
|
25
|
+
compareDigest(digest) {
|
|
26
|
+
return core_1.crypto.bufferEqual(digest, core_1.crypto.digest('sha256', this.env.payload));
|
|
27
|
+
}
|
|
28
|
+
compareSignature(signature) {
|
|
29
|
+
return core_1.crypto.bufferEqual(signature, this.signature);
|
|
30
|
+
}
|
|
31
|
+
verifySignature(key) {
|
|
32
|
+
return core_1.crypto.verify(this.preAuthEncoding, key, this.signature);
|
|
33
|
+
}
|
|
34
|
+
get signature() {
|
|
35
|
+
return this.env.signatures.length > 0
|
|
36
|
+
? this.env.signatures[0].sig
|
|
37
|
+
: Buffer.from('');
|
|
38
|
+
}
|
|
39
|
+
// DSSE Pre-Authentication Encoding
|
|
40
|
+
get preAuthEncoding() {
|
|
41
|
+
return core_1.dsse.preAuthEncoding(this.env.payloadType, this.env.payload);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.DSSESignatureContent = DSSESignatureContent;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Bundle } from '@sigstore/bundle';
|
|
2
|
+
import type { SignatureContent, SignedEntity } from '../shared.types';
|
|
3
|
+
export declare function toSignedEntity(bundle: Bundle, artifact?: Buffer): SignedEntity;
|
|
4
|
+
export declare function signatureContent(bundle: Bundle, artifact?: Buffer): SignatureContent;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toSignedEntity = toSignedEntity;
|
|
4
|
+
exports.signatureContent = signatureContent;
|
|
5
|
+
const core_1 = require("@sigstore/core");
|
|
6
|
+
const dsse_1 = require("./dsse");
|
|
7
|
+
const message_1 = require("./message");
|
|
8
|
+
function toSignedEntity(bundle, artifact) {
|
|
9
|
+
const { tlogEntries, timestampVerificationData } = bundle.verificationMaterial;
|
|
10
|
+
const timestamps = [];
|
|
11
|
+
for (const entry of tlogEntries) {
|
|
12
|
+
if (entry.integratedTime && entry.integratedTime !== '0') {
|
|
13
|
+
timestamps.push({
|
|
14
|
+
$case: 'transparency-log',
|
|
15
|
+
tlogEntry: entry,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
for (const ts of timestampVerificationData?.rfc3161Timestamps ?? []) {
|
|
20
|
+
timestamps.push({
|
|
21
|
+
$case: 'timestamp-authority',
|
|
22
|
+
timestamp: core_1.RFC3161Timestamp.parse(Buffer.from(ts.signedTimestamp)),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
signature: signatureContent(bundle, artifact),
|
|
27
|
+
key: key(bundle),
|
|
28
|
+
tlogEntries,
|
|
29
|
+
timestamps,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function signatureContent(bundle, artifact) {
|
|
33
|
+
switch (bundle.content.$case) {
|
|
34
|
+
case 'dsseEnvelope':
|
|
35
|
+
return new dsse_1.DSSESignatureContent(bundle.content.dsseEnvelope);
|
|
36
|
+
case 'messageSignature':
|
|
37
|
+
return new message_1.MessageSignatureContent(bundle.content.messageSignature, artifact);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function key(bundle) {
|
|
41
|
+
switch (bundle.verificationMaterial.content.$case) {
|
|
42
|
+
case 'publicKey':
|
|
43
|
+
return {
|
|
44
|
+
$case: 'public-key',
|
|
45
|
+
hint: bundle.verificationMaterial.content.publicKey.hint,
|
|
46
|
+
};
|
|
47
|
+
case 'x509CertificateChain':
|
|
48
|
+
return {
|
|
49
|
+
$case: 'certificate',
|
|
50
|
+
certificate: core_1.X509Certificate.parse(Buffer.from(bundle.verificationMaterial.content.x509CertificateChain
|
|
51
|
+
.certificates[0].rawBytes)),
|
|
52
|
+
};
|
|
53
|
+
case 'certificate':
|
|
54
|
+
return {
|
|
55
|
+
$case: 'certificate',
|
|
56
|
+
certificate: core_1.X509Certificate.parse(Buffer.from(bundle.verificationMaterial.content.certificate.rawBytes)),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { crypto } from '@sigstore/core';
|
|
2
|
+
import type { MessageSignature } from '@sigstore/bundle';
|
|
3
|
+
import type { SignatureContent } from '../shared.types';
|
|
4
|
+
export declare class MessageSignatureContent implements SignatureContent {
|
|
5
|
+
readonly signature: Buffer;
|
|
6
|
+
private readonly messageDigest;
|
|
7
|
+
private readonly artifact;
|
|
8
|
+
private readonly hashAlgorithm;
|
|
9
|
+
constructor(messageSignature: MessageSignature, artifact: Buffer);
|
|
10
|
+
compareSignature(signature: Buffer): boolean;
|
|
11
|
+
compareDigest(digest: Buffer): boolean;
|
|
12
|
+
verifySignature(key: crypto.KeyObject): boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageSignatureContent = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2023 The Sigstore Authors.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
const core_1 = require("@sigstore/core");
|
|
20
|
+
const protobuf_specs_1 = require("@sigstore/protobuf-specs");
|
|
21
|
+
// Map from the Sigstore protobuf HashAlgorithm enum to
|
|
22
|
+
// the string values used by the Node.js crypto module.
|
|
23
|
+
const HASH_ALGORITHM_MAP = {
|
|
24
|
+
[protobuf_specs_1.HashAlgorithm.HASH_ALGORITHM_UNSPECIFIED]: 'sha256',
|
|
25
|
+
[protobuf_specs_1.HashAlgorithm.SHA2_256]: 'sha256',
|
|
26
|
+
[protobuf_specs_1.HashAlgorithm.SHA2_384]: 'sha384',
|
|
27
|
+
[protobuf_specs_1.HashAlgorithm.SHA2_512]: 'sha512',
|
|
28
|
+
[protobuf_specs_1.HashAlgorithm.SHA3_256]: 'sha3-256',
|
|
29
|
+
[protobuf_specs_1.HashAlgorithm.SHA3_384]: 'sha3-384',
|
|
30
|
+
};
|
|
31
|
+
class MessageSignatureContent {
|
|
32
|
+
signature;
|
|
33
|
+
messageDigest;
|
|
34
|
+
artifact;
|
|
35
|
+
hashAlgorithm;
|
|
36
|
+
constructor(messageSignature, artifact) {
|
|
37
|
+
this.signature = messageSignature.signature;
|
|
38
|
+
this.messageDigest = messageSignature.messageDigest.digest;
|
|
39
|
+
this.artifact = artifact;
|
|
40
|
+
this.hashAlgorithm =
|
|
41
|
+
HASH_ALGORITHM_MAP[messageSignature.messageDigest.algorithm] ??
|
|
42
|
+
/* istanbul ignore next */ 'sha256';
|
|
43
|
+
}
|
|
44
|
+
compareSignature(signature) {
|
|
45
|
+
return core_1.crypto.bufferEqual(signature, this.signature);
|
|
46
|
+
}
|
|
47
|
+
compareDigest(digest) {
|
|
48
|
+
return core_1.crypto.bufferEqual(digest, this.messageDigest);
|
|
49
|
+
}
|
|
50
|
+
verifySignature(key) {
|
|
51
|
+
return core_1.crypto.verify(this.artifact, key, this.signature, this.hashAlgorithm);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.MessageSignatureContent = MessageSignatureContent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare class BaseError<T extends string> extends Error {
|
|
2
|
+
code: T;
|
|
3
|
+
cause: any;
|
|
4
|
+
constructor({ code, message, cause, }: {
|
|
5
|
+
code: T;
|
|
6
|
+
message: string;
|
|
7
|
+
cause?: any;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
type VerificationErrorCode = 'NOT_IMPLEMENTED_ERROR' | 'TLOG_ERROR' | 'TLOG_INCLUSION_PROOF_ERROR' | 'TLOG_INCLUSION_PROMISE_ERROR' | 'TLOG_MISSING_INCLUSION_ERROR' | 'TLOG_BODY_ERROR' | 'CERTIFICATE_ERROR' | 'PUBLIC_KEY_ERROR' | 'SIGNATURE_ERROR' | 'TIMESTAMP_ERROR';
|
|
11
|
+
export declare class VerificationError extends BaseError<VerificationErrorCode> {
|
|
12
|
+
}
|
|
13
|
+
type PolicyErrorCode = 'UNTRUSTED_SIGNER_ERROR';
|
|
14
|
+
export declare class PolicyError extends BaseError<PolicyErrorCode> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyError = exports.VerificationError = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2023 The Sigstore Authors.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
class BaseError extends Error {
|
|
20
|
+
code;
|
|
21
|
+
cause; /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
22
|
+
constructor({ code, message, cause, }) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.code = code;
|
|
25
|
+
this.cause = cause;
|
|
26
|
+
this.name = this.constructor.name;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
class VerificationError extends BaseError {
|
|
30
|
+
}
|
|
31
|
+
exports.VerificationError = VerificationError;
|
|
32
|
+
class PolicyError extends BaseError {
|
|
33
|
+
}
|
|
34
|
+
exports.PolicyError = PolicyError;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { toSignedEntity } from './bundle';
|
|
2
|
+
export { PolicyError, VerificationError } from './error';
|
|
3
|
+
export { KeyFinderFunc, TrustMaterial, toTrustMaterial } from './trust';
|
|
4
|
+
export { Verifier, VerifierOptions } from './verifier';
|
|
5
|
+
export type { SignedEntity, Signer, VerificationPolicy } from './shared.types';
|
|
6
|
+
export type { ObjectIdentifierValuePair } from '@sigstore/protobuf-specs';
|