Module: VaultApi::Client::Paths

Included in:
VaultApi::Client
Defined in:
lib/vault_api/client/paths.rb

Instance Method Summary collapse

Instance Method Details

#delete_path(vault_secret_path) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/vault_api/client/paths.rb', line 6

def delete_path(vault_secret_path)
  config_data = VaultApi.list(vault_secret_path.to_s)

  if config_data.present?
    config_data.to_a.each do |file_name|
      VaultApi.delete("#{vault_secret_path}/#{file_name}")
    end
  end

  VaultApi.delete(vault_secret_path.to_s)
end