File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed
node_modules/@sigstore/sign Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,16 @@ const core_1 = require("@sigstore/core");
2020function 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}
Original file line number Diff line number Diff line change 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" ,
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 },
Original file line number Diff line number Diff line change 20742074 }
20752075 },
20762076 "node_modules/@sigstore/sign" : {
2077- "version" : " 4.0.0" ,
2077+ "version" : " 4.0.1" ,
2078+ "resolved" : " https://registry.npmjs.org/@sigstore/sign/-/sign-4.0.1.tgz" ,
2079+ "integrity" : " sha512-KFNGy01gx9Y3IBPG/CergxR9RZpN43N+lt3EozEfeoyqm8vEiLxwRl3ZO5sPx3Obv1ix/p7FWOlPc2Jgwfp9PA==" ,
20782080 "inBundle" : true ,
20792081 "license" : " Apache-2.0" ,
20802082 "dependencies" : {
20812083 "@sigstore/bundle" : " ^4.0.0" ,
20822084 "@sigstore/core" : " ^3.0.0" ,
20832085 "@sigstore/protobuf-specs" : " ^0.5.0" ,
2084- "make-fetch-happen" : " ^15.0.0 " ,
2086+ "make-fetch-happen" : " ^15.0.2 " ,
20852087 "proc-log" : " ^5.0.0" ,
20862088 "promise-retry" : " ^2.0.1"
20872089 },
You can’t perform that action at this time.
0 commit comments