@@ -3,8 +3,11 @@ const csv = require('csv-parser');
33const XLSX = require ( 'xlsx' ) ;
44const path = require ( 'path' ) ;
55const Step = require ( '../../actions' ) . Step ;
6+ const config = require ( '../../../config' ) ;
7+
68// const { exec: getDiffExec } = require('./getDiff');
79// Function to check for sensitive data patterns
10+ const commitConfig = config . getCommitConfig ( ) ;
811const checkForSensitiveData = ( cell ) => {
912 const sensitivePatterns = [
1013 / \d { 3 } - \d { 2 } - \d { 4 } / , // Social Security Number (SSN)
@@ -83,7 +86,7 @@ const checkLogJsonFiles = async (filePath) => {
8386 return reject ( err ) ;
8487 }
8588 if ( checkForSensitiveData ( data ) ) {
86- console . log ( `\x1b[33mSensitive data found in ${ filePath } \x1b[0m` ) ;
89+ console . log ( `\x1b[Sensitive data found in ${ filePath } \x1b[0m` ) ;
8790 sensitiveDataFound = true ;
8891 }
8992 resolve ( sensitiveDataFound ) ;
@@ -92,7 +95,14 @@ const checkLogJsonFiles = async (filePath) => {
9295} ;
9396// Function to parse the file based on its extension
9497const parseFile = async ( filePath ) => {
98+
9599 const ext = path . extname ( filePath ) . toLowerCase ( ) ;
100+ const FilestoCheck = commitConfig . diff . block . proxyFileTypes ;
101+ if ( ! FilestoCheck . includes ( ext ) ) {
102+
103+ console . log ( `${ ext } should be included in CommitConfig for proxy Check!` ) ;
104+ return false ;
105+ }
96106
97107 switch ( ext ) {
98108 case '.csv' :
0 commit comments