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
23
23
24
24
realm=${1:- " POLARIS" }
25
25
26
- token =${2:- " " }
26
+ TOKEN =${2:- " " }
27
27
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 )
34
29
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
39
32
fi
40
33
41
34
echo
42
- echo " Obtained access token: ${token } "
35
+ echo " Obtained access token: ${TOKEN } "
43
36
44
37
STORAGE_TYPE=" FILE"
45
38
if [ -z " ${STORAGE_LOCATION} " ]; then
@@ -84,7 +77,7 @@ PAYLOAD='{
84
77
85
78
echo $PAYLOAD
86
79
87
- curl -s -H " Authorization: Bearer ${token } " \
80
+ curl -s -H " Authorization: Bearer ${TOKEN } " \
88
81
-H ' Accept: application/json' \
89
82
-H ' Content-Type: application/json' \
90
83
-H " Polaris-Realm: $realm " \
You can’t perform that action at this time.
0 commit comments