Reformat readme
See gh-591.
This commit is contained in:
56
README.adoc
56
README.adoc
@@ -4,7 +4,6 @@ image::https://spring.io/badges/spring-vault/snapshot.svg[link=https://projects.
|
||||
|
||||
= Spring Vault
|
||||
|
||||
|
||||
Spring Vault provides client-side support for accessing, storing and revoking secrets.
|
||||
With https://www.vaultproject.io[HashiCorp's Vault] you have a central place to manage external secret data for applications across all environments.
|
||||
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
|
||||
|
||||
*Prerequisites*
|
||||
|
||||
To get started with Vault and this guide you need a
|
||||
*NIX-like operating systems that provides:
|
||||
To get started with Vault and this guide you need a *NIX-like operating systems that provides:
|
||||
|
||||
* `wget`, `openssl` and `unzip`
|
||||
* at least Java 8 and a properly configured `JAVA_HOME` environment variable
|
||||
@@ -93,7 +91,8 @@ $ src/test/bash/install_vault.sh
|
||||
$ src/test/bash/create_certificates.sh
|
||||
----
|
||||
|
||||
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`.
|
||||
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`.
|
||||
|
||||
*Start Vault server*
|
||||
|
||||
@@ -103,8 +102,7 @@ $ src/test/bash/local_run_vault.sh
|
||||
|
||||
Vault is started listening on `0.0.0.0:8200` using the `inmem` storage and
|
||||
`https`.
|
||||
Vault is sealed and not initialized when starting up
|
||||
so you need to initialize it first.
|
||||
Vault is sealed and not initialized when starting up so you need to initialize it first.
|
||||
|
||||
----
|
||||
$ export VAULT_ADDR="https://localhost:8200"
|
||||
@@ -144,8 +142,8 @@ Vault is now initialized and unsealed.
|
||||
|
||||
=== Using VaultTemplate
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
You can have Spring initializing Spring Vault by providing a JavaConfig:
|
||||
|
||||
@@ -204,16 +202,13 @@ public class MyApp {
|
||||
|
||||
=== @VaultPropertySource
|
||||
|
||||
`@VaultPropertySource` provides a convenient and declarative
|
||||
mechanism for adding a `PropertySource` to Spring’s `Environment`.
|
||||
`@VaultPropertySource` provides a convenient and declarative mechanism for adding a `PropertySource` to Spring’s `Environment`.
|
||||
|
||||
To be used in conjunction with @Configuration classes.
|
||||
Example usage
|
||||
|
||||
Given a Vault path `secret/my-application` containing the configuration data
|
||||
pair `database.password=mysecretpassword`, the following `@Configuration`
|
||||
class uses `@VaultPropertySource` to contribute `secret/my-application` to
|
||||
the `Environment`'s set of `PropertySources`.
|
||||
Given a Vault path `secret/my-application` containing the configuration data pair `database.password=mysecretpassword`, the following `@Configuration`
|
||||
class uses `@VaultPropertySource` to contribute `secret/my-application` to the `Environment`'s set of `PropertySources`.
|
||||
|
||||
====
|
||||
[source,java]
|
||||
@@ -238,7 +233,8 @@ public class AppConfig {
|
||||
|
||||
==== Build requirements for Vault
|
||||
|
||||
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`.
|
||||
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`.
|
||||
|
||||
The following scripts need to be run prior to building the project for the tests to pass.
|
||||
|
||||
@@ -259,11 +255,16 @@ Spring Vault uses Maven for most build-related activities, and you should be abl
|
||||
$ ./mvnw install
|
||||
----
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
NOTE: If all else fails, build with the command from `.travis.yml` (usually
|
||||
`./mvnw install`).
|
||||
@@ -277,14 +278,19 @@ The module has a "distribute" profile, and if you switch that on it will try to
|
||||
|
||||
If you don't have an IDE preference we would recommend that you use
|
||||
https://www.springsource.com/developer/sts[Spring Tools Suite] or
|
||||
https://eclipse.org[Eclipse] when working with the code. We use the
|
||||
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.
|
||||
https://eclipse.org[Eclipse] when working with the code.
|
||||
We use the
|
||||
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.
|
||||
|
||||
==== Importing into eclipse with m2eclipse
|
||||
|
||||
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".
|
||||
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".
|
||||
|
||||
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`.
|
||||
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`.
|
||||
|
||||
==== Importing into eclipse without m2eclipse
|
||||
|
||||
@@ -300,13 +306,15 @@ from the `file` menu.
|
||||
|
||||
== Contributing
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
=== Sign the Contributor License Agreement
|
||||
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
https://cla.pivotal.io/sign/spring[Contributor License Agreement].
|
||||
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.
|
||||
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.
|
||||
|
||||
=== Code of Conduct
|
||||
|
||||
|
||||
Reference in New Issue
Block a user