Skip to content

Commit c18a0ad

Browse files
committed
1 parent fd4153b commit c18a0ad

File tree

17 files changed

+147
-68
lines changed

17 files changed

+147
-68
lines changed

node_modules/@sigstore/bundle/dist/build.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const bundle_1 = require("./bundle");
2121
// Message signature bundle - $case: 'messageSignature'
2222
function toMessageSignatureBundle(options) {
2323
return {
24-
mediaType: bundle_1.BUNDLE_V02_MEDIA_TYPE,
24+
mediaType: options.singleCertificate
25+
? bundle_1.BUNDLE_V03_MEDIA_TYPE
26+
: bundle_1.BUNDLE_V02_MEDIA_TYPE,
2527
content: {
2628
$case: 'messageSignature',
2729
messageSignature: {
@@ -39,7 +41,9 @@ exports.toMessageSignatureBundle = toMessageSignatureBundle;
3941
// DSSE envelope bundle - $case: 'dsseEnvelope'
4042
function toDSSEBundle(options) {
4143
return {
42-
mediaType: bundle_1.BUNDLE_V02_MEDIA_TYPE,
44+
mediaType: options.singleCertificate
45+
? bundle_1.BUNDLE_V03_MEDIA_TYPE
46+
: bundle_1.BUNDLE_V02_MEDIA_TYPE,
4347
content: {
4448
$case: 'dsseEnvelope',
4549
dsseEnvelope: toEnvelope(options),
@@ -71,12 +75,20 @@ function toVerificationMaterial(options) {
7175
}
7276
function toKeyContent(options) {
7377
if (options.certificate) {
74-
return {
75-
$case: 'x509CertificateChain',
76-
x509CertificateChain: {
77-
certificates: [{ rawBytes: options.certificate }],
78-
},
79-
};
78+
if (options.singleCertificate) {
79+
return {
80+
$case: 'certificate',
81+
certificate: { rawBytes: options.certificate },
82+
};
83+
}
84+
else {
85+
return {
86+
$case: 'x509CertificateChain',
87+
x509CertificateChain: {
88+
certificates: [{ rawBytes: options.certificate }],
89+
},
90+
};
91+
}
8092
}
8193
else {
8294
return {

node_modules/@sigstore/bundle/dist/bundle.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.isBundleWithDsseEnvelope = exports.isBundleWithMessageSignature = exports.isBundleWithPublicKey = exports.isBundleWithCertificateChain = exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = void 0;
3+
exports.isBundleWithDsseEnvelope = exports.isBundleWithMessageSignature = exports.isBundleWithPublicKey = exports.isBundleWithCertificateChain = exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = void 0;
44
exports.BUNDLE_V01_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.1';
55
exports.BUNDLE_V02_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.2';
6-
exports.BUNDLE_V03_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.3';
6+
exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.3';
7+
exports.BUNDLE_V03_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle.v0.3+json';
78
// Type guards for bundle variants.
89
function isBundleWithCertificateChain(b) {
910
return b.verificationMaterial.content.$case === 'x509CertificateChain';

node_modules/@sigstore/bundle/dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.isBundleV01 = exports.assertBundleV02 = exports.assertBundleV01 = exports.assertBundleLatest = exports.assertBundle = exports.envelopeToJSON = exports.envelopeFromJSON = exports.bundleToJSON = exports.bundleFromJSON = exports.ValidationError = exports.isBundleWithPublicKey = exports.isBundleWithMessageSignature = exports.isBundleWithDsseEnvelope = exports.isBundleWithCertificateChain = exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = exports.toMessageSignatureBundle = exports.toDSSEBundle = void 0;
3+
exports.isBundleV01 = exports.assertBundleV02 = exports.assertBundleV01 = exports.assertBundleLatest = exports.assertBundle = exports.envelopeToJSON = exports.envelopeFromJSON = exports.bundleToJSON = exports.bundleFromJSON = exports.ValidationError = exports.isBundleWithPublicKey = exports.isBundleWithMessageSignature = exports.isBundleWithDsseEnvelope = exports.isBundleWithCertificateChain = exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = exports.toMessageSignatureBundle = exports.toDSSEBundle = void 0;
44
/*
55
Copyright 2023 The Sigstore Authors.
66
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "toMessageSignatureBundle", { enumerable: true, g
2222
var bundle_1 = require("./bundle");
2323
Object.defineProperty(exports, "BUNDLE_V01_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V01_MEDIA_TYPE; } });
2424
Object.defineProperty(exports, "BUNDLE_V02_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V02_MEDIA_TYPE; } });
25+
Object.defineProperty(exports, "BUNDLE_V03_LEGACY_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V03_LEGACY_MEDIA_TYPE; } });
2526
Object.defineProperty(exports, "BUNDLE_V03_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V03_MEDIA_TYPE; } });
2627
Object.defineProperty(exports, "isBundleWithCertificateChain", { enumerable: true, get: function () { return bundle_1.isBundleWithCertificateChain; } });
2728
Object.defineProperty(exports, "isBundleWithDsseEnvelope", { enumerable: true, get: function () { return bundle_1.isBundleWithDsseEnvelope; } });

node_modules/@sigstore/bundle/dist/validate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function validateBundleBase(b) {
7474
const invalidValues = [];
7575
// Media type validation
7676
if (b.mediaType === undefined ||
77-
!b.mediaType.startsWith('application/vnd.dev.sigstore.bundle+json;version=')) {
77+
(!b.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/) &&
78+
!b.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))) {
7879
invalidValues.push('mediaType');
7980
}
8081
// Content-related validation

node_modules/@sigstore/bundle/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sigstore/bundle",
3-
"version": "2.2.0",
3+
"version": "2.3.1",
44
"description": "Sigstore bundle type",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -27,7 +27,7 @@
2727
"provenance": true
2828
},
2929
"dependencies": {
30-
"@sigstore/protobuf-specs": "^0.3.0"
30+
"@sigstore/protobuf-specs": "^0.3.1"
3131
},
3232
"engines": {
3333
"node": "^16.14.0 || >=18.0.0"

node_modules/@sigstore/core/dist/crypto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ limitations under the License.
2121
*/
2222
const crypto_1 = __importDefault(require("crypto"));
2323
const SHA256_ALGORITHM = 'sha256';
24-
function createPublicKey(key) {
24+
function createPublicKey(key, type = 'spki') {
2525
if (typeof key === 'string') {
2626
return crypto_1.default.createPublicKey(key);
2727
}
2828
else {
29-
return crypto_1.default.createPublicKey({ key, format: 'der', type: 'spki' });
29+
return crypto_1.default.createPublicKey({ key, format: 'der', type: type });
3030
}
3131
}
3232
exports.createPublicKey = createPublicKey;

node_modules/@sigstore/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sigstore/core",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Base library for Sigstore",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_trustroot.js

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.TrustedRoot = exports.CertificateAuthority = exports.TransparencyLogInstance = void 0;
3+
exports.ClientTrustConfig = exports.SigningConfig = exports.TrustedRoot = exports.CertificateAuthority = exports.TransparencyLogInstance = void 0;
44
/* eslint-disable */
55
const sigstore_common_1 = require("./sigstore_common");
66
function createBaseTransparencyLogInstance() {
@@ -98,6 +98,58 @@ exports.TrustedRoot = {
9898
return obj;
9999
},
100100
};
101+
function createBaseSigningConfig() {
102+
return { caUrl: "", oidcUrl: "", tlogUrls: [], tsaUrls: [] };
103+
}
104+
exports.SigningConfig = {
105+
fromJSON(object) {
106+
return {
107+
caUrl: isSet(object.caUrl) ? String(object.caUrl) : "",
108+
oidcUrl: isSet(object.oidcUrl) ? String(object.oidcUrl) : "",
109+
tlogUrls: Array.isArray(object?.tlogUrls) ? object.tlogUrls.map((e) => String(e)) : [],
110+
tsaUrls: Array.isArray(object?.tsaUrls) ? object.tsaUrls.map((e) => String(e)) : [],
111+
};
112+
},
113+
toJSON(message) {
114+
const obj = {};
115+
message.caUrl !== undefined && (obj.caUrl = message.caUrl);
116+
message.oidcUrl !== undefined && (obj.oidcUrl = message.oidcUrl);
117+
if (message.tlogUrls) {
118+
obj.tlogUrls = message.tlogUrls.map((e) => e);
119+
}
120+
else {
121+
obj.tlogUrls = [];
122+
}
123+
if (message.tsaUrls) {
124+
obj.tsaUrls = message.tsaUrls.map((e) => e);
125+
}
126+
else {
127+
obj.tsaUrls = [];
128+
}
129+
return obj;
130+
},
131+
};
132+
function createBaseClientTrustConfig() {
133+
return { mediaType: "", trustedRoot: undefined, signingConfig: undefined };
134+
}
135+
exports.ClientTrustConfig = {
136+
fromJSON(object) {
137+
return {
138+
mediaType: isSet(object.mediaType) ? String(object.mediaType) : "",
139+
trustedRoot: isSet(object.trustedRoot) ? exports.TrustedRoot.fromJSON(object.trustedRoot) : undefined,
140+
signingConfig: isSet(object.signingConfig) ? exports.SigningConfig.fromJSON(object.signingConfig) : undefined,
141+
};
142+
},
143+
toJSON(message) {
144+
const obj = {};
145+
message.mediaType !== undefined && (obj.mediaType = message.mediaType);
146+
message.trustedRoot !== undefined &&
147+
(obj.trustedRoot = message.trustedRoot ? exports.TrustedRoot.toJSON(message.trustedRoot) : undefined);
148+
message.signingConfig !== undefined &&
149+
(obj.signingConfig = message.signingConfig ? exports.SigningConfig.toJSON(message.signingConfig) : undefined);
150+
return obj;
151+
},
152+
};
101153
function isSet(value) {
102154
return value !== null && value !== undefined;
103155
}

node_modules/@sigstore/protobuf-specs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sigstore/protobuf-specs",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "code-signing for npm packages",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -21,11 +21,11 @@
2121
},
2222
"homepage": "https://github.com/sigstore/protobuf-specs#readme",
2323
"devDependencies": {
24-
"@tsconfig/node14": "^1.0.3",
24+
"@tsconfig/node16": "^16.1.1",
2525
"@types/node": "^18.14.0",
2626
"typescript": "^4.9.5"
2727
},
2828
"engines": {
29-
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
29+
"node": "^16.14.0 || >=18.0.0"
3030
}
3131
}

node_modules/@sigstore/sign/dist/bundler/bundle.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function toMessageSignatureBundle(artifact, signature) {
5656
}
5757
exports.toMessageSignatureBundle = toMessageSignatureBundle;
5858
// DSSE envelope bundle - $case: 'dsseEnvelope'
59-
function toDSSEBundle(artifact, signature) {
59+
function toDSSEBundle(artifact, signature, singleCertificate) {
6060
return sigstore.toDSSEBundle({
6161
artifact: artifact.data,
6262
artifactType: artifact.type,
@@ -65,6 +65,7 @@ function toDSSEBundle(artifact, signature) {
6565
? util_1.pem.toDER(signature.key.certificate)
6666
: undefined,
6767
keyHint: signature.key.$case === 'publicKey' ? signature.key.hint : undefined,
68+
singleCertificate,
6869
});
6970
}
7071
exports.toDSSEBundle = toDSSEBundle;

0 commit comments

Comments
 (0)