oauth 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oauth might be problematic. Click here for more details.

@@ -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
- @options = { :consumer => consumer,
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, @options.merge( { :request_uri => request_uri } ))
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_#{options[:scheme]}")
37
+ self.send("set_oauth_#{@oauth_options[:scheme]}")
37
38
  end
38
39
 
39
40
  def set_oauth_header
@@ -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)}"
@@ -2,7 +2,7 @@ module Oauth #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -4,3 +4,4 @@ require File.dirname(__FILE__) + '/../lib/oauth'
4
4
  def requests(request)
5
5
  Marshal.load(File.read(File.dirname(__FILE__) + '/fixtures/' + request))
6
6
  end
7
+
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.0
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-21 00:00:00 -08:00
15
+ date: 2008-01-29 00:00:00 -08:00
15
16
  default_executable:
16
17
  dependencies:
17
18
  - !ruby/object:Gem::Dependency