Class: Pasaporte::Auth::Cascade

Inherits:
Object
  • Object
show all
Defined in:
lib/pasaporte/auth/cascade.rb

Overview

Make an array of backends and try to authenticate against them all until true is returned. Otherwise deny.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCascade

Returns a new instance of Cascade.



5
6
7
# File 'lib/pasaporte/auth/cascade.rb', line 5

def initialize
  @backends = []
end

Instance Attribute Details

#backendsObject (readonly)

Returns the value of attribute backends.



4
5
6
# File 'lib/pasaporte/auth/cascade.rb', line 4

def backends
  @backends
end

Instance Method Details

#call(u, p, d) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/pasaporte/auth/cascade.rb', line 9

def call(u, p, d)
  @backends.each do | b | 
    Pasaporte::LOGGER.info("Running cascade auth against #{b}")
    b.call(u,p,d) || next
  end
  false
end