NAME

WebService::HashiCorp::Vault - Perl API for HashiCorp's Vault

VERSION

version 0.03

SYNOPSIS

use WebService::HashiCorp::Vault;

my $vault = WebService::HashiCorp::Vault->new(
    token    => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    base_url => 'http://127.0.0.1:8200', # optional, default shown
    version  => 'v1', # optional, for future use if api changes
);

my $secret = $vault->secret();
my $sys    = $vault->sys();

DESCRIPTION

A perl API for convenience in using HashiCorp's Vault server software.

Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing. Vault handles leasing, key revocation, key rolling, and auditing. Through a unified API, users can access an encrypted Key/Value store and network encryption-as-a-service, or generate AWS IAM/STS credentials, SQL/NoSQL databases, X.509 certificates, SSH credentials, and more.

BETA STATUS NOTICE

This API software is a Beta release, which I am published for people to comment on and provide pull requests.

I am now fairly happy with the API and am unlikely to make any drastic changes.

But if something feels strange, please send me feedback how it would be nicer!

Alas, the "official" API's for other languages aren't much to go on. They are barely more than a small wrapper around HTTP and JSON encoding/decoding. I have tried to do better.

METHODS

secret

my $secret = $vault->secret(
    mount   => 'secret',  # optional if mounted non-default
    backend => 'Generic', # or MySQL, or SSH, or whatever
    %other_args,          # other, backend specific arguments
);

Parameters

mount

A custom mount location if you have placed it somewhere other than the default.

backend

Here are the currently supported options:

Cassandra
Cubbyhole
Generic
Generic
MongoDB
MSSQL
MySQL
PostgreSQL
RabbitMQ
SSH
other arguments

See the documentation for the backend in question. Everything will pass through to the backend's constructor.

Returns

A Generic object, all ready to be used. Or whatever object based upon provided backend parameter.

sys

my $sys = $vault->sys(
    mount => 'sys', # optional if mounted non-default
);

Parameters

mount

A custom mount location if you have placed it somewhere other than the default.

Returns

A WebService::HashiCorp::Vault::Sys object, all ready to be used.

SEE ALSO

Vault Project

AUTHOR

Dean Hamstead <dean@fragfest.com.au>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Dean Hamstad.

This is free software, licensed under:

The MIT (X11) License