@@ -81,14 +81,14 @@ jobs:
8181 fi
8282
8383 binding_details=$(cf curl "/v3/service_credential_bindings/${binding_guid}/details")
84-
84+
8585 clientSecret=$(echo "$binding_details" | jq -r '.credentials.clientsecret')
8686 if [ -z "$clientSecret" ] || [ "$clientSecret" == "null" ]; then
8787 echo -e "\033[31m❌ Error: clientSecret is not set or is null\033[0m"
8888 exit 1
8989 fi
9090 escapedClientSecret=$(echo "$clientSecret" | sed 's/\$/\\$/g')
91-
91+
9292 clientID=$(echo "$binding_details" | jq -r '.credentials.clientid')
9393 if [ -z "$clientID" ] || [ "$clientID" == "null" ]; then
9494 echo -e "\033[31m❌ Error: clientID is not set or is null\033[0m"
9898 echo "::set-output name=CLIENT_SECRET::$escapedClientSecret"
9999 echo "::set-output name=CLIENT_ID::$clientID"
100100 echo -e "\033[32m✔️ Client Details fetched successfully!\033[0m"
101+ echo -e "\033[34mClientID: ${clientID:0:3}****${clientID: -3}\033[0m"
102+ echo -e "\033[34mClientSecret: ${clientSecret:0:3}****${clientSecret: -3}\033[0m"
101103
102104 - name : Fetch and Escape Client Details for multi tenant
103105 id : fetch_credentials_mt
@@ -117,14 +119,14 @@ jobs:
117119 fi
118120
119121 binding_details=$(cf curl "/v3/service_credential_bindings/${binding_guid}/details")
120-
122+
121123 clientSecret_mt=$(echo "$binding_details" | jq -r '.credentials.clientsecret')
122124 if [ -z "$clientSecret_mt" ] || [ "$clientSecret_mt" == "null" ]; then
123125 echo -e "\033[31m❌ Error: clientSecret_mt is not set or is null\033[0m"
124126 exit 1
125127 fi
126128 escapedClientSecret_mt=$(echo "$clientSecret_mt" | sed 's/\$/\\$/g')
127-
129+
128130 clientID_mt=$(echo "$binding_details" | jq -r '.credentials.clientid')
129131 if [ -z "$clientID_mt" ] || [ "$clientID_mt" == "null" ]; then
130132 echo -e "\033[31m❌ Error: clientID_mt is not set or is null\033[0m"
@@ -134,6 +136,8 @@ jobs:
134136 echo "::set-output name=CLIENT_SECRET_MT::$escapedClientSecret_mt"
135137 echo "::set-output name=CLIENT_ID_MT::$clientID_mt"
136138 echo -e "\033[32m✔️ Multi Tenant Client Details fetched successfully!\033[0m"
139+ echo -e "\033[34mClientID_MT: ${clientID_mt:0:3}****${clientID_mt: -3}\033[0m"
140+ echo -e "\033[34mClientSecret_MT: ${clientSecret_mt:0:3}****${clientSecret_mt: -3}\033[0m"
137141
138142 - name : Run integration tests
139143 env :
@@ -150,17 +154,17 @@ jobs:
150154 authUrl="${{ secrets.CAPAUTH_URL }}"
151155 authUrlMT1="${{ secrets.AUTHURLMT1 }}"
152156 authUrlMT2="${{ secrets.AUTHURLMT2 }}"
153- clientID="<hidden> "
154- clientSecret="<hidden> "
155- clientIDMT="<hidden> "
156- clientSecretMT="<hidden> "
157+ clientID="${{ env.CLIENT_ID }} "
158+ clientSecret="${{ env.CLIENT_SECRET }} "
159+ clientIDMT="${{ env.CLIENT_ID_MT }} "
160+ clientSecretMT="${{ env.CLIENT_SECRET_MT }} "
157161 username="${{ secrets.CF_USER }}"
158- password="<hidden> "
162+ password="${{ secrets.CF_PASSWORD }} "
159163 noSDMRoleUsername="${{ secrets.NOSDMROLEUSERNAME }}"
160- noSDMRoleUserPassword="<hidden> "
164+ noSDMRoleUserPassword="${{ secrets.NOSDMROLEUSERPASSWORD }} "
161165
162166 # Check if variables are set before using them
163- for var in appUrl appUrlMT authUrl authUrlMT1 authUrlMT2 username password noSDMRoleUsername noSDMRoleUserPassword; do
167+ for var in appUrl appUrlMT authUrl authUrlMT1 authUrlMT2 clientID clientSecret clientIDMT clientSecretMT username password noSDMRoleUsername noSDMRoleUserPassword; do
164168 if [ -z "${!var}" ]; then
165169 echo -e "\033[31m❌ Error: ${var} is not set\033[0m"
166170 exit 1
@@ -184,15 +188,14 @@ jobs:
184188 EOL
185189
186190 # Display properties file without sensitive information
187- echo -e "\033[34m📜 Properties File:\033[0m"
188- cat "$PROPERTIES_FILE" | grep -v -e "clientID=" -e "clientSecret=" -e "password=" -e "clientIDMT=" -e "clientSecretMT=" -e "noSDMRoleUserPassword="
189-
190- # Run Maven integration tests
191+ echo -e "\033[34m📜 Properties File (Masked):\033[0m"
192+ cat "$PROPERTIES_FILE" | sed -e 's/=\w\+/=****/g' -e 's/=/=/'
191193
194+ # Run Maven integration tests
192195 echo -e "\033[34m🧪 Running Maven tests for Multi Tenancy...\033[0m"
193196 mvn clean verify -P integration-tests -DtokenFlow=namedUser -DtenancyModel=multi -Dtenant=TENANT1 -DskipUnitTests || { echo -e "\033[31m❌ Maven tests failed for Named User Flow (Multi Tenancy, Tenant 1)\033[0m"; exit 1; }
197+ # Uncomment these lines when needed for additional tests
194198 # mvn clean verify -P integration-tests -DtokenFlow=technicalUser -DtenancyModel=multi -Dtenant=TENANT1 -DskipUnitTests || { echo -e "\033[31m❌ Maven tests failed for Technical User Flow (Multi Tenancy, Tenant 1)\033[0m"; exit 1; }
195199 # mvn clean verify -P integration-tests -DtokenFlow=namedUser -DtenancyModel=multi -Dtenant=TENANT2 -DskipUnitTests || { echo -e "\033[31m❌ Maven tests failed for Named User Flow (Multi Tenancy, Tenant 2)\033[0m"; exit 1; }
196200 # mvn clean verify -P integration-tests -DtokenFlow=technicalUser -DtenancyModel=multi -Dtenant=TENANT2 -DskipUnitTests || { echo -e "\033[31m❌ Maven tests failed for Technical User Flow (Multi Tenancy, Tenant 2)\033[0m"; exit 1; }
197-
198201 echo -e "\033[32m✔️ Integration tests completed successfully!\033[0m"
0 commit comments