File tree Expand file tree Collapse file tree
packages/b2c-cli/test/functional Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8181 SFCC_SHORTCODE : ${{ vars.SFCC_SHORTCODE }}
8282 TEST_REALM : ${{ vars.TEST_REALM }}
8383 SFCC_EXTRA_HEADERS : ${{ secrets.SFCC_EXTRA_HEADERS }}
84+ CURL_EXTRA_HEADERS : ${{ secrets.CURL_EXTRA_HEADERS }}
8485 run : |
8586 echo "Running E2E shell tests with realm: ${TEST_REALM}"
8687 cd packages/b2c-cli
Original file line number Diff line number Diff line change @@ -198,8 +198,17 @@ SLAS_BASE="https://${SFCC_SHORTCODE}.api.commercecloud.salesforce.com"
198198echo " ORG ID: $ORG_ID "
199199echo " SLAS Base: $SLAS_BASE "
200200
201+ # Build curl extra headers args if set (newline-separated, e.g. "X-Header: value")
202+ CURL_HEADER_ARGS=()
203+ if [ -n " $CURL_EXTRA_HEADERS " ]; then
204+ while IFS= read -r header; do
205+ [ -n " $header " ] && CURL_HEADER_ARGS+=(-H " $header " )
206+ done <<< " $CURL_EXTRA_HEADERS"
207+ fi
208+
201209# Get shopper token via client credentials (guest login)
202210TOKEN_RESPONSE=$( curl -s " ${SLAS_BASE} /shopper/auth/v1/organizations/${ORG_ID} /oauth2/token" \
211+ " ${CURL_HEADER_ARGS[@]} " \
203212 -u " ${SLAS_CLIENT_ID} :${SLAS_SECRET} " \
204213 -d " grant_type=client_credentials&channel_id=${SITE_ID} " )
205214
@@ -220,6 +229,7 @@ echo ""
220229echo " Step 8: Testing shopper product search..."
221230
222231SEARCH_RESPONSE=$( curl -s " ${SLAS_BASE} /search/shopper-search/v1/organizations/${ORG_ID} /product-search?siteId=${SITE_ID} &limit=5&q=sample" \
232+ " ${CURL_HEADER_ARGS[@]} " \
223233 -H " Authorization: Bearer ${SHOPPER_TOKEN} " )
224234
225235# Check if we got a valid response (should have a 'hits' array or 'total' field)
You can’t perform that action at this time.
0 commit comments