Sha256: 0e02a6486cd8dab1568a06bde161eb3d78689ca018de903ec4839a5085d7e1df

Contents?: true

Size: 1.5 KB

Versions: 14

Compression:

Stored size: 1.5 KB

Contents

module Merb::Test::Fixtures::Controllers

  class Testing < Merb::Controller
    self._template_root = File.dirname(__FILE__) / "views"
  end

  class BasicAuthentication < Testing
    before :authenticate, :only => :index

    def index
      "authenticated"
    end

    protected

    def authenticate
      basic_authentication { |u, p| u == "Fred" && p == "secret" }
    end
  end

  class BasicAuthenticationWithRealm < BasicAuthentication
    def authenticate
      basic_authentication("My Super App") { |u, p| u == "Fred" && p == "secret" }
    end
  end

  class AuthenticateBasicAuthentication < Testing
    def index
      basic_authentication.authenticate { |u, p| "Fred:secret" }
    end
  end

  class RequestBasicAuthentication < BasicAuthentication
    def authenticate
      basic_authentication.request
    end
  end

  class RequestBasicAuthenticationWithRealm < BasicAuthentication
    def authenticate
      basic_authentication("My SuperApp").request
    end
  end
  
  class PassiveBasicAuthentication < BasicAuthentication
        
    def index
      "My Output"
    end
    
    def authenticate
      basic_authentication.request!
    end
  end
  
  class PassiveBasicAuthenticationWithRealm < BasicAuthentication
    def authenticate
      basic_authentication("My Super App").request!
    end
  end
  
  class PassiveBasicAuthenticationInAction < BasicAuthentication
    
    def index
      basic_authentication.request!
      "In Action"
    end
    
    def authenticate
      true
    end
  end

end

Version data entries

14 entries across 8 versions & 1 rubygems

Version Path
merb-core-1.1.3 spec10/public/controller/controllers/authentication.rb
merb-core-1.1.3 spec/public/controller/controllers/authentication.rb
merb-core-1.1.2 spec10/public/controller/controllers/authentication.rb
merb-core-1.1.2 spec/public/controller/controllers/authentication.rb
merb-core-1.1.1 spec/public/controller/controllers/authentication.rb
merb-core-1.1.1 spec10/public/controller/controllers/authentication.rb
merb-core-1.1.0 spec/public/controller/controllers/authentication.rb
merb-core-1.1.0 spec10/public/controller/controllers/authentication.rb
merb-core-1.1.0.rc1 spec10/public/controller/controllers/authentication.rb
merb-core-1.1.0.rc1 spec/public/controller/controllers/authentication.rb
merb-core-1.1.0.pre spec10/public/controller/controllers/authentication.rb
merb-core-1.1.0.pre spec/public/controller/controllers/authentication.rb
merb-core-0.9.6 spec/public/controller/controllers/authentication.rb
merb-core-0.9.7 spec/public/controller/controllers/authentication.rb