Module: TorqueBox::Authentication

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

Class Method Summary (collapse)

Class Method Details

+ (Object) [](name)



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

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

+ (Object) default



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

def self.default
  self['default']
end

+ (Object) service_name(domain)



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

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

+ (Object) service_prefix



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

def self.service_prefix
  "torquebox.authentication"
end

+ (Object) torquebox_context



37
38
39
40
# File 'security/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