Project

dev-vault

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
dev/vault bundles all of Hashicorp's platform-specific binaries for Vault and provides helpers to detect the local platform and run the right build.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
~> 0.3

Runtime

~> 0.4
 Project Readme

Dev::Vault

Dev::Vault is a simple wrapper around the Vault binary for development and testing. It bundles all of the published Vault binaries at Dev::Vault::VERSION and runs the correct build for the local system.

Note that Dev::Vault's version follows that of Vault.

Vault is maintained by Hashicorp. Please see https://www.vaultproject.io/ for details.

Installation

Add this line to your application's Gemfile:

gem 'dev-vault'

Or Gemspec:

spec.add_development_dependency 'dev-vault', '0.6.4'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install dev-vault

Usage

Run bundle exec rake to launch a local instance of Vault.

To integrate into tests:

require 'dev/vault'

RSpec.configure do |config|
  config.before(:suite) do
    ## Start Vault with logging suppressed
    Dev::Vault.run(:output => false)
  end

  config.after(:suite) do
    Dev::Vault.stop
  end

  ## ...
end

For more advanced test scenarios involving init, seal, and unseal operations, start a non-dev Vault instance with the inmem storage provider:

require 'dev/vault'

RSpec.describe 'Some Vault Test'
  subject(:vault) do
    Dev::Vault.new(
      :dev => false,
      :port => Dev::Vault::RANDOM_PORT,
      :output => false
    ).run.wait
  end

  after { vault.stop }

  it 'initializes vault' do
    vault.client.sys.init

    expect(vault.client.sys.init_status.initialized?).to be true
  end

This test suite will create and destroy un-initialized vault instances for each case.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rapid7/dev-vault.