File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
getting-started/assets/polaris Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -23,23 +23,16 @@ apk add --no-cache jq
2323
2424realm=${1:- " POLARIS" }
2525
26- token =${2:- " " }
26+ TOKEN =${2:- " " }
2727
28- if [ -z " $token " ]; then
29- token=$( curl -s http://polaris:8181/api/catalog/v1/oauth/tokens \
30- --user ${CLIENT_ID} :${CLIENT_SECRET} \
31- -H " Polaris-Realm: $realm " \
32- -d grant_type=client_credentials \
33- -d scope=PRINCIPAL_ROLE:ALL | jq -r .access_token)
28+ BASEDIR=$( dirname $0 )
3429
35- if [ -z " ${token} " ]; then
36- echo " Failed to obtain access token."
37- exit 1
38- fi
30+ if [ -z " $TOKEN " ]; then
31+ source $BASEDIR /obtain-token.sh
3932fi
4033
4134echo
42- echo " Obtained access token: ${token } "
35+ echo " Obtained access token: ${TOKEN } "
4336
4437STORAGE_TYPE=" FILE"
4538if [ -z " ${STORAGE_LOCATION} " ]; then
@@ -84,7 +77,7 @@ PAYLOAD='{
8477
8578echo $PAYLOAD
8679
87- curl -s -H " Authorization: Bearer ${token } " \
80+ curl -s -H " Authorization: Bearer ${TOKEN } " \
8881 -H ' Accept: application/json' \
8982 -H ' Content-Type: application/json' \
9083 -H " Polaris-Realm: $realm " \
You can’t perform that action at this time.
0 commit comments