omniauth-linkedin 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/Gemfile +9 -0
- data/Guardfile +11 -0
- data/Rakefile +5 -0
- data/example/Gemfile +5 -0
- data/example/config.ru +27 -0
- data/lib/omniauth-linkedin/version.rb +1 -1
- data/omniauth-linkedin.gemspec +4 -2
- data/spec/omniauth/strategies/linkedin_spec.rb +39 -0
- data/spec/spec_helper.rb +14 -0
- metadata +35 -6
data/.rspec
ADDED
data/Gemfile
CHANGED
@@ -4,3 +4,12 @@ source "http://rubygems.org"
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
gem 'omniauth-oauth', :git => 'https://github.com/intridea/omniauth-oauth.git'
|
7
|
+
|
8
|
+
group :development, :test do
|
9
|
+
gem 'guard'
|
10
|
+
gem 'guard-rspec'
|
11
|
+
gem 'guard-bundler'
|
12
|
+
gem 'growl'
|
13
|
+
gem 'rb-fsevent'
|
14
|
+
gem 'multi_json'
|
15
|
+
end
|
data/Guardfile
ADDED
data/Rakefile
CHANGED
data/example/Gemfile
ADDED
data/example/config.ru
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'sinatra/base'
|
3
|
+
require 'omniauth-linkedin'
|
4
|
+
|
5
|
+
class App < Sinatra::Base
|
6
|
+
get '/' do
|
7
|
+
redirect '/auth/linkedin'
|
8
|
+
end
|
9
|
+
|
10
|
+
get '/auth/:provider/callback' do
|
11
|
+
content_type 'application/json'
|
12
|
+
MultiJson.encode(request.env)
|
13
|
+
end
|
14
|
+
|
15
|
+
get '/auth/failure' do
|
16
|
+
content_type 'application/json'
|
17
|
+
MultiJson.encode(request.env)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
use Rack::Session::Cookie
|
22
|
+
|
23
|
+
use OmniAuth::Builder do
|
24
|
+
provider :linkedin, ENV['LINKEDIN_CONSUMER_KEY'], ENV['LINKEDIN_CONSUMER_SECRET']
|
25
|
+
end
|
26
|
+
|
27
|
+
run App.new
|
data/omniauth-linkedin.gemspec
CHANGED
@@ -16,8 +16,10 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
s.add_runtime_dependency 'omniauth-oauth', '~> 1.0.0
|
19
|
+
s.add_runtime_dependency 'omniauth-oauth', '~> 1.0.0'
|
20
20
|
|
21
|
-
s.add_development_dependency 'rspec', '~> 2.
|
21
|
+
s.add_development_dependency 'rspec', '~> 2.7.0'
|
22
22
|
s.add_development_dependency 'rake'
|
23
|
+
s.add_development_dependency 'webmock'
|
24
|
+
s.add_development_dependency 'rack-test'
|
23
25
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "OmniAuth::Strategies::LinkedIn" do
|
4
|
+
subject do
|
5
|
+
OmniAuth::Strategies::LinkedIn.new(nil, @options || {})
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should add a camelization for itself' do
|
9
|
+
OmniAuth::Utils.camelize('linkedin').should == 'LinkedIn'
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'client options' do
|
13
|
+
it 'has correct LinkedIn site' do
|
14
|
+
subject.options.client_options.site.should eq('https://api.linkedin.com')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'has correct request token path' do
|
18
|
+
subject.options.client_options.request_token_path.should eq('/uas/oauth/requestToken')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'has correct access token path' do
|
22
|
+
subject.options.client_options.access_token_path.should eq('/uas/oauth/accessToken')
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'has correct authorize url' do
|
26
|
+
subject.options.client_options.authorize_url.should eq('https://www.linkedin.com/uas/oauth/authenticate')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context '#uid' do
|
31
|
+
before :each do
|
32
|
+
subject.stub(:raw_info) { { 'id' => '123' } }
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'returns the id from raw_info' do
|
36
|
+
subject.uid.should eq('123')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
|
4
|
+
require 'rspec'
|
5
|
+
require 'rack/test'
|
6
|
+
require 'webmock/rspec'
|
7
|
+
require 'omniauth'
|
8
|
+
require 'omniauth-linkedin'
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.include WebMock::API
|
12
|
+
config.include Rack::Test::Methods
|
13
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
14
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: omniauth-linkedin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alan Skorkin
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-11-
|
13
|
+
date: 2011-11-16 00:00:00 +11:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
requirements:
|
22
22
|
- - ~>
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 1.0.0
|
24
|
+
version: 1.0.0
|
25
25
|
type: :runtime
|
26
26
|
version_requirements: *id001
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 2.
|
35
|
+
version: 2.7.0
|
36
36
|
type: :development
|
37
37
|
version_requirements: *id002
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -46,6 +46,28 @@ dependencies:
|
|
46
46
|
version: "0"
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: webmock
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: rack-test
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id005
|
49
71
|
description: LinkedIn strategy for OmniAuth.
|
50
72
|
email:
|
51
73
|
- alan@skorks.com
|
@@ -57,14 +79,20 @@ extra_rdoc_files: []
|
|
57
79
|
|
58
80
|
files:
|
59
81
|
- .gitignore
|
82
|
+
- .rspec
|
60
83
|
- .rvmrc
|
61
84
|
- Gemfile
|
85
|
+
- Guardfile
|
62
86
|
- README.md
|
63
87
|
- Rakefile
|
88
|
+
- example/Gemfile
|
89
|
+
- example/config.ru
|
64
90
|
- lib/omniauth-linkedin.rb
|
65
91
|
- lib/omniauth-linkedin/version.rb
|
66
92
|
- lib/omniauth/strategies/linkedin.rb
|
67
93
|
- omniauth-linkedin.gemspec
|
94
|
+
- spec/omniauth/strategies/linkedin_spec.rb
|
95
|
+
- spec/spec_helper.rb
|
68
96
|
has_rdoc: true
|
69
97
|
homepage: https://github.com/skorks/omniauth-linkedin
|
70
98
|
licenses: []
|
@@ -93,5 +121,6 @@ rubygems_version: 1.6.2
|
|
93
121
|
signing_key:
|
94
122
|
specification_version: 3
|
95
123
|
summary: LinkedIn strategy for OmniAuth.
|
96
|
-
test_files:
|
97
|
-
|
124
|
+
test_files:
|
125
|
+
- spec/omniauth/strategies/linkedin_spec.rb
|
126
|
+
- spec/spec_helper.rb
|