omniauth-bitbucket 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +1 -2
- data/README.md +45 -10
- data/{exmaples → examples}/test.rb +0 -0
- data/lib/omniauth-bitbucket/version.rb +1 -1
- data/lib/omniauth/strategies/bitbucket.rb +3 -2
- data/omniauth-bitbucket.gemspec +4 -1
- metadata +80 -17
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,21 +1,56 @@
|
|
1
1
|
# OmniAuth Bitbucket
|
2
2
|
|
3
|
-
This is the OmniAuth strategy for authenticating to Bitbucket.
|
4
|
-
use it, you'll need to
|
5
|
-
|
3
|
+
This is the OmniAuth strategy for authenticating to [Bitbucket](https://bitbucket.org).
|
4
|
+
To use it, you'll need to signup and create a new application or use your
|
5
|
+
existing OAuth consumer and secret keys.
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
Add dependency to your Gemfile:
|
10
|
+
|
11
|
+
```
|
12
|
+
gem 'omniauth-bitbucket'
|
13
|
+
```
|
14
|
+
|
15
|
+
Or install manually:
|
16
|
+
|
17
|
+
```
|
18
|
+
gem install omniauth-bitbucket
|
19
|
+
```
|
6
20
|
|
7
21
|
## Basic Usage
|
8
22
|
|
9
|
-
|
10
|
-
|
11
|
-
|
23
|
+
```ruby
|
24
|
+
use OmniAuth::Builder do
|
25
|
+
provider :bitbucket, ENV['BITBUCKET_KEY'], ENV['BITBUCKET_SECRET']
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
If using Rails, add an initializer `config/initializers/omniauth.rb`:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
33
|
+
provider :bitbucket, 'BITBUCKET_KEY', 'BITBUCKET_SECRET'
|
34
|
+
end
|
35
|
+
```
|
12
36
|
|
13
37
|
## License
|
14
38
|
|
15
|
-
Copyright (c) 2011 Dingding Ye.
|
39
|
+
Copyright (c) 2011-2013 Dingding Ye.
|
16
40
|
|
17
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
41
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
42
|
+
this software and associated documentation files (the "Software"), to deal in
|
43
|
+
the Software without restriction, including without limitation the rights to
|
44
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
45
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
46
|
+
subject to the following conditions:
|
18
47
|
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
48
|
+
The above copyright notice and this permission notice shall be included in all
|
49
|
+
copies or substantial portions of the Software.
|
20
50
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
52
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
53
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
54
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
55
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
56
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
File without changes
|
@@ -30,8 +30,9 @@ module OmniAuth
|
|
30
30
|
def raw_info
|
31
31
|
@raw_info ||= begin
|
32
32
|
ri = MultiJson.decode(access_token.get('/api/1.0/user').body)['user']
|
33
|
-
email =
|
34
|
-
ri.merge('email' => email) if email
|
33
|
+
email = MultiJson.decode(access_token.get('/api/1.0/emails').body).find { |email| email['primary'] }
|
34
|
+
ri.merge!('email' => email['email']) if email
|
35
|
+
ri
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
data/omniauth-bitbucket.gemspec
CHANGED
@@ -17,10 +17,13 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
19
|
# specify any dependencies here; for example:
|
20
|
-
s.add_dependency 'omniauth', '~> 1.
|
20
|
+
s.add_dependency 'omniauth', '~> 1.1'
|
21
21
|
s.add_dependency 'omniauth-oauth', '~> 1.0'
|
22
|
+
s.add_dependency 'multi_json', '~> 1.7'
|
23
|
+
|
22
24
|
s.add_development_dependency 'rspec', '~> 2.7'
|
23
25
|
s.add_development_dependency 'rack-test'
|
24
26
|
s.add_development_dependency 'simplecov'
|
25
27
|
s.add_development_dependency 'webmock'
|
28
|
+
s.add_development_dependency 'rake'
|
26
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-bitbucket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,27 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.1'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: omniauth-oauth
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,10 +37,31 @@ dependencies:
|
|
32
37
|
version: '1.0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: multi_json
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.7'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
36
62
|
- !ruby/object:Gem::Dependency
|
37
63
|
name: rspec
|
38
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
39
65
|
none: false
|
40
66
|
requirements:
|
41
67
|
- - ~>
|
@@ -43,10 +69,15 @@ dependencies:
|
|
43
69
|
version: '2.7'
|
44
70
|
type: :development
|
45
71
|
prerelease: false
|
46
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '2.7'
|
47
78
|
- !ruby/object:Gem::Dependency
|
48
79
|
name: rack-test
|
49
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
50
81
|
none: false
|
51
82
|
requirements:
|
52
83
|
- - ! '>='
|
@@ -54,10 +85,15 @@ dependencies:
|
|
54
85
|
version: '0'
|
55
86
|
type: :development
|
56
87
|
prerelease: false
|
57
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
58
94
|
- !ruby/object:Gem::Dependency
|
59
95
|
name: simplecov
|
60
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
61
97
|
none: false
|
62
98
|
requirements:
|
63
99
|
- - ! '>='
|
@@ -65,10 +101,15 @@ dependencies:
|
|
65
101
|
version: '0'
|
66
102
|
type: :development
|
67
103
|
prerelease: false
|
68
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
69
110
|
- !ruby/object:Gem::Dependency
|
70
111
|
name: webmock
|
71
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
72
113
|
none: false
|
73
114
|
requirements:
|
74
115
|
- - ! '>='
|
@@ -76,7 +117,28 @@ dependencies:
|
|
76
117
|
version: '0'
|
77
118
|
type: :development
|
78
119
|
prerelease: false
|
79
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rake
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
80
142
|
description: OmniAuth strategy for Bitbucket.
|
81
143
|
email:
|
82
144
|
- yedingding@gmail.com
|
@@ -89,7 +151,7 @@ files:
|
|
89
151
|
- Guardfile
|
90
152
|
- README.md
|
91
153
|
- Rakefile
|
92
|
-
-
|
154
|
+
- examples/test.rb
|
93
155
|
- lib/omniauth-bitbucket.rb
|
94
156
|
- lib/omniauth-bitbucket/version.rb
|
95
157
|
- lib/omniauth/strategies/bitbucket.rb
|
@@ -116,10 +178,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
178
|
version: '0'
|
117
179
|
requirements: []
|
118
180
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.8.
|
181
|
+
rubygems_version: 1.8.23
|
120
182
|
signing_key:
|
121
183
|
specification_version: 3
|
122
184
|
summary: OmniAuth strategy for Bitbucket.
|
123
185
|
test_files:
|
124
186
|
- spec/omniauth/strategies/bitbucket_spec.rb
|
125
187
|
- spec/spec_helper.rb
|
188
|
+
has_rdoc:
|