omniauth-pinterest 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +3 -0
- data/Gemfile.lock +21 -14
- data/LICENSE.md +9 -0
- data/README.md +45 -8
- data/Rakefile +2 -2
- data/lib/omniauth/strategies/pinterest.rb +6 -11
- data/lib/omniauth-pinterest/version.rb +1 -1
- data/lib/omniauth-pinterest.rb +1 -1
- data/omniauth-pinterest.gemspec +6 -6
- data/spec/omniauth/strategies/pinterest_spec.rb +17 -2
- metadata +50 -30
- data/Guardfile +0 -11
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YzExZDYzMzU0ZTVjYzA0NmQ0MDY1Mjc5NTZmMDgxZjQxZDdhZGI3Mw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YjI4YzUwZTU3YjlmYzNjODQ5MWE0ZjQwMTcwMWI2MDE0YzFkMmE0ZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NGQ0NTVkMjg3Y2Q3MzdhN2M4NTM1NGM1OTJkNTkyOWIyMjc2NGFkMGZjZDkz
|
10
|
+
NDM3MzNhNGJkOThiN2VmZTY2MjFiNWZiNWNmZTM5YzliNjQ0YTE5MTQxYzdi
|
11
|
+
MGIzYTc3MTdkMTZiZDJiN2U1YmM3NmYwYjM0Njg1ZGMwMTk1NmM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
N2E2Zjg2ODAyYjA0YjVmMWJlOTU5ZDM0OGZmY2UwNmQyMTIwODNkMWE4YTRl
|
14
|
+
MTJhYjZkNjc4ZDkxZTg0ZGFhNzAyNDE0N2I4Yzg2MDhmODQ5NzRmZWM4MjM4
|
15
|
+
NjI4YTU4YjkzZDc3NDVhNmVjYzliNjIyN2IxNzM3YzI0YjUwZTM=
|
data/.gitignore
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omniauth-pinterest (1.0.
|
4
|
+
omniauth-pinterest (1.0.1)
|
5
5
|
omniauth (~> 1.0)
|
6
6
|
omniauth-oauth2 (~> 1.0)
|
7
7
|
|
@@ -11,10 +11,8 @@ GEM
|
|
11
11
|
addressable (2.2.7)
|
12
12
|
crack (0.3.1)
|
13
13
|
diff-lcs (1.1.3)
|
14
|
-
faraday (0.
|
15
|
-
|
16
|
-
multipart-post (~> 1.1)
|
17
|
-
rack (~> 1.1)
|
14
|
+
faraday (0.9.1)
|
15
|
+
multipart-post (>= 1.2, < 3)
|
18
16
|
ffi (1.0.11)
|
19
17
|
growl (1.0.3)
|
20
18
|
guard (1.0.1)
|
@@ -25,17 +23,23 @@ GEM
|
|
25
23
|
guard (>= 0.2.2)
|
26
24
|
guard-rspec (0.7.0)
|
27
25
|
guard (>= 0.10.0)
|
28
|
-
hashie (
|
26
|
+
hashie (3.4.2)
|
27
|
+
httpauth (0.2.1)
|
28
|
+
jwt (0.1.6)
|
29
|
+
multi_json (>= 1.0)
|
29
30
|
multi_json (1.2.0)
|
30
|
-
multipart-post (
|
31
|
-
oauth2 (0.
|
32
|
-
faraday (~> 0.
|
31
|
+
multipart-post (2.0.0)
|
32
|
+
oauth2 (0.8.1)
|
33
|
+
faraday (~> 0.8)
|
34
|
+
httpauth (~> 0.1)
|
35
|
+
jwt (~> 0.1.4)
|
33
36
|
multi_json (~> 1.0)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
rack (~> 1.2)
|
38
|
+
omniauth (1.2.2)
|
39
|
+
hashie (>= 1.2, < 4)
|
40
|
+
rack (~> 1.0)
|
41
|
+
omniauth-oauth2 (1.1.1)
|
42
|
+
oauth2 (~> 0.8.0)
|
39
43
|
omniauth (~> 1.0)
|
40
44
|
rack (1.4.1)
|
41
45
|
rack-test (0.6.1)
|
@@ -72,3 +76,6 @@ DEPENDENCIES
|
|
72
76
|
rspec (~> 2.7)
|
73
77
|
simplecov
|
74
78
|
webmock
|
79
|
+
|
80
|
+
BUNDLED WITH
|
81
|
+
1.10.6
|
data/LICENSE.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
## The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2015 Jonathan Markwell, endil GmbH and Intridea, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,18 +1,55 @@
|
|
1
1
|
# OmniAuth Pinterest
|
2
2
|
|
3
|
-
This
|
4
|
-
use it, you'll need to sign up for an OAuth2 Application ID and Secret
|
5
|
-
on the [Pinterest Developer website](http://pinterest.com/developers/api).
|
3
|
+
This gem contains the [OmniAuth](https://github.com/intridea/omniauth/) strategy for authenticating to [Pinterest](https://www.pinterest.com/).
|
6
4
|
|
7
|
-
##
|
5
|
+
## Preparation
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
1. Register and sign into the [Pinterest developer center](https://developers.pinterest.com/)
|
8
|
+
2. Create an [application](https://developers.pinterest.com/apps/) and note the **App ID** and the **App secret**
|
9
|
+
3. Make sure that you have already installed [OmniAuth](https://github.com/intridea/omniauth/wiki) into your application. Otherwise check out the [installation details](https://github.com/intridea/omniauth) and the [documentation](https://github.com/intridea/omniauth/wiki).
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this gem to your application's ```Gemfile```:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'omniauth-pinterest'
|
17
|
+
```
|
18
|
+
|
19
|
+
Execute the ```bundle``` command to install the gem.
|
20
|
+
|
21
|
+
Next, tell OmniAuth about the Pinterest provider. For a Ruby on Rails application, your ```config/initializers/omniauth.rb``` file should look like:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
25
|
+
provider :pinterest, ENV['PINTEREST_APP_ID'], ENV['PINTEREST_APP_SECRET']
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
After restarting your application, point the authenticating user to ```/auth/pinterest```, the rest will be handled by OmniAuth.
|
30
|
+
|
31
|
+
## Authentication hash
|
32
|
+
|
33
|
+
Here's an example authentication hash available in ```request.env['omniauth.auth']```:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
{
|
37
|
+
:provider => 'pinterest',
|
38
|
+
:uid => '1234',
|
39
|
+
:info => {
|
40
|
+
:id => "1234",
|
41
|
+
:url => "https://www.pinterest.com/jane_doe/",
|
42
|
+
:first_name: "Jane"
|
43
|
+
:last_name => "Doe"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
```
|
12
47
|
|
13
48
|
## License
|
14
49
|
|
15
|
-
|
50
|
+
(The MIT License)
|
51
|
+
|
52
|
+
Copyright (c) 2015 Jonathan Markwell, endil GmbH and Intridea, Inc.
|
16
53
|
|
17
54
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
18
55
|
|
data/Rakefile
CHANGED
@@ -4,9 +4,9 @@ module OmniAuth
|
|
4
4
|
module Strategies
|
5
5
|
class Pinterest < OmniAuth::Strategies::OAuth2
|
6
6
|
option :client_options, {
|
7
|
-
:site => 'https://pinterest.com',
|
8
|
-
:authorize_url => 'https://pinterest.com/oauth/
|
9
|
-
:token_url => 'https://api.pinterest.com/
|
7
|
+
:site => 'https://api.pinterest.com/',
|
8
|
+
:authorize_url => 'https://api.pinterest.com/oauth/',
|
9
|
+
:token_url => 'https://api.pinterest.com/v1/oauth/token'
|
10
10
|
}
|
11
11
|
|
12
12
|
def request_phase
|
@@ -17,17 +17,12 @@ module OmniAuth
|
|
17
17
|
|
18
18
|
uid { raw_info['id'] }
|
19
19
|
|
20
|
-
info
|
21
|
-
{
|
22
|
-
'nickname' => raw_info['username'],
|
23
|
-
'name' => raw_info['full_name'],
|
24
|
-
'image' => raw_info['image_url'],
|
25
|
-
}
|
26
|
-
end
|
20
|
+
info { raw_info }
|
27
21
|
|
28
22
|
def raw_info
|
29
|
-
@
|
23
|
+
@raw_info ||= access_token.get('/v1/me/').parsed['data']
|
30
24
|
end
|
25
|
+
|
31
26
|
end
|
32
27
|
end
|
33
28
|
end
|
data/lib/omniauth-pinterest.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
1
|
+
require 'omniauth-pinterest/version'
|
2
2
|
require 'omniauth/strategies/pinterest'
|
data/omniauth-pinterest.gemspec
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
require File.expand_path('../lib/omniauth-pinterest/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["Jonathan Markwell"]
|
6
|
-
gem.email = ["jonathan.markwell@gmail.com"]
|
5
|
+
gem.authors = ["Jonathan Markwell", "Niels Richter"]
|
6
|
+
gem.email = ["jonathan.markwell@gmail.com", "niels@endil.de"]
|
7
7
|
gem.description = %q{OmniAuth strategy for Pinterest.}
|
8
8
|
gem.summary = %q{OmniAuth strategy for Pinterest.}
|
9
9
|
gem.homepage = "https://github.com/jot/omniauth-pinterest"
|
10
|
+
gem.license = 'MIT'
|
10
11
|
|
11
12
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
13
|
gem.files = `git ls-files`.split("\n")
|
@@ -19,8 +20,7 @@ Gem::Specification.new do |gem|
|
|
19
20
|
gem.add_dependency 'omniauth-oauth2', '~> 1.0'
|
20
21
|
|
21
22
|
gem.add_development_dependency 'rspec', '~> 2.7'
|
22
|
-
gem.add_development_dependency 'rack-test'
|
23
|
-
gem.add_development_dependency 'webmock'
|
24
|
-
gem.add_development_dependency 'simplecov'
|
25
|
-
|
23
|
+
gem.add_development_dependency 'rack-test', '~> 0'
|
24
|
+
gem.add_development_dependency 'webmock', '~> 0'
|
25
|
+
gem.add_development_dependency 'simplecov', '~> 0'
|
26
26
|
end
|
@@ -1,7 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe OmniAuth::Strategies::Pinterest do
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
context 'client options' do
|
6
|
+
subject do
|
7
|
+
OmniAuth::Strategies::Pinterest.new({})
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should have correct site' do
|
11
|
+
subject.options.client_options.site.should eq('https://api.pinterest.com/')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should have correct authorize url' do
|
15
|
+
subject.options.client_options.authorize_url.should eq('https://api.pinterest.com/oauth/')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should have correct token url' do
|
19
|
+
subject.options.client_options.token_url.should eq('https://api.pinterest.com/v1/oauth/token')
|
20
|
+
end
|
6
21
|
end
|
7
22
|
end
|
metadata
CHANGED
@@ -1,92 +1,112 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-pinterest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jonathan Markwell
|
8
|
+
- Niels Richter
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement:
|
17
|
-
none: false
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
requirements:
|
19
18
|
- - ~>
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: '1.0'
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
version_requirements:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.0'
|
25
28
|
- !ruby/object:Gem::Dependency
|
26
29
|
name: omniauth-oauth2
|
27
|
-
requirement:
|
28
|
-
none: false
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
29
31
|
requirements:
|
30
32
|
- - ~>
|
31
33
|
- !ruby/object:Gem::Version
|
32
34
|
version: '1.0'
|
33
35
|
type: :runtime
|
34
36
|
prerelease: false
|
35
|
-
version_requirements:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.0'
|
36
42
|
- !ruby/object:Gem::Dependency
|
37
43
|
name: rspec
|
38
|
-
requirement:
|
39
|
-
none: false
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
40
45
|
requirements:
|
41
46
|
- - ~>
|
42
47
|
- !ruby/object:Gem::Version
|
43
48
|
version: '2.7'
|
44
49
|
type: :development
|
45
50
|
prerelease: false
|
46
|
-
version_requirements:
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '2.7'
|
47
56
|
- !ruby/object:Gem::Dependency
|
48
57
|
name: rack-test
|
49
|
-
requirement:
|
50
|
-
none: false
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
51
59
|
requirements:
|
52
|
-
- -
|
60
|
+
- - ~>
|
53
61
|
- !ruby/object:Gem::Version
|
54
62
|
version: '0'
|
55
63
|
type: :development
|
56
64
|
prerelease: false
|
57
|
-
version_requirements:
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
58
70
|
- !ruby/object:Gem::Dependency
|
59
71
|
name: webmock
|
60
|
-
requirement:
|
61
|
-
none: false
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
62
73
|
requirements:
|
63
|
-
- -
|
74
|
+
- - ~>
|
64
75
|
- !ruby/object:Gem::Version
|
65
76
|
version: '0'
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
69
84
|
- !ruby/object:Gem::Dependency
|
70
85
|
name: simplecov
|
71
|
-
requirement:
|
72
|
-
none: false
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
|
-
- -
|
88
|
+
- - ~>
|
75
89
|
- !ruby/object:Gem::Version
|
76
90
|
version: '0'
|
77
91
|
type: :development
|
78
92
|
prerelease: false
|
79
|
-
version_requirements:
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ~>
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
80
98
|
description: OmniAuth strategy for Pinterest.
|
81
99
|
email:
|
82
100
|
- jonathan.markwell@gmail.com
|
101
|
+
- niels@endil.de
|
83
102
|
executables: []
|
84
103
|
extensions: []
|
85
104
|
extra_rdoc_files: []
|
86
105
|
files:
|
106
|
+
- .gitignore
|
87
107
|
- Gemfile
|
88
108
|
- Gemfile.lock
|
89
|
-
-
|
109
|
+
- LICENSE.md
|
90
110
|
- README.md
|
91
111
|
- Rakefile
|
92
112
|
- lib/omniauth-pinterest.rb
|
@@ -96,28 +116,28 @@ files:
|
|
96
116
|
- spec/omniauth/strategies/pinterest_spec.rb
|
97
117
|
- spec/spec_helper.rb
|
98
118
|
homepage: https://github.com/jot/omniauth-pinterest
|
99
|
-
licenses:
|
119
|
+
licenses:
|
120
|
+
- MIT
|
121
|
+
metadata: {}
|
100
122
|
post_install_message:
|
101
123
|
rdoc_options: []
|
102
124
|
require_paths:
|
103
125
|
- lib
|
104
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
127
|
requirements:
|
107
128
|
- - ! '>='
|
108
129
|
- !ruby/object:Gem::Version
|
109
130
|
version: '0'
|
110
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
132
|
requirements:
|
113
133
|
- - ! '>='
|
114
134
|
- !ruby/object:Gem::Version
|
115
135
|
version: '0'
|
116
136
|
requirements: []
|
117
137
|
rubyforge_project:
|
118
|
-
rubygems_version:
|
138
|
+
rubygems_version: 2.4.8
|
119
139
|
signing_key:
|
120
|
-
specification_version:
|
140
|
+
specification_version: 4
|
121
141
|
summary: OmniAuth strategy for Pinterest.
|
122
142
|
test_files:
|
123
143
|
- spec/omniauth/strategies/pinterest_spec.rb
|
data/Guardfile
DELETED