@@ -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 ( ) ,
@@ -28,14 +29,15 @@ const mockPushProcessors = {
2829 getDiff : sinon . stub ( ) ,
2930 checkSensitiveData : sinon . stub ( ) ,
3031 clearBareClone : sinon . stub ( ) ,
31- checkExifJpeg : sinon . stub ( ) ,
32+ checkEXIFJpeg : sinon . stub ( ) ,
3233 scanDiff : sinon . stub ( ) ,
3334 blockForAuth : sinon . stub ( ) ,
3435} ;
3536mockPushProcessors . 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' ;
@@ -113,6 +115,7 @@ describe('proxy chain', function () {
113115 mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
114116 mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
115117 mockPushProcessors . checkSensitiveData . resolves ( continuingAction ) ;
118+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
116119
117120 // this stops the chain from further execution
118121 mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => false , allowPush : false } ) ;
@@ -129,6 +132,7 @@ describe('proxy chain', function () {
129132 expect ( mockPushProcessors . audit . called ) . to . be . true ;
130133 expect ( mockPushProcessors . checkSensitiveData . called ) . to . be . false ;
131134 expect ( mockPushProcessors . checkEXIFJpeg . called ) . to . be . false ;
135+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
132136
133137 expect ( result . type ) . to . equal ( 'push' ) ;
134138 expect ( result . allowPush ) . to . be . false ;
@@ -140,12 +144,14 @@ describe('proxy chain', function () {
140144 const continuingAction = { type : 'push' , continue : ( ) => true , allowPush : false } ;
141145 mockPreProcessors . parseAction . resolves ( { type : 'push' } ) ;
142146 mockPushProcessors . parsePush . resolves ( continuingAction ) ;
147+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
143148 mockPushProcessors . checkRepoInAuthorisedList . resolves ( continuingAction ) ;
144149 mockPushProcessors . checkCommitMessages . resolves ( continuingAction ) ;
145150 mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
146151 mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
147152 mockPushProcessors . checkSensitiveData . resolves ( continuingAction ) ;
148153 mockPushProcessors . checkEXIFJpeg . resolves ( continuingAction ) ;
154+
149155 // this stops the chain from further execution
150156
151157 mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => true , allowPush : true } ) ;
@@ -162,6 +168,7 @@ describe('proxy chain', function () {
162168 expect ( mockPushProcessors . audit . called ) . to . be . true ;
163169 expect ( mockPushProcessors . checkSensitiveData . called ) . to . be . false ;
164170 expect ( mockPushProcessors . checkEXIFJpeg . called ) . to . be . false ;
171+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
165172
166173 expect ( result . type ) . to . equal ( 'push' ) ;
167174 expect ( result . allowPush ) . to . be . true ;
@@ -187,6 +194,7 @@ describe('proxy chain', function () {
187194 mockPushProcessors . blockForAuth . resolves ( continuingAction ) ;
188195 mockPushProcessors . checkSensitiveData . resolves ( continuingAction ) ;
189196
197+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
190198
191199 const result = await chain . executeChain ( req ) ;
192200
@@ -206,6 +214,7 @@ describe('proxy chain', function () {
206214 expect ( mockPushProcessors . blockForAuth . called ) . to . be . true ;
207215 expect ( mockPushProcessors . audit . called ) . to . be . true ;
208216 expect ( mockPushProcessors . checkSensitiveData . called ) . to . be . true ;
217+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
209218
210219 expect ( result . type ) . to . equal ( 'push' ) ;
211220 expect ( result . allowPush ) . to . be . false ;
0 commit comments