oauth2 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/Rakefile +18 -14
- data/VERSION +1 -1
- data/lib/oauth2/strategy/web_server.rb +8 -1
- data/oauth2.gemspec +5 -5
- data/spec/oauth2/strategy/web_server_spec.rb +2 -2
- metadata +6 -4
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 0.0.10 (June 19)
|
2
|
+
|
3
|
+
* Handle ActiveSupport JSON case where incompatible string does not raise an error. (via Flameeyes)
|
4
|
+
* Depend on latest version of MultiJSON.
|
5
|
+
|
1
6
|
== 0.0.9 (June 18)
|
2
7
|
|
3
8
|
* Support a JSON token response with swappable JSON parser via MultiJSON.
|
data/Rakefile
CHANGED
@@ -11,30 +11,34 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/intridea/oauth2"
|
12
12
|
gem.authors = ["Michael Bleigh"]
|
13
13
|
gem.add_dependency 'faraday', '~> 0.4.1'
|
14
|
-
gem.add_dependency 'multi_json'
|
14
|
+
gem.add_dependency 'multi_json', '>= 0.0.4'
|
15
15
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
16
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
17
|
end
|
18
18
|
Jeweler::GemcutterTasks.new
|
19
|
+
|
20
|
+
task :spec => :check_dependencies
|
19
21
|
rescue LoadError
|
20
22
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
21
23
|
end
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
spec
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
-
spec.libs << 'lib' << 'spec'
|
31
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
-
spec.rcov = true
|
33
|
-
end
|
25
|
+
begin
|
26
|
+
require 'spec/rake/spectask'
|
27
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
28
|
+
spec.libs << 'lib' << 'spec'
|
29
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
30
|
+
end
|
34
31
|
|
35
|
-
|
32
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
33
|
+
spec.libs << 'lib' << 'spec'
|
34
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
35
|
+
spec.rcov = true
|
36
|
+
end
|
36
37
|
|
37
|
-
task :default => :spec
|
38
|
+
task :default => :spec
|
39
|
+
rescue LoadError
|
40
|
+
puts "RSpec (or a dependency) not available. Install it with: gem install rspec"
|
41
|
+
end
|
38
42
|
|
39
43
|
require 'rake/rdoctask'
|
40
44
|
Rake::RDocTask.new do |rdoc|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
@@ -13,7 +13,14 @@ module OAuth2
|
|
13
13
|
# endpoints.
|
14
14
|
def get_access_token(code, options = {})
|
15
15
|
response = @client.request(:post, @client.access_token_url, access_token_params(code, options))
|
16
|
-
|
16
|
+
|
17
|
+
params = MultiJson.decode(response) rescue nil
|
18
|
+
# the ActiveSupport JSON parser won't cause an exception when
|
19
|
+
# given a formencoded string, so make sure that it was
|
20
|
+
# actually parsed in an Hash. This covers even the case where
|
21
|
+
# it caused an exception since it'll still be nil.
|
22
|
+
params = Rack::Utils.parse_query(response) unless params.is_a? Hash
|
23
|
+
|
17
24
|
access = params['access_token']
|
18
25
|
refresh = params['refresh_token']
|
19
26
|
expires_in = params['expires_in']
|
data/oauth2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{oauth2}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Bleigh"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-19}
|
13
13
|
s.description = %q{A Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth gem.}
|
14
14
|
s.email = %q{michael@intridea.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -58,16 +58,16 @@ Gem::Specification.new do |s|
|
|
58
58
|
|
59
59
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
60
60
|
s.add_runtime_dependency(%q<faraday>, ["~> 0.4.1"])
|
61
|
-
s.add_runtime_dependency(%q<multi_json>, [">= 0"])
|
61
|
+
s.add_runtime_dependency(%q<multi_json>, [">= 0.0.4"])
|
62
62
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
63
63
|
else
|
64
64
|
s.add_dependency(%q<faraday>, ["~> 0.4.1"])
|
65
|
-
s.add_dependency(%q<multi_json>, [">= 0"])
|
65
|
+
s.add_dependency(%q<multi_json>, [">= 0.0.4"])
|
66
66
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
67
67
|
end
|
68
68
|
else
|
69
69
|
s.add_dependency(%q<faraday>, ["~> 0.4.1"])
|
70
|
-
s.add_dependency(%q<multi_json>, [">= 0"])
|
70
|
+
s.add_dependency(%q<multi_json>, [">= 0.0.4"])
|
71
71
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
72
72
|
end
|
73
73
|
end
|
@@ -34,8 +34,8 @@ describe OAuth2::Strategy::WebServer do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
|
37
|
+
%w(json formencoded).each do |mode|
|
38
|
+
describe "#get_access_token (#{mode})" do
|
39
39
|
before do
|
40
40
|
@mode = mode
|
41
41
|
@access = subject.get_access_token('sushi')
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 10
|
9
|
+
version: 0.0.10
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Bleigh
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-19 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,9 @@ dependencies:
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
segments:
|
42
42
|
- 0
|
43
|
-
|
43
|
+
- 0
|
44
|
+
- 4
|
45
|
+
version: 0.0.4
|
44
46
|
type: :runtime
|
45
47
|
version_requirements: *id002
|
46
48
|
- !ruby/object:Gem::Dependency
|