The service exposes one single API to read a secret from the Vault server.
The service exposes one single API to read, create/update or delete a secret from the Vault server.
:warning: the service is smart enough to auto-detect whether the Vault server is configured to use KV Secrets Engine
version 1 (unversioned mode) or version 2 (versioned mode). Thus you don't need to worry about the `data` part
in the resource path or in the response object structure.
#### Endpoint
#### GET secret endpoint
Read a secret from the Vault server, seamlessly using the right API depending on the detected Key-Value engine version ([version 1](https://www.vaultproject.io/api-docs/secret/kv/kv-v1#read-secret) or [version 2](https://www.vaultproject.io/api-docs/secret/kv/kv-v2#read-secret-version)).
| `secret_path` (_path parameter_) | this is your secret location in the Vault server |
| `field` (_query parameter_) | parameter to access a single basic field from the secret JSON payload |
#### Example
##### Example
Let's suppose your have a secret stored under `/b7ecb6ebabc231/my-backend/prod` location in Vault with JSON payload:
@@ -67,6 +69,66 @@ Then you may retrieve:
* the token calling `GET http://vault-secrets-provider/api/secrets/b7ecb6ebabc231/my-backend/prod?field=token`
* the MySql password calling `GET http://vault-secrets-provider/api/secrets/b7ecb6ebabc231/my-backend/prod?field=mysql.password`
#### PUT secret endpoint
Create/Update a secret into the Vault server, seamlessly using the right API depending on the detected Key-Value engine version ([version 1](https://www.vaultproject.io/api-docs/secret/kv/kv-v1#create-update-secret) or [version 2](https://www.vaultproject.io/api-docs/secret/kv/kv-v2#create-update-secret)).
:warning: depending on the Key-Value engine version the Vault server is using, this might either overwrite the secret (v1) or create a new version (v2).
When using version 2, you don't need to embed your secret payload into a `data` field - this is done automatically for you.
Delete a secret from the Vault server, seamlessly using the right API depending on the detected Key-Value engine version ([version 1](https://www.vaultproject.io/api-docs/secret/kv/kv-v1#delete-secret) or [version 2](https://www.vaultproject.io/api-docs/secret/kv/kv-v2#delete-latest-version-of-secret)).