@@ -668,7 +668,13 @@ t.test('publish existing package with provenance in gha', async t => {
668668 const fulcioURL = 'https://mock.fulcio'
669669 const leafCertificate = `-----BEGIN CERTIFICATE-----\nabc\n-----END CERTIFICATE-----\n`
670670 const rootCertificate = `-----BEGIN CERTIFICATE-----\nxyz\n-----END CERTIFICATE-----\n`
671- const certificate = [ leafCertificate , rootCertificate ] . join ( )
671+ const certificateResponse = {
672+ signedCertificateEmbeddedSct : {
673+ chain : {
674+ certificates : [ leafCertificate , rootCertificate ] ,
675+ } ,
676+ } ,
677+ }
672678
673679 // Data for mocking Rekor upload
674680 const rekorURL = 'https://mock.rekor'
@@ -749,14 +755,18 @@ t.test('publish existing package with provenance in gha', async t => {
749755 } ) . reply ( 200 , { value : idToken } )
750756
751757 const fulcioSrv = MockRegistry . tnock ( t , fulcioURL )
752- fulcioSrv . matchHeader ( 'Accept' , 'application/pem-certificate-chain' )
753- . matchHeader ( 'Content-Type' , 'application/json' )
754- . matchHeader ( 'Authorization' , `Bearer ${ idToken } ` )
755- . post ( '/api/v1/signingCert' , {
756- publicKey : { content : / .+ / i } ,
757- signedEmailAddress : / .+ / i,
758+ fulcioSrv . matchHeader ( 'Content-Type' , 'application/json' )
759+ . post ( '/api/v2/signingCert' , {
760+ credentials : { oidcIdentityToken : idToken } ,
761+ publicKeyRequest : {
762+ publicKey : {
763+ algorithm : 'ECDSA' ,
764+ content : / .+ / i,
765+ } ,
766+ proofOfPossession : / .+ / i,
767+ } ,
758768 } )
759- . reply ( 200 , certificate )
769+ . reply ( 200 , certificateResponse )
760770
761771 const rekorSrv = MockRegistry . tnock ( t , rekorURL )
762772 rekorSrv
0 commit comments