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
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/oauth-0.5.6/lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.6 lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.5 lib/oauth/request_proxy/jabber_request.rb
tdiary-5.0.8 vendor/bundle/gems/oauth-0.5.4/lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.4 lib/oauth/request_proxy/jabber_request.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.3/lib/oauth/request_proxy/jabber_request.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy/jabber_request.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.3 lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.2 lib/oauth/request_proxy/jabber_request.rb
tdiary-5.0.4 vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.1 lib/oauth/request_proxy/jabber_request.rb
oauth-0.5.0 lib/oauth/request_proxy/jabber_request.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/oauth-0.4.7/lib/oauth/request_proxy/jabber_request.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/oauth-0.4.7/lib/oauth/request_proxy/jabber_request.rb
oauth-ap-0.4.8 lib/oauth/request_proxy/jabber_request.rb
greut-oauth-0.3.6 lib/oauth/request_proxy/jabber_request.rb
jwhitmire-oauth-0.3.6.1 lib/oauth/request_proxy/jabber_request.rb
metavida-oauth-0.3.2.1 lib/oauth/request_proxy/jabber_request.rb
metavida-oauth-0.3.2 lib/oauth/request_proxy/jabber_request.rb