oauth 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of oauth might be problematic. Click here for more details.
- data/config/hoe.rb +1 -1
- data/lib/oauth/client/action_controller_request.rb +7 -6
- data/lib/oauth/signature/base.rb +5 -1
- data/lib/oauth/version.rb +1 -1
- data/test/test_helper.rb +1 -0
- metadata +3 -2
data/config/hoe.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'oauth/version'
|
2
2
|
|
3
|
-
AUTHOR = ['Pelle Braendgaard','Blaine Cook','Larry Halff'] # can also be an array of Authors
|
3
|
+
AUTHOR = ['Pelle Braendgaard','Blaine Cook','Larry Halff','Jesse Clark'] # can also be an array of Authors
|
4
4
|
EMAIL = "pelleb@gmail.com"
|
5
5
|
DESCRIPTION = "OAuth Core Ruby implementation"
|
6
6
|
GEM_NAME = 'oauth' # what ppl will type to install your gem
|
@@ -4,8 +4,9 @@ require 'action_controller/test_process'
|
|
4
4
|
|
5
5
|
module ActionController
|
6
6
|
class Base
|
7
|
-
def process_with_oauth(request)
|
7
|
+
def process_with_oauth(request,response=nil)
|
8
8
|
request.apply_oauth!
|
9
|
+
process_without_oauth(request,response)
|
9
10
|
end
|
10
11
|
|
11
12
|
alias_method_chain :process, :oauth
|
@@ -17,11 +18,11 @@ module ActionController
|
|
17
18
|
end
|
18
19
|
|
19
20
|
def self.use_oauth?
|
20
|
-
@use_oauth
|
21
|
+
@use_oauth
|
21
22
|
end
|
22
23
|
|
23
24
|
def configure_oauth(consumer = nil, token = nil, options = {})
|
24
|
-
@
|
25
|
+
@oauth_options = { :consumer => consumer,
|
25
26
|
:token => token,
|
26
27
|
:scheme => 'header',
|
27
28
|
:signature_method => nil,
|
@@ -30,10 +31,10 @@ module ActionController
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def apply_oauth!
|
33
|
-
return unless ActionController::TestRequest.use_oauth?
|
34
|
-
@oauth_helper = OAuth::Client::Helper.new(self, @
|
34
|
+
return unless ActionController::TestRequest.use_oauth? && @oauth_options
|
35
|
+
@oauth_helper = OAuth::Client::Helper.new(self, @oauth_options.merge( { :request_uri => request_uri } ))
|
35
36
|
|
36
|
-
self.send("set_oauth_#{
|
37
|
+
self.send("set_oauth_#{@oauth_options[:scheme]}")
|
37
38
|
end
|
38
39
|
|
39
40
|
def set_oauth_header
|
data/lib/oauth/signature/base.rb
CHANGED
@@ -22,7 +22,7 @@ module OAuth::Signature
|
|
22
22
|
raise TypeError unless request.kind_of?(OAuth::RequestProxy::Base)
|
23
23
|
@request = request
|
24
24
|
if block_given?
|
25
|
-
@token_secret, @consumer_secret = yield block.arity == 1 ? token : [token, consumer_key]
|
25
|
+
@token_secret, @consumer_secret = yield block.arity == 1 ? token : [token, consumer_key,nonce,request.timestamp]
|
26
26
|
else
|
27
27
|
@consumer_secret = options[:consumer].secret
|
28
28
|
@token_secret = options[:token] ? options[:token].secret : ''
|
@@ -56,6 +56,10 @@ module OAuth::Signature
|
|
56
56
|
def consumer_key
|
57
57
|
request.consumer_key
|
58
58
|
end
|
59
|
+
|
60
|
+
def nonce
|
61
|
+
request.nonce
|
62
|
+
end
|
59
63
|
|
60
64
|
def secret
|
61
65
|
"#{escape(consumer_secret)}&#{escape(token_secret)}"
|
data/lib/oauth/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pelle Braendgaard
|
8
8
|
- Blaine Cook
|
9
9
|
- Larry Halff
|
10
|
+
- Jesse Clark
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
14
|
|
14
|
-
date: 2008-01-
|
15
|
+
date: 2008-01-29 00:00:00 -08:00
|
15
16
|
default_executable:
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|