@@ -62,6 +62,19 @@ function printUsage() {
62
62
sigstore help print help information
63
63
` ) ;
64
64
}
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
65
78
const signOptions = {
66
79
oidcClientID : 'sigstore' ,
67
80
oidcIssuer : 'https://oauth2.sigstore.dev/auth' ,
@@ -71,15 +84,13 @@ const signOptions = {
71
84
async function sign ( artifactPath ) {
72
85
const buffer = fs_1 . default . readFileSync ( artifactPath ) ;
73
86
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 ) ;
78
88
console . log ( JSON . stringify ( bundle ) ) ;
79
89
}
80
90
async function attest ( artifactPath , payloadType = INTOTO_PAYLOAD_TYPE ) {
81
91
const buffer = fs_1 . default . readFileSync ( artifactPath ) ;
82
92
const bundle = await index_1 . sigstore . attest ( buffer , payloadType , signOptions ) ;
93
+ printRekorEntry ( bundle , signOptions ) ;
83
94
console . log ( JSON . stringify ( bundle ) ) ;
84
95
}
85
96
async function verify ( bundlePath , artifactPath ) {
0 commit comments