class Vault::Provision::Sys::Auth

helps to enable authentication

Public Instance Methods

provision!() click to toggle source
# File lib/vault/provision/sys/auth.rb, line 3
def provision!
  auths = @vault.sys.auths

  change = []
  repo_files.each do |rf|
    validate_file! rf
    path = rf[(repo_path.length + 1)..-6].to_sym
    r_conf = JSON.parse(File.read(rf))

    puts "  * #{File.basename(rf, '.json')} (#{r_conf['type']})"
    next if auths[path]
    @vault.sys.enable_auth(path.to_s,
                           r_conf['type'], r_conf['description'])
    change << @vault.sys.auths[path]
  end

  change
end