kozaktomas/vault-client

This library provides API for Vault

This package's canonical repository appears to be gone and the package has been frozen as a result.

v0.1.5 2018-07-08 19:28 UTC

This package is not auto-updated.

Last update: 2019-02-17 23:11:35 UTC


README

$key = sodium_crypto_secretbox_keygen(); // could be stored in base64 string
$storage = new \Kiwicom\Vault\StorageController(
    $key,
    new \Kiwicom\Vault\Storage\FileStorage(__DIR__ . "/temp"),
    new \Kiwicom\Vault\Storage\RedisStorage("localhost", 1234, 9)
);

$factory = new \Kiwicom\Vault\VaultFactory(
    'https://vaulturl.com:8200',
    'token',
    $storage
);

$client = $factory->getClient('php/mailing');

echo $client->get('api/external:myKey')); // secret/php/mailing/api/external:myKey