Class: PasswordVault::HashiCorpVault
- Inherits:
-
Object
- Object
- PasswordVault::HashiCorpVault
- Includes:
- MintLogger, MonitorMixin
- Defined in:
- src/mintpress-common/lib/mintpress-common/hashicorp.rb
Overview
Class to manage passwords in HashiCorp Vault
Properties (Read/Write)
Properties (Read Only)
Constant Summary
Constants included from MintLogger
MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN
Instance Method Summary collapse
-
#get_password(path, key, value = nil, override: false, length: nil, include_chars: nil, include_numbers: nil, include_symbols: nil, must_start_with_char: nil, symbols: nil, auto_create: nil) ⇒ String
Retrieves or generates a password from the specified path.
-
#initialize(options = {}) ⇒ HashiCorpVault
constructor
Initializes a new instance of the class.
-
#list_passwords(path, output_file: nil, id: nil, decrypt: false) ⇒ Hash
Exports the password tree under `path` to a Chef data bag JSON file.
-
#remove_password(path, key: nil, delete_tree: false) ⇒ Object
Removes an entry from the Vault If the key exists, then only the key is removed and other keys re-written if the key does not exists, no action is taken if delete_tree is true, the entire tree of secrets under path is permanently destroyed (every secret and all of its versions/metadata, recursively).
Methods included from MintLogger::Utils::Common
#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send
Constructor Details
#initialize(options = {}) ⇒ HashiCorpVault
Initializes a new instance of the class.
Supports all options of the Vault Client gem. Refer https://github.com/hashicorp/vault-ruby/tree/master
Instance Method Details
#get_password(path, key, value = nil, override: false, length: nil, include_chars: nil, include_numbers: nil, include_symbols: nil, must_start_with_char: nil, symbols: nil, auto_create: nil) ⇒ String
Retrieves or generates a password from the specified path.
#list_passwords(path, output_file: nil, id: nil, decrypt: false) ⇒ Hash
Exports the password tree under `path` to a Chef data bag JSON file.
Produces the inverse of the migration upload tooling: the returned (and
written) structure is { "id" => , "" => { "" => }, ... }
where each asset_code is a child secret of `path` in Vault.
#remove_password(path, key: nil, delete_tree: false) ⇒ Object
Removes an entry from the Vault
If the key exists, then only the key is removed and other keys re-written
if the key does not exists, no action is taken
if delete_tree is true, the entire tree of secrets under path is permanently
destroyed (every secret and all of its versions/metadata, recursively).