Spring Cloud consul 中的令牌支持

sag*_*sag 0 spring consul spring-cloud

我们正在使用 spring-cloud 来读取我们应用程序的配置。我们在 application.yaml 中有类似的结构

spring:
  cloud:
    consul:
      host: consul_host
      port: 8500
Run Code Online (Sandbox Code Playgroud)

我们想为 consul 启用 ACL。所以我们需要通过consul token来通过 spring 读取配置。如何在 application.yaml 中指定 consul 令牌

dun*_*nni 5

如果您至少使用 Spring Cloud Brixton M2(当前版本为 RC1),则可以在该属性spring.cloud.consul.config.acl-token中指定令牌。