File tree Expand file tree Collapse file tree 4 files changed +222
-42
lines changed
node_modules/@sigstore/sign
workspaces/libnpmpublish/test Expand file tree Collapse file tree 4 files changed +222
-42
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 },
You can’t perform that action at this time.
0 commit comments