Module: TorqueBox::Authentication

Defined in:
lib/torquebox/security/authentication.rb

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



20
21
22
23
# File 'lib/torquebox/security/authentication.rb', line 20

def self.[](name)
  return nil unless torquebox_context
  Authenticator.new( ::TorqueBox::ServiceRegistry.lookup( service_name( name ) ) )
end

.defaultObject



25
26
27
# File 'lib/torquebox/security/authentication.rb', line 25

def self.default
  self['default']
end

.service_name(domain) ⇒ Object



29
30
31
# File 'lib/torquebox/security/authentication.rb', line 29

def self.service_name(domain)
  "#{service_prefix}.#{torquebox_context}.#{domain}"
end

.service_prefixObject



33
34
35
# File 'lib/torquebox/security/authentication.rb', line 33

def self.service_prefix
  "torquebox.authentication"
end

.torquebox_contextObject



37
38
39
40
# File 'lib/torquebox/security/authentication.rb', line 37

def self.torquebox_context
  $stderr.puts "ERROR: TorqueBox application context not available" unless ENV['TORQUEBOX_APP_NAME']
  ENV['TORQUEBOX_APP_NAME']
end