2017 © Pedro Peláez
 

library vault

image

jccp/vault

  • Friday, September 15, 2017
  • by jccpdev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 140 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Vault SDK

Supports:, (*2)

  • auth
    • tokens
    • authrole
  • general
    • read
    • write

Examples

Configure Environment

The default client will leverage the environment variables VAULT_ADDR and VAULT_TOKEN, (*3)

export VAULT_ADDR=http://localhost:8200
export VAULT_TOKEN=horde

Read and Write Secrets

$secrets = [
    "foo" => "bar",
    "baz" => "boo",
];

$config = new DefaultVaultConfig('http://localhost:8200', new Tokens('horde'), '');

$vaultClient = new VaultClient(new Client());
$vaultClient->withConfig($config);
$vaultClient->write('secret/testing', $secrets);
$found = $vaultClient->read('secret/testing');

print_r($found['data']);

// Output:
// Array
// (
//     [baz] => boo
//     [foo] => bar
// )

Login with AppRole

$roleId = "...";
$secretId = "...";
$secrets = [
    "foo" => "bar",
    "baz" => "boo",
];

$vaultClient = new VaultClient(new Client());

$auth = new AppRole($vaultClient);
$auth->with('theRoleId', 'theSecretId');

$config = new DefaultVaultConfig('http://localhost:8200', $auth, '');

$vaultClient->withConfig($config);
$vaultClient->write('secret/testing', $secrets);

$found = $vaultClient->read('secret/testing');
print_r($found['data']);

// Output:
// Array
// (
//     [baz] => boo
//     [foo] => bar
// )

Credit

This is a fork of https://github.com/fliglio/vault, (*4)

The Versions

15/09 2017

dev-master

9999999-dev

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Juan Contreras

15/09 2017

v4.0.0

4.0.0.0

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Juan Contreras

10/09 2017

v3.1.0

3.1.0.0

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Juan Contreras

09/09 2017

v3.0.1

3.0.1.0

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Ben Schwartz
by Juan Contreras

09/09 2017

v3.0.0

3.0.0.0

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Ben Schwartz
by Juan Contreras

06/06 2017

2.1.x-dev

2.1.9999999.9999999-dev

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Ben Schwartz

06/06 2017

v2.1.0

2.1.0.0

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Ben Schwartz