Skip to content

Commit b05461b

Browse files
authored
deps: @sigstore/sign@4.0.1 (#8663)
1 parent c31de22 commit b05461b

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

mock-registry/lib/provenance.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const sigstoreIdToken = () => {
55
return `.${Buffer.from(JSON.stringify({
66
iss: 'https://oauth2.sigstore.dev/auth',
77
email: 'foo@bar.com',
8+
email_verified: true,
89
}))
910
.toString('base64')}.`
1011
}

node_modules/@sigstore/sign/dist/util/oidc.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ const core_1 = require("@sigstore/core");
2020
function extractJWTSubject(jwt) {
2121
const parts = jwt.split('.', 3);
2222
const payload = JSON.parse(core_1.encoding.base64Decode(parts[1]));
23-
switch (payload.iss) {
24-
case 'https://accounts.google.com':
25-
case 'https://oauth2.sigstore.dev/auth':
26-
return payload.email;
27-
default:
28-
return payload.sub;
23+
if (payload.email) {
24+
if (!payload.email_verified) {
25+
throw new Error('JWT email not verified by issuer');
26+
}
27+
return payload.email;
28+
}
29+
if (payload.sub) {
30+
return payload.sub;
31+
}
32+
else {
33+
throw new Error('JWT subject not found');
2934
}
3035
}

node_modules/@sigstore/sign/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sigstore/sign",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Sigstore signing library",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
3636
"@sigstore/bundle": "^4.0.0",
3737
"@sigstore/core": "^3.0.0",
3838
"@sigstore/protobuf-specs": "^0.5.0",
39-
"make-fetch-happen": "^15.0.0",
39+
"make-fetch-happen": "^15.0.2",
4040
"proc-log": "^5.0.0",
4141
"promise-retry": "^2.0.1"
4242
},

package-lock.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,14 +2014,16 @@
20142014
}
20152015
},
20162016
"node_modules/@sigstore/sign": {
2017-
"version": "4.0.0",
2017+
"version": "4.0.1",
2018+
"resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-4.0.1.tgz",
2019+
"integrity": "sha512-KFNGy01gx9Y3IBPG/CergxR9RZpN43N+lt3EozEfeoyqm8vEiLxwRl3ZO5sPx3Obv1ix/p7FWOlPc2Jgwfp9PA==",
20182020
"inBundle": true,
20192021
"license": "Apache-2.0",
20202022
"dependencies": {
20212023
"@sigstore/bundle": "^4.0.0",
20222024
"@sigstore/core": "^3.0.0",
20232025
"@sigstore/protobuf-specs": "^0.5.0",
2024-
"make-fetch-happen": "^15.0.0",
2026+
"make-fetch-happen": "^15.0.2",
20252027
"proc-log": "^5.0.0",
20262028
"promise-retry": "^2.0.1"
20272029
},

workspaces/libnpmpublish/test/publish.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ t.test('publish existing package with provenance in gha', async t => {
403403
const oidcClaims = {
404404
iss: 'https://oauth2.sigstore.dev/auth',
405405
email: 'foo@bar.com',
406+
email_verified: true,
406407
}
407408
const idToken = `.${Buffer.from(JSON.stringify(oidcClaims)).toString('base64')}.`
408409

@@ -911,6 +912,7 @@ t.test('publish existing package with provenance in gitlab', async t => {
911912
const oidcClaims = {
912913
iss: 'https://oauth2.sigstore.dev/auth',
913914
email: 'foo@bar.com',
915+
email_verified: true,
914916
}
915917
const idToken = `.${Buffer.from(JSON.stringify(oidcClaims)).toString('base64')}.`
916918

0 commit comments

Comments
 (0)