Class: Pasaporte::Auth::Cascade
- Inherits:
-
Object
- Object
- Pasaporte::Auth::Cascade
- 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
-
#backends ⇒ Object
readonly
Returns the value of attribute backends.
Instance Method Summary collapse
- #call(u, p, d) ⇒ Object
-
#initialize ⇒ Cascade
constructor
A new instance of Cascade.
Constructor Details
#initialize ⇒ Cascade
Returns a new instance of Cascade.
5 6 7 |
# File 'lib/pasaporte/auth/cascade.rb', line 5 def initialize @backends = [] end |
Instance Attribute Details
#backends ⇒ Object (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 |