Class OAuth::RequestProxy::ActionControllerRequest
In: lib/oauth/request_proxy/action_controller_request.rb
Parent: OAuth::RequestProxy::Base

Methods

Public Instance methods

[Source]

# File lib/oauth/request_proxy/action_controller_request.rb, line 10
    def method
      request.method.to_s.upcase
    end

[Source]

# File lib/oauth/request_proxy/action_controller_request.rb, line 18
    def parameters
      if options[:clobber_request]
        options[:parameters] || {}
      else
        params = request_params.merge(query_params).merge(header_params)
        params.stringify_keys! if params.respond_to?(:stringify_keys!)
        params.merge(options[:parameters] || {})
      end
    end

Override from OAuth::RequestProxy::Base to avoid roundtrip conversion to Hash or Array and thus preserve the original parameter names

[Source]

# File lib/oauth/request_proxy/action_controller_request.rb, line 31
    def parameters_for_signature
      params = []
      params << options[:parameters].to_query if options[:parameters]

      unless options[:clobber_request]
        params << header_params.to_query
        params << request.query_string unless request.query_string.blank?
        if request.post? && request.content_type == Mime::Type.lookup("application/x-www-form-urlencoded")
          params << request.raw_post
        end
      end

      params.
        join('&').split('&').
        reject(&:blank?).
        map { |p| p.split('=').map{|esc| CGI.unescape(esc)} }.
        reject { |kv| kv[0] == 'oauth_signature'}
    end

[Source]

# File lib/oauth/request_proxy/action_controller_request.rb, line 14
    def uri
      request.url
    end

Protected Instance methods

[Source]

# File lib/oauth/request_proxy/action_controller_request.rb, line 52
    def query_params
      request.query_parameters
    end

[Source]

# File lib/oauth/request_proxy/action_controller_request.rb, line 56
    def request_params
      request.request_parameters
    end

[Validate]