Supports:
- auth
- tokens
- authrole
- general
- read
- write
The default client will leverage the environment variables VAULT_ADDR
and VAULT_TOKEN
export VAULT_ADDR=http://localhost:8200
export VAULT_TOKEN=horde
$secrets = [
"foo" => "bar",
"baz" => "boo",
];
$c = new VaultClient();
$resp = $c->write('secret/testing', $secrets);
$found = $c->read('secret/testing');
print_r($found['data']);
// Output:
// Array
// (
// [baz] => boo
// [foo] => bar
// )
$roleId = "...";
$secretId = "...";
$secrets = [
"foo" => "bar",
"baz" => "boo",
];
$c = new VaultClient(new DefaultVaultConfigFactory([
'auth' => new AppRole($roleId, $secretId),
]));
$resp = $c->write('secret/testing', $secrets);
$found = $c->read('secret/testing');
print_r($found['data']);
// Output:
// Array
// (
// [baz] => boo
// [foo] => bar
// )