omniauth-uphold 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/omniauth-uphold.rb +1 -0
- data/lib/omniauth-uphold/version.rb +1 -1
- data/lib/omniauth/strategies/uphold.rb +8 -4
- data/lib/omniauth/strategies/uphold_sandbox.rb +15 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2e11878cc7a471e29e90f2c5855b369c20e91d4
|
4
|
+
data.tar.gz: 316f5183a7ce7a62a49bfd555f76a4d56ada05f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afcb246257e543e15e4334b66dcbedb2934aa576f4019b624da7e81f3991ee1d94d27725c40a2680a515ab8fc3a80420e266ac15c53da1ed7ea99b8e2838fe9e
|
7
|
+
data.tar.gz: 7fa2309a30dec640f09146a36ed4e2a48b6c9a53807b8f15f458bb1c06c060954854cd7a7186e0b8ac2312e7e6da6828e6251dd7f177538dc9bacd0275f5232d
|
data/README.md
CHANGED
@@ -28,14 +28,15 @@ end
|
|
28
28
|
|
29
29
|
## Sandbox API
|
30
30
|
|
31
|
-
Uphold supports a sandbox environment for testing purposes. To use it
|
31
|
+
Uphold supports a sandbox environment for testing purposes. To use it you will need a different strategy:
|
32
32
|
|
33
|
-
```
|
34
|
-
|
35
|
-
|
33
|
+
```ruby
|
34
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
35
|
+
provider :uphold_sandbox, 'API_KEY', 'API_SECRET', name: :uphold
|
36
|
+
end
|
36
37
|
```
|
37
38
|
|
38
|
-
|
39
|
+
You can add `name: :uphold` to make sure it uses the same route names as if you were using the main strategy.
|
39
40
|
|
40
41
|
## Contributing
|
41
42
|
|
data/lib/omniauth-uphold.rb
CHANGED
@@ -5,18 +5,22 @@ module OmniAuth
|
|
5
5
|
class Uphold < ::OmniAuth::Strategies::OAuth2
|
6
6
|
include ::OmniAuth::Strategy
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
@uphold_url = 'https://uphold.com'
|
9
|
+
@uphold_api_url = 'https://api.uphold.com'
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_reader :uphold_url, :uphold_api_url
|
13
|
+
end
|
10
14
|
|
11
15
|
option :name, :uphold
|
12
16
|
option :client_options, {
|
13
|
-
site:
|
17
|
+
site: @uphold_api_url,
|
14
18
|
token_url: 'oauth2/token'
|
15
19
|
}
|
16
20
|
|
17
21
|
def initialize(app, *args, &block)
|
18
22
|
super
|
19
|
-
options[:client_options][:authorize_url] = "#{
|
23
|
+
options[:client_options][:authorize_url] = "#{self.class.uphold_url}/authorize/#{args[0]}"
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class UpholdSandbox < ::OmniAuth::Strategies::Uphold
|
6
|
+
@uphold_url = 'https://sandbox.uphold.com'
|
7
|
+
@uphold_api_url = 'https://api-sandbox.uphold.com'
|
8
|
+
|
9
|
+
option :client_options, {
|
10
|
+
site: @uphold_api_url,
|
11
|
+
token_url: 'oauth2/token'
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-uphold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
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: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/omniauth-uphold.rb
|
129
129
|
- lib/omniauth-uphold/version.rb
|
130
130
|
- lib/omniauth/strategies/uphold.rb
|
131
|
+
- lib/omniauth/strategies/uphold_sandbox.rb
|
131
132
|
- omniauth-uphold.gemspec
|
132
133
|
- spec/omniauth/strategies/bitreserve_spec.rb
|
133
134
|
- spec/spec_helper.rb
|
@@ -151,11 +152,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
152
|
version: '0'
|
152
153
|
requirements: []
|
153
154
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.5.1
|
155
156
|
signing_key:
|
156
157
|
specification_version: 4
|
157
158
|
summary: OAuth2 strategy for the Uphold API, by Subvisual
|
158
159
|
test_files:
|
159
160
|
- spec/omniauth/strategies/bitreserve_spec.rb
|
160
161
|
- spec/spec_helper.rb
|
161
|
-
has_rdoc:
|