Module: ExvoAuth::Config

Defined in:
lib/exvo_auth/config.rb

Class Method Summary collapse

Class Method Details

.callback_keyObject


27
28
29
# File 'lib/exvo_auth/config.rb', line 27

def self.callback_key
  @@callback_key ||= '_callback'
end

.callback_key=(callback_key) ⇒ Object


31
32
33
# File 'lib/exvo_auth/config.rb', line 31

def self.callback_key=(callback_key)
  @@callback_key = callback_key
end

.client_idObject


35
36
37
# File 'lib/exvo_auth/config.rb', line 35

def self.client_id
  @@client_id ||= ENV['AUTH_CLIENT_ID']
end

.client_id=(client_id) ⇒ Object


39
40
41
# File 'lib/exvo_auth/config.rb', line 39

def self.client_id=(client_id)
  @@client_id = client_id
end

.client_secretObject


43
44
45
# File 'lib/exvo_auth/config.rb', line 43

def self.client_secret
  @@client_secret ||= ENV['AUTH_CLIENT_SECRET']
end

.client_secret=(client_secret) ⇒ Object


47
48
49
# File 'lib/exvo_auth/config.rb', line 47

def self.client_secret=(client_secret)
  @@client_secret = client_secret
end

.debugObject


2
3
4
# File 'lib/exvo_auth/config.rb', line 2

def self.debug
  @@debug ||= (ENV['AUTH_DEBUG'] == 'true') || false
end

.debug=(debug) ⇒ Object


6
7
8
# File 'lib/exvo_auth/config.rb', line 6

def self.debug=(debug)
  @@debug = debug
end

.envObject


59
60
61
62
63
# File 'lib/exvo_auth/config.rb', line 59

def self.env
  @@env ||= Rails.env if defined?(Rails)
  @@env ||= Merb.env if defined?(Merb)
  @@env
end

.env=(env) ⇒ Object


65
66
67
# File 'lib/exvo_auth/config.rb', line 65

def self.env=(env)
  @@env = env
end

.hostObject


10
11
12
# File 'lib/exvo_auth/config.rb', line 10

def self.host
  @@host ||= ENV['AUTH_HOST'] || default_opts[env.to_sym][:host]
end

.host=(host) ⇒ Object


14
15
16
# File 'lib/exvo_auth/config.rb', line 14

def self.host=(host)
  @@host = host
end

.require_sslObject


51
52
53
# File 'lib/exvo_auth/config.rb', line 51

def self.require_ssl
  @@require_ssl ||= (ENV['AUTH_REQUIRE_SSL'] == 'true') || default_opts[env.to_sym][:require_ssl]
end

.require_ssl=(require_ssl) ⇒ Object


55
56
57
# File 'lib/exvo_auth/config.rb', line 55

def self.require_ssl=(require_ssl)
  @@require_ssl = require_ssl
end

.uriObject


18
19
20
21
22
23
24
25
# File 'lib/exvo_auth/config.rb', line 18

def self.uri
  if host =~ /^http(s)*/
    # Legacy compatibility, when `host` was incorrectly used as `uri`
    host
  else
    require_ssl ? "https://#{host}" : "http://#{host}"
  end
end