Sha256: 96773f5078274d15c40616ebcacc86f40131ae73ab6de707b9395bd846a42efc

Contents?: true

Size: 912 Bytes

Versions: 11

Compression:

Stored size: 912 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

11 entries across 11 versions & 4 rubygems

Version Path
monkeyhelper-oauth-0.3.1 lib/oauth/request_proxy/jabber_request.rb
pelle-oauth-0.3.0 lib/oauth/request_proxy/jabber_request.rb
pelle-oauth-0.3.1 lib/oauth/request_proxy/jabber_request.rb
proletarian-oauth-0.3.2 lib/oauth/request_proxy/jabber_request.rb
proletarian-oauth-0.3.3 lib/oauth/request_proxy/jabber_request.rb
proletarian-oauth-0.3.4 lib/oauth/request_proxy/jabber_request.rb
proletarian-oauth-0.3.5 lib/oauth/request_proxy/jabber_request.rb
proletarian-oauth-0.3.6 lib/oauth/request_proxy/jabber_request.rb
proletarian-oauth-0.3.7 lib/oauth/request_proxy/jabber_request.rb
oauth-0.3.1 lib/oauth/request_proxy/jabber_request.rb
oauth-0.3.0 lib/oauth/request_proxy/jabber_request.rb