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
34 35 36 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 34 def method request.method.to_s.upcase end |
#parameters ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 44 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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 57 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
38 39 40 41 42 |
# File 'lib/opensocial/auth/action_controller_request.rb', line 38 def uri uri = URI.parse(request.protocol + request.host + request.port_string + request.path) uri.query = nil uri.to_s end |