From 112b56e96ce67eca1380160020e39d9da3d14fde Mon Sep 17 00:00:00 2001 From: eddiechayes Date: Thu, 28 Sep 2023 18:19:28 -0700 Subject: [PATCH] please work --- .../konfig-dash/bash-scripts/guard-api-key-leak.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/konfig-dash/bash-scripts/guard-api-key-leak.sh b/generator/konfig-dash/bash-scripts/guard-api-key-leak.sh index 685e5015c..b0cf1b271 100755 --- a/generator/konfig-dash/bash-scripts/guard-api-key-leak.sh +++ b/generator/konfig-dash/bash-scripts/guard-api-key-leak.sh @@ -11,23 +11,23 @@ foundKey=false # Files that are allowed to contain the api key whitelist=( - "../../../generator/konfig-dash/api/src/lib/api-keys.ts" - "../../../generator/konfig-dash/.redwood/prebuild/api/src/lib/api-keys.js" "../../../generator/konfig-dash/api/dist/lib/api-keys.js" + "../../../generator/konfig-dash/.redwood/prebuild/api/src/lib/api-keys.js" + "../../../generator/konfig-dash/api/src/lib/api-keys.ts" "../../../generator/konfig-dash/api/dist/lib/api-keys.js.map" ) for apiKey in "${apiKeys[@]}"; do - files=$(grep -rl "$apiKey" "$searchFolder" | grep -vE "${whitelist[@]}") + files=$(grep -rl "$apiKey" "$searchFolder" | grep -vE "$(printf "%s\n" "${whitelist[@]}")") if [ -n "$files" ]; then foundKey=true - echo "ERROR: Security risk detected. API key leaked in the following file(s):" + echo "ERROR: Security risk detected. API key leaked in the following files:" echo "$files" echo fi done -if [ "$foundKey" ]; then +if [ "$foundKey" = true ]; then exit 1 fi echo No api key leaks detected.