@@ -21,6 +21,7 @@ const mockPushProcessors = {
2121 audit : sinon . stub ( ) ,
2222 checkRepoInAuthorisedList : sinon . stub ( ) ,
2323 checkCommitMessages : sinon . stub ( ) ,
24+ checkCryptoImplementation : sinon . stub ( ) ,
2425 checkAuthorEmails : sinon . stub ( ) ,
2526 checkUserPushPermission : sinon . stub ( ) ,
2627 checkIfWaitingAuth : sinon . stub ( ) ,
@@ -37,6 +38,7 @@ mockPushProcessors.parsePush.displayName = 'parsePush';
3738mockPushProcessors . audit . displayName = 'audit' ;
3839mockPushProcessors . checkRepoInAuthorisedList . displayName = 'checkRepoInAuthorisedList' ;
3940mockPushProcessors . checkCommitMessages . displayName = 'checkCommitMessages' ;
41+ mockPushProcessors . checkCryptoImplementation . displayName = 'checkCryptoImplementation' ;
4042mockPushProcessors . checkAuthorEmails . displayName = 'checkAuthorEmails' ;
4143mockPushProcessors . checkUserPushPermission . displayName = 'checkUserPushPermission' ;
4244mockPushProcessors . checkIfWaitingAuth . displayName = 'checkIfWaitingAuth' ;
@@ -112,6 +114,7 @@ describe('proxy chain', function () {
112114 mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
113115 mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
114116 mockPushProcessors . checkSensitiveData . resolves ( continuingAction ) ;
117+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
115118
116119 // this stops the chain from further execution
117120 mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => false , allowPush : false } ) ;
@@ -126,6 +129,7 @@ describe('proxy chain', function () {
126129 expect ( mockPushProcessors . checkIfWaitingAuth . called ) . to . be . true ;
127130 expect ( mockPushProcessors . pullRemote . called ) . to . be . false ;
128131 expect ( mockPushProcessors . audit . called ) . to . be . true ;
132+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
129133
130134 expect ( result . type ) . to . equal ( 'push' ) ;
131135 expect ( result . allowPush ) . to . be . false ;
@@ -137,10 +141,12 @@ describe('proxy chain', function () {
137141 const continuingAction = { type : 'push' , continue : ( ) => true , allowPush : false } ;
138142 mockPreProcessors . parseAction . resolves ( { type : 'push' } ) ;
139143 mockPushProcessors . parsePush . resolves ( continuingAction ) ;
144+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
140145 mockPushProcessors . checkRepoInAuthorisedList . resolves ( continuingAction ) ;
141146 mockPushProcessors . checkCommitMessages . resolves ( continuingAction ) ;
142147 mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
143148 mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
149+
144150 // this stops the chain from further execution
145151
146152 mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => true , allowPush : true } ) ;
@@ -155,6 +161,7 @@ describe('proxy chain', function () {
155161 expect ( mockPushProcessors . checkIfWaitingAuth . called ) . to . be . true ;
156162 expect ( mockPushProcessors . pullRemote . called ) . to . be . false ;
157163 expect ( mockPushProcessors . audit . called ) . to . be . true ;
164+ expect ( mockPushProcessors . checkCryptoImplementation . called ) . to . be . true ;
158165
159166 expect ( result . type ) . to . equal ( 'push' ) ;
160167 expect ( result . allowPush ) . to . be . true ;
@@ -178,6 +185,7 @@ describe('proxy chain', function () {
178185 mockPushProcessors . clearBareClone . resolves ( continuingAction ) ;
179186 mockPushProcessors . scanDiff . resolves ( continuingAction ) ;
180187 mockPushProcessors . blockForAuth . resolves ( continuingAction ) ;
188+ mockPushProcessors . checkCryptoImplementation . resolves ( continuingAction ) ;
181189
182190 const result = await chain . executeChain ( req ) ;
183191
@@ -196,7 +204,6 @@ describe('proxy chain', function () {
196204 expect ( mockPushProcessors . scanDiff . called ) . to . be . true ;
197205 expect ( mockPushProcessors . blockForAuth . called ) . to . be . true ;
198206 expect ( mockPushProcessors . audit . called ) . to . be . true ;
199- expect ( mockPushProcessors . checkSensitiveData . called ) . to . be . true ;
200207
201208 expect ( result . type ) . to . equal ( 'push' ) ;
202209 expect ( result . allowPush ) . to . be . false ;
0 commit comments