@@ -20,6 +20,7 @@ const mockPushProcessors = {
2020 audit : sinon . stub ( ) ,
2121 checkRepoInAuthorisedList : sinon . stub ( ) ,
2222 checkCommitMessages : sinon . stub ( ) ,
23+ checkCryptoImplementation : sinon . stub ( ) ,
2324 checkAuthorEmails : sinon . stub ( ) ,
2425 checkUserPushPermission : sinon . stub ( ) ,
2526 checkIfWaitingAuth : sinon . stub ( ) ,
@@ -36,6 +37,7 @@ mockPushProcessors.parsePush.displayName = 'parsePush';
3637mockPushProcessors . audit . displayName = 'audit' ;
3738mockPushProcessors . checkRepoInAuthorisedList . displayName = 'checkRepoInAuthorisedList' ;
3839mockPushProcessors . checkCommitMessages . displayName = 'checkCommitMessages' ;
40+ mockPushProcessors . checkCryptoImplementation . displayName = 'checkCryptoImplementation' ;
3941mockPushProcessors . checkAuthorEmails . displayName = 'checkAuthorEmails' ;
4042mockPushProcessors . checkUserPushPermission . displayName = 'checkUserPushPermission' ;
4143mockPushProcessors . checkIfWaitingAuth . displayName = 'checkIfWaitingAuth' ;
@@ -110,6 +112,7 @@ describe('proxy chain', function () {
110112 mockPushProcessors . checkEXIFJpeg . resolves ( continuingAction ) ;
111113 mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
112114 mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
115+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
113116 mockPushProcessors . checkSensitiveData . resolves ( continuingAction ) ;
114117
115118 // this stops the chain from further execution
@@ -125,6 +128,7 @@ describe('proxy chain', function () {
125128 expect ( mockPushProcessors . checkIfWaitingAuth . called ) . to . be . true ;
126129 expect ( mockPushProcessors . pullRemote . called ) . to . be . false ;
127130 expect ( mockPushProcessors . audit . called ) . to . be . true ;
131+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
128132
129133 expect ( result . type ) . to . equal ( 'push' ) ;
130134 expect ( result . allowPush ) . to . be . false ;
@@ -136,10 +140,12 @@ describe('proxy chain', function () {
136140 const continuingAction = { type : 'push' , continue : ( ) => true , allowPush : false } ;
137141 mockPreProcessors . parseAction . resolves ( { type : 'push' } ) ;
138142 mockPushProcessors . parsePush . resolves ( continuingAction ) ;
143+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
139144 mockPushProcessors . checkRepoInAuthorisedList . resolves ( continuingAction ) ;
140145 mockPushProcessors . checkCommitMessages . resolves ( continuingAction ) ;
141146 mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
142147 mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
148+
143149 // this stops the chain from further execution
144150
145151 mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => true , allowPush : true } ) ;
@@ -154,6 +160,7 @@ describe('proxy chain', function () {
154160 expect ( mockPushProcessors . checkIfWaitingAuth . called ) . to . be . true ;
155161 expect ( mockPushProcessors . pullRemote . called ) . to . be . false ;
156162 expect ( mockPushProcessors . audit . called ) . to . be . true ;
163+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
157164
158165 expect ( result . type ) . to . equal ( 'push' ) ;
159166 expect ( result . allowPush ) . to . be . true ;
@@ -177,6 +184,7 @@ describe('proxy chain', function () {
177184 mockPushProcessors . clearBareClone . resolves ( continuingAction ) ;
178185 mockPushProcessors . scanDiff . resolves ( continuingAction ) ;
179186 mockPushProcessors . blockForAuth . resolves ( continuingAction ) ;
187+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
180188
181189 const result = await chain . executeChain ( req ) ;
182190
@@ -195,6 +203,7 @@ describe('proxy chain', function () {
195203 expect ( mockPushProcessors . scanDiff . called ) . to . be . true ;
196204 expect ( mockPushProcessors . blockForAuth . called ) . to . be . true ;
197205 expect ( mockPushProcessors . audit . called ) . to . be . true ;
206+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
198207 expect ( mockPushProcessors . checkSensitiveData . called ) . to . be . true ;
199208
200209 expect ( result . type ) . to . equal ( 'push' ) ;
0 commit comments