module Opener::Webservice::Configuration

Module for storing global configuration settings such as whether or not to enable authentication.

Public Class Methods

authentication?() click to toggle source

Returns `true` if authentication should be enabled.

@return [TrueClass|FalseClass]

# File lib/opener/webservice/configuration.rb, line 13
def self.authentication?
  return !!authentication_endpoint && !authentication_endpoint.empty?
end
authentication_endpoint() click to toggle source

Returns the authentication endpoint to use.

@return [String]

# File lib/opener/webservice/configuration.rb, line 22
def self.authentication_endpoint
  return ENV['AUTHENTICATION_ENDPOINT']
end
authentication_secret() click to toggle source

Returns the field name of the authentication secret.

@return [String]

# File lib/opener/webservice/configuration.rb, line 31
def self.authentication_secret
  return ENV['AUTHENTICATION_SECRET'] || 'secret'
end
authentication_token() click to toggle source

Returns the field name of the authentication token.

@return [String]

# File lib/opener/webservice/configuration.rb, line 40
def self.authentication_token
  return ENV['AUTHENTICATION_TOKEN'] || 'token'
end
configure_rollbar() click to toggle source

Configures Rollbar.

# File lib/opener/webservice/configuration.rb, line 83
def self.configure_rollbar
  Rollbar.configure do |config|
    config.access_token = ENV['ROLLBAR_TOKEN']
    config.enabled      = rollbar?
    config.environment  = environment
  end
end
environment() click to toggle source

@return [String]

# File lib/opener/webservice/configuration.rb, line 94
def self.environment
  return ENV['RACK_ENV'] || ENV['RAILS_ENV']
end
newrelic?() click to toggle source

Returns `true` if New Relic monitoring should be enabled.

@return [TrueClass|FalseClass]

# File lib/opener/webservice/configuration.rb, line 76
def self.newrelic?
  return !!ENV['NEWRELIC_TOKEN']
end
output_bucket() click to toggle source

Name of the S3 bucket to store output in.

@return [String]

# File lib/opener/webservice/configuration.rb, line 49
def self.output_bucket
  return ENV['OUTPUT_BUCKET']
end
rollbar?() click to toggle source

Returns `true` if Rollbar error tracking should be enabled.

@return [TrueClass|FalseClass]

# File lib/opener/webservice/configuration.rb, line 67
def self.rollbar?
  return !!ENV['ROLLBAR_TOKEN']
end
syslog?() click to toggle source

Returns `true` if Syslog should be enabled.

@return [TrueClass|FalseClass]

# File lib/opener/webservice/configuration.rb, line 58
def self.syslog?
  return !!ENV['ENABLE_SYSLOG'] && !ENV['ENABLE_SYSLOG'].empty?
end