A simple Vault client for PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
README.md
composer.json

README.md

vaultlib

A simple Vault client for PHP making use of Guzzle for HTTP API requests.

Installation

Install via Composer:

composer require psecio/vaultlib

Usage:

<?php
require_once __DIR__.'/vendor/autoload.php';

$accessToken = "[... token from Vault account ...]";
$baseUrl = "https://your-vault-server:8200";

$client = new \Psecio\Vaultlib\Client($accessToken, $baseUrl);

// Check for seal
if ($client->isSealed() == true) {
    echo 'The vault is sealed';
}

// Get a secret value
$secret = 'secretName';
$result = $client->getSecret($secret);

/// Delete a secret value
$client->deleteSecret($secret);

// Set a secret value
$client->setSecret($secret, ['testing1' => 'foo']);
?>