Adds support for the optional X-Vault-Namespace header.

fixes gh-1259
This commit is contained in:
kamalakarp
2019-02-27 22:47:49 -06:00
committed by Spencer Gibb
parent ab26f7c3c1
commit 6a105a7502
7 changed files with 122 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ The HTTP service has resources in the following form:
where `application` is injected as the `spring.config.name` in the `SpringApplication` (what is normally `application` in a regular Spring Boot app), `profile` is an active profile (or comma-separated list of properties), and `label` is an optional git label (defaults to `master`.)
Spring Cloud Config Server pulls configuration for remote clients from a git repository (which must be provided), as shown in the following example:
Spring Cloud Config Server pulls configuration for remote clients from various sources. The following example gets configuration from a git repository (which must be provided), as shown in the following example:
[source,yaml]
----
@@ -46,6 +46,8 @@ spring:
uri: https://github.com/spring-cloud-samples/config-repo
----
Other sources are any JDBC compatible database, Subversion, Hashicorp Vault, Credhub and local filesystems.
=== Client Side Usage
To use these features in an application, you can build it as a Spring Boot application that depends on spring-cloud-config-client (for an example, see the test cases for the config-client or the sample application).

View File

@@ -593,14 +593,19 @@ The following table describes configurable Vault properties:
|timeout
|5
|namespace
|null
|===
IMPORTANT: All of the properties in the preceding table must be prefixed with `spring.cloud.config.server.vault`.
IMPORTANT: All of the properties in the preceding table must be prefixed with `spring.cloud.config.server.vault` or placed in the correct Vault section of a composite configuration.
All configurable properties can be found in `org.springframework.cloud.config.server.environment.VaultEnvironmentRepository`.
All configurable properties can be found in `org.springframework.cloud.config.server.environment.VaultEnvironmentProperties`.
Vault 0.10.0 introduced a versioned key-value backend (k/v backend version 2) that exposes a different API than earlier versions, it now requires a `data/` between the mount path and the actual context path and wraps secrets in a `data` object. Setting `kvVersion=2` will take this into account.
Optionally, there is support for the Vault Enterprise `X-Vault-Namespace` header. To have it sent to Vault set the `namespace` property.
With your config server running, you can make HTTP requests to the server to retrieve
values from the Vault backend.
To do so, you need a token for your Vault server.