Class: SecretConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_commons_ruby/SecretConfig.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ SecretConfig

Returns a new instance of SecretConfig.



5
6
7
8
9
10
11
12
13
14
# File 'lib/apollo_commons_ruby/SecretConfig.rb', line 5

def initialize(environment)
  conf_file = File.read(File.expand_path("/var/jenkins_home/template_config/config.json"));
  conf = JSON.parse conf_file
  conf = conf[environment.downcase]
  if (conf["authToken"] == nil)
    puts "Security configurations are missing"
    return nil
  end
  @authToken = conf["authToken"]
end

Instance Attribute Details

#authTokenObject (readonly)

Returns the value of attribute authToken.



3
4
5
# File 'lib/apollo_commons_ruby/SecretConfig.rb', line 3

def authToken
  @authToken
end