使用Spring Cloud HOXTON.SR6,使用Spring boot 2.3.2
在启动服务时,我在尝试访问"/secret/application“和"/secret/application/{profile}”时遇到403个错误。这些路径中的" application“应该替换为我的应用程序名。
错误:
[RequestedSecret [path='secret/application/{profile}’, mode=ROTATE]] Lease [leaseId='null', leaseDuration=PT0S, renewable=false] Status 403 Forbidden [secret/application/{profile}]: 1 error occurred: * permission denied ; nested exception is org.springframework.web.client.HttpClientErrorException$Forbidden: 403 Forbidden: [{"errors":["1 error occurred:\n\t* permission denied\n\n"]} ] org.springframework.vault.VaultException: Status 403 Forbidden [secret/application/{profile}]: 1 error occurred: * permission denied ; nested exception is org.springframework.web.client.HttpClientErrorException$Forbidden: 403 Forbidden: [{"errors":["1 error occurred:\n\t* permission denied\n\n"]} ]如果我设置spring.cloud.vault.generic.enabled = false,那么替换就能正常工作,错误也就消失了。问题是这个属性被设置为弃用。那么绕过它的方法是什么?
出现错误的原因是:
spring:
cloud:
vault:
authentication: approle
app-role:
role-id: <<role-id>>
secret-id: <<secret-id>>
kv:
enabled: true
backend: secret
application-name: <<application-name>>
default-context: <<application-name>>
host: <<vault-host>>但现在不再是这样了:
spring:
cloud:
vault:
authentication: approle
app-role:
role-id: <<role-id>>
secret-id: <<secret-id>>
kv:
enabled: true
backend: secret
application-name: <<application-name>>
default-context: <<application-name>>
generic:
enabled: false
host: <<vault-host>>我应该以不同的方式使用它吗?
发布于 2021-08-24 14:41:45
正如您所说,将泛型设置为false可以解决问题,所以我的建议是保留它,直到他们删除它
https://stackoverflow.com/questions/63508995
复制相似问题