necromant2005/tt-vault

This package is abandoned and no longer maintained. The author suggests using the truesocialmetrics/vault package instead.

Vault for private keys and secret data

2.2.0 2018-08-09 07:18 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:59:18 UTC


README

Vault for private keys and secret data

Build Status

tt-vault

Created by Rostislav Mykhajliw

Introduction

Twee\Service\Vault is a simple vault for storing private keys/tokens and pther secret data

Features / Goals

  • Secure store data on filesystem
  • Simple access
  • Errors and leaks protections

Installation

Main Setup

With composer

  1. Add this to your composer.json:
"require": {
    "truesocialmetrics/vault": "*",
}
  1. Now tell composer to download Twee\Service\Vault by running the command:
$ php composer.phar update

Usage

$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