Verified Commit 3b5ce3b7 authored by Xueshan Feng's avatar Xueshan Feng
Browse files

auth/token/lookup-self has not /* path.

parent 8e84457f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -52,7 +52,11 @@ if vault token capabilities ${VAULT_SEC_PATH}/* | grep -q root; then
    exit 0
fi

if vault token capabilities ${VAULT_SEC_PATH}/* | grep -q read; then
sec_path='auth/token/lookup-self'
if [ ${VAULT_SEC_PATH} != $sec_path ]; then
     sec_path="${VAULT_SEC_PATH}/*"
fi
if vault token capabilities $sec_path | grep -q read; then
    echo "You are logged in VAULT and have permission to read from ${VAULT_SEC_PATH}/*"
else
    if ! [ -z $VAULT_ROLE_ID ]; then