@@ -33,6 +33,7 @@ const initMockPushProcessors = (sinon) => {
3333 gitleaks : sinon . stub ( ) ,
3434 clearBareClone : sinon . stub ( ) ,
3535 scanDiff : sinon . stub ( ) ,
36+ captureSSHKey : sinon . stub ( ) ,
3637 blockForAuth : sinon . stub ( ) ,
3738 } ;
3839 mockPushProcessors . parsePush . displayName = 'parsePush' ;
@@ -51,6 +52,7 @@ const initMockPushProcessors = (sinon) => {
5152 mockPushProcessors . gitleaks . displayName = 'gitleaks' ;
5253 mockPushProcessors . clearBareClone . displayName = 'clearBareClone' ;
5354 mockPushProcessors . scanDiff . displayName = 'scanDiff' ;
55+ mockPushProcessors . captureSSHKey . displayName = 'captureSSHKey' ;
5456 mockPushProcessors . blockForAuth . displayName = 'blockForAuth' ;
5557 return mockPushProcessors ;
5658} ;
@@ -219,11 +221,13 @@ describe('proxy chain', function () {
219221 mockPushProcessors . gitleaks . resolves ( continuingAction ) ;
220222 mockPushProcessors . clearBareClone . resolves ( continuingAction ) ;
221223 mockPushProcessors . scanDiff . resolves ( continuingAction ) ;
224+ mockPushProcessors . captureSSHKey . resolves ( continuingAction ) ;
222225 mockPushProcessors . blockForAuth . resolves ( continuingAction ) ;
223226
224227 const result = await chain . executeChain ( req ) ;
225228
226229 expect ( mockPreProcessors . parseAction . called ) . to . be . true ;
230+ console . log ( mockPushProcessors ) ;
227231 expect ( mockPushProcessors . parsePush . called ) . to . be . true ;
228232 expect ( mockPushProcessors . checkEmptyBranch . called ) . to . be . true ;
229233 expect ( mockPushProcessors . checkRepoInAuthorisedList . called ) . to . be . true ;
@@ -239,6 +243,7 @@ describe('proxy chain', function () {
239243 expect ( mockPushProcessors . gitleaks . called ) . to . be . true ;
240244 expect ( mockPushProcessors . clearBareClone . called ) . to . be . true ;
241245 expect ( mockPushProcessors . scanDiff . called ) . to . be . true ;
246+ expect ( mockPushProcessors . captureSSHKey . called ) . to . be . true ;
242247 expect ( mockPushProcessors . blockForAuth . called ) . to . be . true ;
243248 expect ( mockPushProcessors . audit . called ) . to . be . true ;
244249
@@ -320,6 +325,7 @@ describe('proxy chain', function () {
320325 mockPushProcessors . gitleaks . resolves ( action ) ;
321326 mockPushProcessors . clearBareClone . resolves ( action ) ;
322327 mockPushProcessors . scanDiff . resolves ( action ) ;
328+ mockPushProcessors . captureSSHKey . resolves ( action ) ;
323329 mockPushProcessors . blockForAuth . resolves ( action ) ;
324330 const dbStub = sinon . stub ( db , 'authorise' ) . resolves ( true ) ;
325331
@@ -368,6 +374,7 @@ describe('proxy chain', function () {
368374 mockPushProcessors . gitleaks . resolves ( action ) ;
369375 mockPushProcessors . clearBareClone . resolves ( action ) ;
370376 mockPushProcessors . scanDiff . resolves ( action ) ;
377+ mockPushProcessors . captureSSHKey . resolves ( action ) ;
371378 mockPushProcessors . blockForAuth . resolves ( action ) ;
372379
373380 const dbStub = sinon . stub ( db , 'reject' ) . resolves ( true ) ;
@@ -417,6 +424,7 @@ describe('proxy chain', function () {
417424 mockPushProcessors . gitleaks . resolves ( action ) ;
418425 mockPushProcessors . clearBareClone . resolves ( action ) ;
419426 mockPushProcessors . scanDiff . resolves ( action ) ;
427+ mockPushProcessors . captureSSHKey . resolves ( action ) ;
420428 mockPushProcessors . blockForAuth . resolves ( action ) ;
421429
422430 const error = new Error ( 'Database error' ) ;
@@ -465,6 +473,7 @@ describe('proxy chain', function () {
465473 mockPushProcessors . gitleaks . resolves ( action ) ;
466474 mockPushProcessors . clearBareClone . resolves ( action ) ;
467475 mockPushProcessors . scanDiff . resolves ( action ) ;
476+ mockPushProcessors . captureSSHKey . resolves ( action ) ;
468477 mockPushProcessors . blockForAuth . resolves ( action ) ;
469478
470479 const error = new Error ( 'Database error' ) ;
0 commit comments