Class: Conjur::Conjurize

Inherits:
Object
  • Object
show all
Includes:
Methadone::CLILogging, Methadone::Main
Defined in:
lib/conjur/conjurize.rb,
lib/conjur/conjurize/script.rb

Defined Under Namespace

Classes: Script

Class Method Summary collapse

Class Method Details

.apply_client_configObject



41
42
43
44
45
46
47
48
49
# File 'lib/conjur/conjurize.rb', line 41

def self.apply_client_config
  require "conjur/cli"
  if conjur_config = options[:c]
    Conjur::Config.load [ conjur_config ]
  else
    Conjur::Config.load
  end
  Conjur::Config.apply
end

.configuration(host) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/conjur/conjurize.rb', line 51

def self.configuration host
  apply_client_config

  host.merge \
    "account" => Conjur.configuration.,
    "appliance_url" => Conjur.configuration.appliance_url,
    "certificate" => File.read(Conjur.configuration.cert_file).strip
end

.generate(host) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/conjur/conjurize.rb', line 31

def self.generate host
  config = configuration host

  if options[:json]
    JSON.dump config
  else
    Script.generate config, options
  end
end