Skip to content

Commit fc95a54

Browse files
updating logic for token
1 parent 1a5c2d1 commit fc95a54

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

.github/scripts/ppc64le/self-hosted-builder/helpers/app_token.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ set -o pipefail
1313

1414
set -e # Exit on error
1515

16-
echo "Inside app_token.sh:"
17-
18-
if [[ -z "$APP_ID" || -z "$INSTALL_ID" || -z "$APP_PRIVATE_KEY" ]]; then
19-
echo "Missing required environment variables!" >&2
20-
exit 1
21-
fi
22-
23-
#APP_ID=$(cat $1) # Path to appid.env
24-
#INSTALL_ID=$(cat $2)
25-
#APP_PRIVATE_KEY=$3 # Path to key_private.pem
26-
echo "APP_ID: $APP_ID"
27-
echo "INSTALL_ID: $INSTALL_ID"
28-
echo "APP_PRIVATE_KEY path: $APP_PRIVATE_KEY"
29-
3016
# Generate JWT
3117
header='{"alg":"RS256","typ":"JWT"}'
3218
payload="{\"iat\":$(date +%s),\"exp\":$(( $(date +%s) + 600 )),\"iss\":${APP_ID}}"
@@ -38,10 +24,6 @@ signature=$(echo -n "${header_base64}.${payload_base64}" | \
3824
openssl dgst -sha256 -sign "${APP_PRIVATE_KEY}" | \
3925
openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n')
4026

41-
echo "Contents of APP_PRIVATE_KEY:"
42-
cat "$APP_PRIVATE_KEY"
43-
44-
4527
generated_jwt="${header_base64}.${payload_base64}.${signature}"
4628

4729
echo $generated_jwt
@@ -57,5 +39,3 @@ app_installations_response=$(curl -sX POST \
5739
)
5840

5941
echo "$app_installations_response" | jq --raw-output '.token'
60-
61-
#echo "ACCESS_TOKEN=${jwt}" > "${DST_FILE}"

.github/scripts/ppc64le/self-hosted-builder/helpers/gh_token_generator.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,5 @@ INSTALL_ID=$2
66
APP_PRIVATE_KEY=$3
77
DST_FILE="$4"
88

9-
#echo "APP_ID file content: $(<"${APP_ID}")"
10-
#echo "INSTALL_ID file content: $(<"${INSTALL_ID}")"
11-
#echo "APP_PRIVATE_KEY file content: $(<"${APP_PRIVATE_KEY}")"
12-
139
ACCESS_TOKEN="$(APP_ID="$(<"${APP_ID}")" INSTALL_ID="$(<"${INSTALL_ID}")" APP_PRIVATE_KEY="${APP_PRIVATE_KEY}" "${SCRIPT_DIR}/app_token.sh")"
1410
echo "ACCESS_TOKEN=${ACCESS_TOKEN}" > "${DST_FILE}"

0 commit comments

Comments
 (0)