2017 © Pedro Peláez
 

library vault-client

Vault Client

image

dykyi-roman/vault-client

Vault Client

  • Wednesday, December 13, 2017
  • by dikiy-roman
  • Repository
  • 0 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Vault Server

How to run vault server on the Docker read here. Author: neb0t, (*1)

Vault Client

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., (*2)

Documentation

All documentation is available on the Vault website., (*3)

Cache system

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., (*4)

Installation

Composer

The preferred way to install this extension is through Composer., (*5)

Either run, (*6)

composer require dykyi-roman/vault-client

or add, (*7)

"dykyi-roman/vault-client": "^1.2"

to the require section of your composer.json, (*8)

Usage

1) Make sure to update your /.env file with your app ID & secret., (*9)

VAULT_ROOT_TOKEN_ID=5HNcw7sdf1CcafOFflUes6VOdjPaIJJEDs
VAULT_HOST=http://your-website.com/

2) Or use function setOptions(), (*10)

Example

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');
}

Available environment

  • DEV - /v1/secret/dev/
  • PROD - /v1/secret/prod/
  • TEST - /v1/secret/test/

Author

Dykyi Roman, e-mail: mr.dukuy@gmail.com, (*11)

The Versions