Class: OAuth::RequestProxy::ActionControllerRequest
- Inherits:
-
Base
- Object
- Base
- OAuth::RequestProxy::ActionControllerRequest
- Defined in:
- lib/opensocial/auth/action_controller_request.rb
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
Instance Method Details
#method ⇒ Object
40 41 42 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 40 def method request.method.to_s.upcase end |
#parameters ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 50 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
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 63 def parameters_for_signature params = [] params << [:parameters].to_query if [:parameters] unless [:clobber_request] params << header_params.to_query params << CGI.unescape(request.query_string) unless request.query_string.blank? if request.content_type == Mime::Type.lookup("application/x-www-form-urlencoded") params << CGI.unescape(request.raw_post) end end params. join('&').split('&'). reject { |kv| kv =~ /^oauth_signature=.*/}. reject(&:blank?). map { |p| p.split('=') } end |
#uri ⇒ Object
44 45 46 47 48 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 44 def uri uri = URI.parse(request.protocol + request.host + request.port_string + request.path) uri.query = nil uri.to_s end |