领先一步
VMware 提供培训和认证,助您加速进步。
了解更多我谨代表社区,很高兴地宣布 Spring Vault 和 Spring Cloud Vault 1.0.0.M1 的第一个里程碑版本。
相关构件可在 Milestone 仓库 中获取。
Spring Vault 是一个 HashiCorp Vault 的客户端,它提供了熟悉的 Spring 抽象。它带有 @VaultPropertySource,可以将 Vault 中的加密属性暴露给 Environment,以及 VaultTemplate 来访问存储在 Vault 中并由 Vault 加密的密钥。
@Configuration
@VaultPropertySource("secret/my-application")
public class AppConfig extends AbstractVaultConfiguration {
/**
* Specify an endpoint for connecting to Vault.
*/
@Override
public VaultEndpoint vaultEndpoint() {
return VaultEndpoint.create("localhost", 8200);
}
/**
* Configure a client authentication.
*/
@Override
public ClientAuthentication clientAuthentication() {
return new TokenAuthentication("…");
}
}
Spring Cloud Vault 使用 Spring Vault 为基于 Spring Boot 的应用程序提供配置集成。Spring Cloud Vault 为应用程序提供在 Vault 中加密的配置数据。使用 Spring Cloud Vault 的应用程序可以从 Vault 请求为各种数据库和服务集成生成的凭据,例如 MySQL、MongoDB、Consul、AWS 等等。在应用程序关闭时,这些凭据将被撤销且不再有效。
添加 spring-cloud-vault-starter-config 依赖项并将 Vault 连接详细信息提供给 bootstrap 配置就足以开始使用 Spring Cloud Vault。
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-vault-starter-config</artifactId>
<version>1.0.0.M1</version>
</dependency>
</dependencies>
spring.cloud.vault:
host: localhost
authentication: (TOKEN|APPROLE|AWS_EC2|CERT|…)
token: …
没有社区的参与,我们就无法取得今天的成功。我想感谢所有创建问题和提供反馈的人。
如果您对此版本有反馈,我鼓励您通过 StackOverflow、GitHub Issues 或评论区与我们联系。您也可以在 Twitter 上联系我 @mp911 或 @SpringCloudOSS 团队。
请查看以下任何链接以获取更多详细信息