class HttpTokenAuthenticationTest::DummyController

Public Instance Methods

display() click to toggle source
# File actionpack/test/controller/http_token_authentication_test.rb, line 15
def display
  render plain: "Definitely Maybe"
end
index() click to toggle source
# File actionpack/test/controller/http_token_authentication_test.rb, line 11
def index
  render plain: "Hello Secret"
end
show() click to toggle source
# File actionpack/test/controller/http_token_authentication_test.rb, line 19
def show
  render plain: "Only for loooooong credentials"
end

Private Instance Methods

authenticate() click to toggle source
# File actionpack/test/controller/http_token_authentication_test.rb, line 25
def authenticate
  authenticate_or_request_with_http_token do |token, _|
    token == "lifo"
  end
end
authenticate_long_credentials() click to toggle source
# File actionpack/test/controller/http_token_authentication_test.rb, line 39
def authenticate_long_credentials
  authenticate_or_request_with_http_token do |token, options|
    token == "1234567890123456789012345678901234567890" && options[:algorithm] == "test"
  end
end
authenticate_with_request() click to toggle source
# File actionpack/test/controller/http_token_authentication_test.rb, line 31
def authenticate_with_request
  if authenticate_with_http_token { |token, options| token == '"quote" pretty' && options[:algorithm] == "test" }
    @logged_in = true
  else
    request_http_token_authentication("SuperSecret", "Authentication Failed\n")
  end
end