Sha256: 0048c19c845f34a4440f447373826f706827316cd9b28b092575fe64e958ebec

Contents?: true

Size: 820 Bytes

Versions: 38

Compression:

Stored size: 820 Bytes

Contents

unless RestClient.const_defined? :OAUTH_EXTENSION
  RestClient::OAUTH_EXTENSION = lambda do |request, args|
    if args[:oauth]
      uri             = URI.parse args[:url]
      default_options = { :site               => "#{uri.scheme}://#{uri.host}:#{uri.port.to_s}",
                          :request_token_path => "",
                          :authorize_path     => "",
                          :access_token_path  => "" }
      options         = default_options.merge args[:oauth][:options] || { }
      consumer        = OAuth::Consumer.new(args[:oauth][:consumer_key], args[:oauth][:consumer_secret], options)

      consumer.sign!(request)
    end
  end
end

unless RestClient.before_execution_procs.include? RestClient::OAUTH_EXTENSION
  RestClient.add_before_execution_proc &RestClient::OAUTH_EXTENSION
end

Version data entries

38 entries across 38 versions & 4 rubygems

Version Path
katello_api-0.0.5 lib/katello_api/rest_client_oauth.rb
katello_api-0.0.4 lib/katello_api/rest_client_oauth.rb
foreman_api-0.1.9 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.8 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.7 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.6 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.5 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.4 lib/foreman_api/rest_client_oauth.rb
katello_api-0.0.3 lib/katello_api/rest_client_oauth.rb
foreman_api-0.1.3 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.2 lib/foreman_api/rest_client_oauth.rb
katello_api-0.0.2 lib/katello_api/rest_client_oauth.rb
katello_api-0.0.1 lib/katello_api/rest_client_oauth.rb
foreman_api-0.1.1 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.1.0 lib/foreman_api/rest_client_oauth.rb
foreman_api-0.0.11 lib/foreman_api/rest_client_oauth.rb
apipie-rails-0.0.13 lib/apipie/client/rest_client_oauth.rb
apipie-rails-0.0.12 lib/apipie/client/rest_client_oauth.rb