Sha256: 9762312d4e756074da70ba48ab251203638589f36905bc7553ba393eddf9efa7

Contents?: true

Size: 899 Bytes

Versions: 72

Compression:

Stored size: 899 Bytes

Contents

require 'xmpp4r'
require 'oauth/request_proxy/base'

module OAuth
  module RequestProxy
    class JabberRequest < OAuth::RequestProxy::Base
      proxies Jabber::Iq
      proxies Jabber::Presence
      proxies Jabber::Message

      def parameters
        return @params if @params

        @params = {}

        oauth = @request.get_elements('//oauth').first
        return @params unless oauth

        %w( oauth_token oauth_consumer_key oauth_signature_method oauth_signature
            oauth_timestamp oauth_nonce oauth_version ).each do |param|
          next unless element = oauth.first_element(param)
          @params[param] = element.text
        end

        @params
      end

      def method
        @request.name
      end

      def uri
        [@request.from.strip.to_s, @request.to.strip.to_s].join("&")
      end

      def normalized_uri
        uri
      end
    end
  end
end

Version data entries

72 entries across 69 versions & 24 rubygems

Version Path
sporkd-oauth-0.3.6 lib/oauth/request_proxy/jabber_request.rb
vincentchu-oauth-0.3.2.111 lib/oauth/request_proxy/jabber_request.rb
zmalltalker-oauth-0.3.1.7 lib/oauth/request_proxy/jabber_request.rb
oauth-instructure-0.4.10 lib/oauth/request_proxy/jabber_request.rb
oauth_weshays-0.4.8.pre2 lib/oauth/request_proxy/jabber_request.rb
oauth_weshays-0.4.8.pre lib/oauth/request_proxy/jabber_request.rb
oauth-instructure-0.4.9 lib/oauth/request_proxy/jabber_request.rb
oauth-instructure-0.4.8 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.7 lib/oauth/request_proxy/jabber_request.rb
motionbox-oauth-0.4.5 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.6 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.5 lib/oauth/request_proxy/jabber_request.rb
sayso-oauth-0.4.4.001 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.4 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.3 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.2 lib/oauth/request_proxy/jabber_request.rb
apigee-oauth-0.4.0 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.1 lib/oauth/request_proxy/jabber_request.rb
oauth-0.4.0 lib/oauth/request_proxy/jabber_request.rb
qoobaa-oauth-0.3.8 lib/oauth/request_proxy/jabber_request.rb