@@ -86,15 +86,17 @@ jobs:
8686 echo -e "\033[31m❌ Error: clientSecret is not set or is null\033[0m"
8787 exit 1
8888 fi
89- maskedClientSecret="****$(echo "$clientSecret" | sed 's/.*\(....\)$/\1/')"
90-
89+
9190 clientID=$(echo "$binding_details" | jq -r '.credentials.clientid')
9291 if [ -z "$clientID" ] || [ "$clientID" == "null" ]; then
9392 echo -e "\033[31m❌ Error: clientID is not set or is null\033[0m"
9493 exit 1
9594 fi
96- maskedClientID="****$(echo "$clientID" | sed 's/.*\(....\)$/\1/')"
97-
95+
96+ # Mask values by showing only the last 4 characters
97+ maskedClientSecret="****${clientSecret: -4}"
98+ maskedClientID="****${clientID: -4}"
99+
98100 echo "::set-output name=CLIENT_SECRET::$maskedClientSecret"
99101 echo "::set-output name=CLIENT_ID::$maskedClientID"
100102 echo -e "\033[32m✔️ Client Details fetched and masked successfully!\033[0m"
@@ -123,14 +125,16 @@ jobs:
123125 echo -e "\033[31m❌ Error: clientSecret_mt is not set or is null\033[0m"
124126 exit 1
125127 fi
126- maskedClientSecretMT="****$(echo "$clientSecret_mt" | sed 's/.*\(....\)$/\1/')"
127128
128129 clientID_mt=$(echo "$binding_details" | jq -r '.credentials.clientid')
129130 if [ -z "$clientID_mt" ] || [ "$clientID_mt" == "null" ]; then
130131 echo -e "\033[31m❌ Error: clientID_mt is not set or is null\033[0m"
131132 exit 1
132133 fi
133- maskedClientIDMT="****$(echo "$clientID_mt" | sed 's/.*\(....\)$/\1/')"
134+
135+ # Mask values by showing only the last 4 characters
136+ maskedClientSecretMT="****${clientSecret_mt: -4}"
137+ maskedClientIDMT="****${clientID_mt: -4}"
134138
135139 echo "::set-output name=CLIENT_SECRET_MT::$maskedClientSecretMT"
136140 echo "::set-output name=CLIENT_ID_MT::$maskedClientIDMT"
@@ -160,8 +164,10 @@ jobs:
160164 clientID="${{ env.CLIENT_ID }}"
161165 clientSecret="${{ env.CLIENT_SECRET }}"
162166 clientIDMT="${{ env.CLIENT_ID_MT }}"
163- clientSecretMT="${{ env.CLIENT_SECRET_MT }}
167+ clientSecretMT="${{ env.CLIENT_SECRET_MT }}"
164168
169+ # No need for further masking because it's handled during fetching
170+
165171 cat > "$PROPERTIES_FILE" <<EOL
166172 appUrl=$appUrl
167173 appUrlMT=$appUrlMT
@@ -173,14 +179,14 @@ jobs:
173179 clientIDMT=$clientIDMT
174180 clientSecretMT=$clientSecretMT
175181 username=$username
176- password=$password
182+ password="*******"
177183 noSDMRoleUsername=$noSDMRoleUsername
178- noSDMRoleUserPassword=$noSDMRoleUserPassword
184+ noSDMRoleUserPassword="*******"
179185 EOL
180186
181- # # Display properties file with already masked sensitive information
182- # echo -e "\033[34m📜 Properties File:\033[0m"
183- # cat "$PROPERTIES_FILE"
187+ # Display properties file with masked sensitive information
188+ echo -e "\033[34m📜 Properties File:\033[0m"
189+ cat "$PROPERTIES_FILE"
184190
185191 echo -e "\033[34m🧪 Running Maven tests for Multi Tenancy...\033[0m"
186192 mvn clean verify -P integration-tests -DtokenFlow=namedUser -DtenancyModel=multi -Dtenant=TENANT1 -DskipUnitTests > /dev/null || { echo -e "\033[31m❌ Maven tests failed for Named User Flow (Multi Tenancy, Tenant 1)\033[0m"; exit 1; }
0 commit comments