From 234fd8793b0582715e1b238e8ee354202d81dd3a Mon Sep 17 00:00:00 2001 From: Michal Papis Date: Wed, 5 Nov 2014 15:48:43 +0100 Subject: [PATCH] add IGNORED_KEYS for options used in signature calculations --- lib/simple_oauth/header.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/simple_oauth/header.rb b/lib/simple_oauth/header.rb index 25d4d1a..ea3f7bf 100644 --- a/lib/simple_oauth/header.rb +++ b/lib/simple_oauth/header.rb @@ -6,6 +6,9 @@ require 'cgi' module SimpleOAuth class Header ATTRIBUTE_KEYS = [:callback, :consumer_key, :nonce, :signature_method, :timestamp, :token, :verifier, :version] unless defined? ::SimpleOAuth::Header::ATTRIBUTE_KEYS + + IGNORED_KEYS = [:consumer_secret, :token_secret] unless defined? ::SimpleOAuth::Header::IGNORED_KEYS + attr_reader :method, :params, :options class << self @@ -82,6 +85,7 @@ module SimpleOAuth def attributes matching_keys, extra_keys = options.keys.partition { |key| ATTRIBUTE_KEYS.include?(key) } + extra_keys -= IGNORED_KEYS if options[:ignore_extra_keys] || extra_keys.empty? Hash[options.select { |key, _value| matching_keys.include?(key) }.collect { |key, value| [:"oauth_#{key}", value] }] else