You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Vault provides client-side support for accessing, storing and revoking secrets.
9
8
With https://www.vaultproject.io[HashiCorp's Vault] you have a central place to manage external secret data for applications across all environments.
10
9
Vault can manage static and dynamic secrets such as application data, username/password for remote applications/resources and provide credentials for external services such as MySQL, PostgreSQL, Apache Cassandra, Consul, AWS and more.
@@ -75,8 +74,7 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
75
74
76
75
*Prerequisites*
77
76
78
-
To get started with Vault and this guide you need a
79
-
*NIX-like operating systems that provides:
77
+
To get started with Vault and this guide you need a *NIX-like operating systems that provides:
80
78
81
79
* `wget`, `openssl` and `unzip`
82
80
* at least Java 8 and a properly configured `JAVA_HOME` environment variable
NOTE: `create_certificates.sh` creates certificates in `work/ca` and a JKS truststore `work/keystore.jsk`. If you want to run Spring Vault using this quickstart guide you need to configure the truststore to `file:work/keystore.jks`.
94
+
NOTE: `create_certificates.sh` creates certificates in `work/ca` and a JKS truststore `work/keystore.jsk`.
95
+
If you want to run Spring Vault using this quickstart guide you need to configure the truststore to `file:work/keystore.jks`.
Vault is started listening on `0.0.0.0:8200` using the `inmem` storage and
105
104
`https`.
106
-
Vault is sealed and not initialized when starting up
107
-
so you need to initialize it first.
105
+
Vault is sealed and not initialized when starting up so you need to initialize it first.
108
106
109
107
----
110
108
$ export VAULT_ADDR="https://localhost:8200"
@@ -144,8 +142,8 @@ Vault is now initialized and unsealed.
144
142
145
143
=== Using VaultTemplate
146
144
147
-
The class VaultTemplate, located in the package org.springframework.vault.core, is the central class of the Spring’s Vault support providing a rich feature set to interact with Vault. The template offers convenience operations to read, write and delete data in Vault and provides a mapping between your domain objects and Vault data.
148
-
145
+
The class VaultTemplate, located in the package org.springframework.vault.core, is the central class of the Spring’s Vault support providing a rich feature set to interact with Vault.
146
+
The template offers convenience operations to read, write and delete data in Vault and provides a mapping between your domain objects and Vault data.
149
147
150
148
You can have Spring initializing Spring Vault by providing a JavaConfig:
151
149
@@ -204,16 +202,13 @@ public class MyApp {
204
202
205
203
=== @VaultPropertySource
206
204
207
-
`@VaultPropertySource` provides a convenient and declarative
208
-
mechanism for adding a `PropertySource` to Spring’s `Environment`.
205
+
`@VaultPropertySource` provides a convenient and declarative mechanism for adding a `PropertySource` to Spring’s `Environment`.
209
206
210
207
To be used in conjunction with @Configuration classes.
211
208
Example usage
212
209
213
-
Given a Vault path `secret/my-application` containing the configuration data
214
-
pair `database.password=mysecretpassword`, the following `@Configuration`
215
-
class uses `@VaultPropertySource` to contribute `secret/my-application` to
216
-
the `Environment`'s set of `PropertySources`.
210
+
Given a Vault path `secret/my-application` containing the configuration data pair `database.password=mysecretpassword`, the following `@Configuration`
211
+
class uses `@VaultPropertySource` to contribute `secret/my-application` to the `Environment`'s set of `PropertySources`.
217
212
218
213
====
219
214
[source,java]
@@ -238,7 +233,8 @@ public class AppConfig {
238
233
239
234
==== Build requirements for Vault
240
235
241
-
Spring Vault requires SSL certificates and a running Vault instance listening on `localhost:8200`. Certificates and the Vault setup are scripted, the scripts are located in `src/test/bash`.
236
+
Spring Vault requires SSL certificates and a running Vault instance listening on `localhost:8200`.
237
+
Certificates and the Vault setup are scripted, the scripts are located in `src/test/bash`.
242
238
243
239
The following scripts need to be run prior to building the project for the tests to pass.
244
240
@@ -259,11 +255,16 @@ Spring Vault uses Maven for most build-related activities, and you should be abl
259
255
$ ./mvnw install
260
256
----
261
257
262
-
NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command in place of `./mvnw` in the examples below. If you do that you also might need to add `-P spring` if your local Maven settings do not contain repository declarations for spring pre-release artifacts.
258
+
NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command in place of `./mvnw` in the examples below.
259
+
If you do that you also might need to add `-P spring` if your local Maven settings do not contain repository declarations for spring pre-release artifacts.
263
260
264
-
NOTE: Be aware that you might need to increase the amount of memory available to Maven by setting a `MAVEN_OPTS` environment variable with a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in the `.mvn` configuration, so if you find you have to do it to make a build succeed, please raise a ticket to get the settings added to source control.
261
+
NOTE: Be aware that you might need to increase the amount of memory available to Maven by setting a `MAVEN_OPTS` environment variable with a value like `-Xmx512m -XX:MaxPermSize=128m`.
262
+
We try to cover this in the `.mvn` configuration, so if you find you have to do it to make a build succeed, please raise a ticket to get the settings added to source control.
265
263
266
-
For hints on how to build the project look in `.travis.yml` if there is one. There should be a "script" and maybe "install" command. Also look at the "services" section to see if any services need to be running locally (e.g. mongo or rabbit). Ignore the git-related bits that you might find in "before_install" since they're related to setting git credentials and you already have those.
264
+
For hints on how to build the project look in `.travis.yml` if there is one.
265
+
There should be a "script" and maybe "install" command.
266
+
Also look at the "services" section to see if any services need to be running locally (e.g. mongo or rabbit).
267
+
Ignore the git-related bits that you might find in "before_install" since they're related to setting git credentials and you already have those.
267
268
268
269
NOTE: If all else fails, build with the command from `.travis.yml` (usually
269
270
`./mvnw install`).
@@ -277,14 +278,19 @@ The module has a "distribute" profile, and if you switch that on it will try to
277
278
278
279
If you don't have an IDE preference we would recommend that you use
279
280
https://www.springsource.com/developer/sts[Spring Tools Suite] or
280
-
https://eclipse.org[Eclipse] when working with the code. We use the
281
-
https://eclipse.org/m2e/[m2eclipe] eclipse plugin for maven support. Other IDEs and tools should also work without issue as long as they use Maven 3.3.3 or better.
281
+
https://eclipse.org[Eclipse] when working with the code.
282
+
We use the
283
+
https://eclipse.org/m2e/[m2eclipe] eclipse plugin for maven support.
284
+
Other IDEs and tools should also work without issue as long as they use Maven 3.3.3 or better.
282
285
283
286
==== Importing into eclipse with m2eclipse
284
287
285
-
We recommend the https://eclipse.org/m2e/[m2eclipe] eclipse plugin when working with eclipse. If you don't already have m2eclipse installed it is available from the "eclipse marketplace".
288
+
We recommend the https://eclipse.org/m2e/[m2eclipe] eclipse plugin when working with eclipse.
289
+
If you don't already have m2eclipse installed it is available from the "eclipse marketplace".
286
290
287
-
NOTE: Older versions of m2e do not support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell m2eclipse to use the right profile for the projects.If you see many different errors related to the POMs in the projects, check that you have an up to date installation. If you can't upgrade m2e, add the "spring" profile to your `settings.xml`. Alternatively you can copy the repository settings from the "spring" profile of the parent pom into your `settings.xml`.
291
+
NOTE: Older versions of m2e do not support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell m2eclipse to use the right profile for the projects.If you see many different errors related to the POMs in the projects, check that you have an up to date installation.
292
+
If you can't upgrade m2e, add the "spring" profile to your `settings.xml`.
293
+
Alternatively you can copy the repository settings from the "spring" profile of the parent pom into your `settings.xml`.
288
294
289
295
==== Importing into eclipse without m2eclipse
290
296
@@ -300,13 +306,15 @@ from the `file` menu.
300
306
301
307
== Contributing
302
308
303
-
Spring Vault is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.
309
+
Spring Vault is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master.
310
+
If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.
304
311
305
312
=== Sign the Contributor License Agreement
306
313
307
314
Before we accept a non-trivial patch or pull request we will need you to sign the
Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
316
+
Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do.
317
+
Active contributors might be asked to join the core team, and given the ability to merge pull requests.
0 commit comments