到目前为止,我正在使用保管库通过curl登录以获取新令牌。可以按预期工作:
#!/bin/bash
DIR="Deployments"
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
if [ "${BRANCH}" = "master" ]; then
if [ "$(ls $DIR)" ]; then
echo "The directory: $DIR - is not Empty and cannot be merged to Master"
exit 1
else
echo "The directory: $DIR - is Empty"
fi
else
echo "on another branch: $BRANCH"
fi
现在,我想在Spring Cloud中使用以下bootstrap.yml做同样的事情:
curl -k --request POST --data '{"role_id":"myrole","secret_id":"mysecret"}' https://<host>:<port>/vault/v1/auth/approle/login
但这无法正常工作,应用程序在启动时会引发以下异常:
spring.cloud.vault:
uri: https://<host>:<port>
authentication: APPROLE
app-role:
role-id: myrole
secret-id: mysecret
答案 0 :(得分:-1)
请尝试添加 app-role-path:方法