omniauth-oauth 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -57,7 +57,7 @@ That's pretty much it!
57
57
 
58
58
  ## License
59
59
 
60
- Copyright (C) 2011 by Michael Bleigh and Intridea, Inc.
60
+ Copyright (C) 2012 by Michael Bleigh and Intridea, Inc.
61
61
 
62
62
  Permission is hereby granted, free of charge, to any person obtaining a copy
63
63
  of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module OAuth
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -14,6 +14,7 @@ module OmniAuth
14
14
  option :open_timeout, 30
15
15
  option :read_timeout, 30
16
16
  option :authorize_params, {}
17
+ option :request_params, {}
17
18
 
18
19
  attr_reader :access_token
19
20
 
@@ -25,7 +26,7 @@ module OmniAuth
25
26
  end
26
27
 
27
28
  def request_phase
28
- request_token = consumer.get_request_token(:oauth_callback => callback_url)
29
+ request_token = consumer.get_request_token({:oauth_callback => callback_url}, options.request_params)
29
30
  session['oauth'] ||= {}
30
31
  session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
31
32
 
@@ -61,7 +62,7 @@ module OmniAuth
61
62
  fail!(:service_unavailable, e)
62
63
  rescue ::OAuth::Unauthorized => e
63
64
  fail!(:invalid_credentials, e)
64
- rescue ::NoMethodError, ::MultiJson::DecodeError => e
65
+ rescue ::MultiJson::DecodeError => e
65
66
  fail!(:invalid_response, e)
66
67
  rescue ::OmniAuth::NoSessionError => e
67
68
  fail!(:session_expired, e)
@@ -12,6 +12,7 @@ describe "OmniAuth::Strategies::OAuth" do
12
12
  use OmniAuth::Builder do
13
13
  provider MyOAuthProvider, 'abc', 'def', :client_options => {:site => 'https://api.example.org'}, :name => 'example.org'
14
14
  provider MyOAuthProvider, 'abc', 'def', :client_options => {:site => 'https://api.example.org'}, :authorize_params => {:abc => 'def'}, :name => 'example.org_with_authorize_params'
15
+ provider MyOAuthProvider, 'abc', 'def', :client_options => {:site => 'https://api.example.org'}, :request_params => {:scope => 'http://foobar.example.org'}, :name => 'example.org_with_request_params'
15
16
  end
16
17
  run lambda { |env| [404, {'Content-Type' => 'text/plain'}, [env.key?('omniauth.auth').to_s]] }
17
18
  }.to_app
@@ -53,6 +54,12 @@ describe "OmniAuth::Strategies::OAuth" do
53
54
  it 'should set appropriate session variables' do
54
55
  session['oauth'].should == {"example.org" => {'callback_confirmed' => true, 'request_token' => 'yourtoken', 'request_secret' => 'yoursecret'}}
55
56
  end
57
+
58
+ it 'should pass request_params to get_request_token' do
59
+ get '/auth/example.org_with_request_params'
60
+ WebMock.should have_requested(:post, 'https://api.example.org/oauth/request_token').
61
+ with {|req| req.body == "scope=http%3a%2f%2ffoobar.example.org" }
62
+ end
56
63
  end
57
64
 
58
65
  context 'unsuccessful' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-02 00:00:00.000000000Z
12
+ date: 2012-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &70104089058840 !ruby/object:Gem::Requirement
16
+ requirement: &70329159031760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70104089058840
24
+ version_requirements: *70329159031760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth
27
- requirement: &70104089054580 !ruby/object:Gem::Requirement
27
+ requirement: &70329159031340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70104089054580
35
+ version_requirements: *70329159031340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70104089052540 !ruby/object:Gem::Requirement
38
+ requirement: &70329159030800 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.6'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70104089052540
46
+ version_requirements: *70329159030800
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: webmock
49
- requirement: &70104089049860 !ruby/object:Gem::Requirement
49
+ requirement: &70329159030380 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70104089049860
57
+ version_requirements: *70329159030380
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simplecov
60
- requirement: &70104089047940 !ruby/object:Gem::Requirement
60
+ requirement: &70329159029920 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70104089047940
68
+ version_requirements: *70329159029920
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rack-test
71
- requirement: &70104089046440 !ruby/object:Gem::Requirement
71
+ requirement: &70329159029500 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70104089046440
79
+ version_requirements: *70329159029500
80
80
  description: A generic OAuth (1.0/1.0a) strategy for OmniAuth.
81
81
  email:
82
82
  - michael@intridea.com
@@ -116,10 +116,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 1.8.10
119
+ rubygems_version: 1.8.11
120
120
  signing_key:
121
121
  specification_version: 3
122
122
  summary: A generic OAuth (1.0/1.0a) strategy for OmniAuth.
123
123
  test_files:
124
124
  - spec/omniauth/strategies/oauth_spec.rb
125
125
  - spec/spec_helper.rb
126
+ has_rdoc: