Vault for private keys and secret data
Created by Rostislav Mykhajliw
Twee\Service\Vault is a simple vault for storing private keys/tokens and pther secret data
- Secure store data on filesystem
- Simple access
- Errors and leaks protections
- Add this to your composer.json:
"require": {
"truesocialmetrics/vault": "*",
}
- Now tell composer to download Twee\Service\Vault by running the command:
$ php composer.phar update
$vault = new Vault\File('path/to/vault.php');
$vault->get('my-token'); // ['abc' => 123]
$vault->get('non-exist'); // throw InvalidArgumentException
Sample vault.php file
<?php
return [
'vault' => [
'my-token' => [
'abc' => 123,
],
],
];
Sample with AWS SSM parameter store
$vault = new Vault\Aws([
'credentials' => [
'key' => '...',
'secret' => '...',
],
'region' => 'us-east-1',
'version' => 'latest',
]);
$vault->get('my-token'); // ['abc' => 123]
$vault->get('non-exist'); // throw InvalidArgumentException