@@ -62,6 +62,19 @@ function printUsage() {
6262 sigstore help print help information
6363 ` ) ;
6464}
65+ function printRekorEntry ( bundle , options ) {
66+ let url ;
67+ if ( options . rekorURL === index_1 . sigstore . DEFAULT_REKOR_URL ) {
68+ url = `https://search.sigstore.dev` ;
69+ }
70+ else {
71+ url = `${ options . rekorURL } /api/v1/log/entries` ;
72+ }
73+ const logIndex = bundle . verificationMaterial ?. tlogEntries [ 0 ] . logIndex ;
74+ console . error ( `Created entry at index ${ logIndex } , available at` ) ;
75+ console . error ( `${ url } ?logIndex=${ logIndex } ` ) ;
76+ }
77+ // TODO: Allow customing these options
6578const signOptions = {
6679 oidcClientID : 'sigstore' ,
6780 oidcIssuer : 'https://oauth2.sigstore.dev/auth' ,
@@ -71,15 +84,13 @@ const signOptions = {
7184async function sign ( artifactPath ) {
7285 const buffer = fs_1 . default . readFileSync ( artifactPath ) ;
7386 const bundle = await index_1 . sigstore . sign ( buffer , signOptions ) ;
74- const url = `${ signOptions . rekorURL } /api/v1/log/entries` ;
75- const logIndex = bundle . verificationMaterial ?. tlogEntries [ 0 ] . logIndex ;
76- console . error ( `Created entry at index ${ logIndex } , available at` ) ;
77- console . error ( `${ url } ?logIndex=${ logIndex } ` ) ;
87+ printRekorEntry ( bundle , signOptions ) ;
7888 console . log ( JSON . stringify ( bundle ) ) ;
7989}
8090async function attest ( artifactPath , payloadType = INTOTO_PAYLOAD_TYPE ) {
8191 const buffer = fs_1 . default . readFileSync ( artifactPath ) ;
8292 const bundle = await index_1 . sigstore . attest ( buffer , payloadType , signOptions ) ;
93+ printRekorEntry ( bundle , signOptions ) ;
8394 console . log ( JSON . stringify ( bundle ) ) ;
8495}
8596async function verify ( bundlePath , artifactPath ) {
0 commit comments