How to run vault server on the Docker read here. Author: neb0t
Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log.
All documentation is available on the Vault website.
Stash - a package was used for cache data. Stash makes it easy to speed up your code by caching the results of expensive functions or code.
The preferred way to install this extension is through Composer.
Either run
composer require dykyi-roman/vault-client
or add
"dykyi-roman/vault-client": "^1.2"
to the require section of your composer.json
- Make sure to update your /.env file with your app ID & secret.
VAULT_ROOT_TOKEN_ID=5HNcw7sdf1CcafOFflUes6VOdjPaIJJEDs
VAULT_HOST=http://your-website.com/
- Or use function
setOptions()
require_once '../vendor/autoload.php';
use Dykyi\VaultClient;
use Dykyi\ResponseDataExtractor;
use GuzzleHttp\Client;
$dotenv = new \Dotenv\Dotenv(__DIR__);
$dotenv->load();
$client = new VaultClient(new Client(), new ResponseDataExtractor());
if ($client->init()) {
$client->write('db', ['user' => 'password']);
$client->read('db');
$client->update('db', ['user' => 'new_password']);
$client->read('db');
$client->delete('db');
}
- DEV -
/v1/secret/dev/
- PROD -
/v1/secret/prod/
- TEST -
/v1/secret/test/
Dykyi Roman, e-mail: mr.dukuy@gmail.com