omniauth-coinbase 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +22 -0
- data/README.md +40 -0
- data/lib/omniauth/strategies/coinbase.rb +7 -4
- data/lib/omniauth-coinbase/version.rb +1 -1
- data/omniauth-coinbase.gemspec +1 -1
- metadata +39 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57a0bd23c985322a0ed11aa4767eeaeca2e7d370
|
4
|
+
data.tar.gz: 574d638678503aa0e327bd93f7a61017b3165256
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cf438cdbf99ebe4381ae1801065e33a1c8fb757dc3a25c05cc8dc86f139d3a56a75bc8f7cb5e7e79ed818c2eb73fb27f08620b9d51536b7ecb886e777f47e9b
|
7
|
+
data.tar.gz: 48bfe941d6db13e30b59b2f6a2349900bc89e5a2e1495500397a31173c86e708f4cbb8ac7554a24b5bf1b2901b13011f1f88b16e002f3a643f4e075cca1f1ef4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012-2014 Miguel Palhas, Coinbase
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1 +1,41 @@
|
|
1
1
|
# OmniAuth Coinbase
|
2
|
+
|
3
|
+
OmniAuth 2 strategy for [Coinbase](https://coinbase.com/)
|
4
|
+
|
5
|
+
For more details, read the [Coinbase API Reference](https://coinbase.com/docs/api/overview#oauth2)
|
6
|
+
|
7
|
+
# Installation
|
8
|
+
|
9
|
+
Add to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem "omniauth-coinbase"
|
13
|
+
```
|
14
|
+
|
15
|
+
Then bundle install.
|
16
|
+
|
17
|
+
# Usage
|
18
|
+
|
19
|
+
Here's an example, adding the middleware to a Rails app in config/initializers/omniauth.rb:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
23
|
+
provider :coinbase, ENV["COINBASE_KEY"], ENV["COINBASE_SECRET"]
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
You can now access the OmniAuth Coinbase OAuth2 URL: /auth/coinbase
|
28
|
+
|
29
|
+
# Configuration
|
30
|
+
|
31
|
+
You can configure permissions/scope, which you pass in to the `provider` method after your `COINBASE_KEY` and `COINBASE_SECRET`:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
35
|
+
provider :coinbase, ENV["COINBASE_KEY"], ENV["COINBASE_SECRET"], scope: 'user send addresses'
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
The format is a space separated list of strings from Coinbase's [list of OAuth Permissions](https://coinbase.com/docs/api/authentication#permissions). If you don't include any `scope` it will default to `all`.
|
40
|
+
|
41
|
+
NOTE: While developing your application, if you change the scope in the initializer you will need to restart your app server. Remember that at minimum you MUST include either the 'all' or 'user' scopes.
|
@@ -6,17 +6,20 @@ module OmniAuth
|
|
6
6
|
option :name, 'coinbase'
|
7
7
|
option :client_options, {
|
8
8
|
:site => 'https://coinbase.com',
|
9
|
-
:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil
|
9
|
+
:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil,
|
10
|
+
:ssl => {
|
11
|
+
:verify => true,
|
12
|
+
:cert_store => ::Coinbase::Client.whitelisted_cert_store
|
13
|
+
}
|
10
14
|
}
|
11
15
|
|
12
|
-
uid { raw_info[
|
16
|
+
uid { raw_info['id'] }
|
13
17
|
|
14
18
|
info do
|
15
19
|
{
|
16
20
|
:id => raw_info['id'],
|
17
21
|
:name => raw_info['name'],
|
18
|
-
:email => raw_info['email']
|
19
|
-
:balance => raw_info['balance']['amount']
|
22
|
+
:email => raw_info['email']
|
20
23
|
}
|
21
24
|
end
|
22
25
|
|
data/omniauth-coinbase.gemspec
CHANGED
@@ -10,7 +10,6 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "https://github.com/naps62/omniauth-coinbase"
|
11
11
|
s.summary = %q{OmniAuth strategy for Coinbase}
|
12
12
|
s.description = %q{OmniAuth strategy for Coinbase}
|
13
|
-
s.license = "MIT"
|
14
13
|
|
15
14
|
s.rubyforge_project = "omniauth-coinbase"
|
16
15
|
|
@@ -21,6 +20,7 @@ Gem::Specification.new do |s|
|
|
21
20
|
|
22
21
|
s.add_dependency 'multi_json', '~> 1.3'
|
23
22
|
s.add_runtime_dependency 'omniauth-oauth2'
|
23
|
+
s.add_runtime_dependency 'coinbase', '~> 2.0'
|
24
24
|
s.add_development_dependency 'rspec', '~> 2.7'
|
25
25
|
s.add_development_dependency 'rack-test'
|
26
26
|
s.add_development_dependency 'simplecov'
|
metadata
CHANGED
@@ -1,97 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-coinbase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Palhas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: omniauth-oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: coinbase
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - ~>
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: '2.7'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - ~>
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '2.7'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rack-test
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: simplecov
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: webmock
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
description: OmniAuth strategy for Coinbase
|
@@ -101,10 +115,11 @@ executables: []
|
|
101
115
|
extensions: []
|
102
116
|
extra_rdoc_files: []
|
103
117
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- .rspec
|
106
|
-
- .travis.yml
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".travis.yml"
|
107
121
|
- Gemfile
|
122
|
+
- LICENSE.txt
|
108
123
|
- README.md
|
109
124
|
- Rakefile
|
110
125
|
- lib/omniauth-coinbase.rb
|
@@ -114,8 +129,7 @@ files:
|
|
114
129
|
- spec/omniauth/strategies/coinbase_spec.rb
|
115
130
|
- spec/spec_helper.rb
|
116
131
|
homepage: https://github.com/naps62/omniauth-coinbase
|
117
|
-
licenses:
|
118
|
-
- MIT
|
132
|
+
licenses: []
|
119
133
|
metadata: {}
|
120
134
|
post_install_message:
|
121
135
|
rdoc_options: []
|
@@ -123,18 +137,20 @@ require_paths:
|
|
123
137
|
- lib
|
124
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
139
|
requirements:
|
126
|
-
- -
|
140
|
+
- - ">="
|
127
141
|
- !ruby/object:Gem::Version
|
128
142
|
version: '0'
|
129
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
144
|
requirements:
|
131
|
-
- -
|
145
|
+
- - ">="
|
132
146
|
- !ruby/object:Gem::Version
|
133
147
|
version: '0'
|
134
148
|
requirements: []
|
135
149
|
rubyforge_project: omniauth-coinbase
|
136
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.2.2
|
137
151
|
signing_key:
|
138
152
|
specification_version: 4
|
139
153
|
summary: OmniAuth strategy for Coinbase
|
140
|
-
test_files:
|
154
|
+
test_files:
|
155
|
+
- spec/omniauth/strategies/coinbase_spec.rb
|
156
|
+
- spec/spec_helper.rb
|