Class: OAuth::RequestProxy::ActionControllerRequest
- Defined in:
- lib/oauth/request_proxy/action_controller_request.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #method ⇒ Object
- #parameters ⇒ Object
-
#parameters_for_signature ⇒ Object
Override from OAuth::RequestProxy::Base to avoid roundtrip conversion to Hash or Array and thus preserve the original parameter names.
- #uri ⇒ Object
Methods inherited from Base
#initialize, #non_oauth_parameters, #normalized_parameters, #normalized_uri, #oauth_callback, #oauth_consumer_key, #oauth_header, #oauth_nonce, #oauth_parameters, #oauth_signature, #oauth_signature_method, #oauth_timestamp, #oauth_token, #oauth_verifier, #oauth_version, proxies, #sign, #sign!, #signature_base_string, #signed?, #signed_uri
Methods included from Helper
#escape, #generate_key, #generate_timestamp, #normalize, #parse_header, #unescape
Constructor Details
This class inherits a constructor from OAuth::RequestProxy::Base
Instance Method Details
#method ⇒ Object
10 11 12 |
# File 'lib/oauth/request_proxy/action_controller_request.rb', line 10 def method request.method.to_s.upcase end |
#parameters ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/oauth/request_proxy/action_controller_request.rb', line 18 def parameters if [:clobber_request] [:parameters] || {} else params = request_params.merge(query_params).merge(header_params) params.stringify_keys! if params.respond_to?(:stringify_keys!) params.merge([:parameters] || {}) end end |
#parameters_for_signature ⇒ Object
Override from OAuth::RequestProxy::Base to avoid roundtrip conversion to Hash or Array and thus preserve the original parameter names
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/oauth/request_proxy/action_controller_request.rb', line 31 def parameters_for_signature params = [] params << [:parameters].to_query if [:parameters] unless [: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 |
#uri ⇒ Object
14 15 16 |
# File 'lib/oauth/request_proxy/action_controller_request.rb', line 14 def uri request.url end |