omniauth-digitalocean 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14748fd5f32fe8328b7ad8cf15e17a3c0d0726b0
4
- data.tar.gz: d28f1f2dbd3093a26820962a15293ac7942a007c
3
+ metadata.gz: 1392de35285d7885830f50bf169e2982cba5acc2
4
+ data.tar.gz: cd023a08a1dbf6257f0815a93e874431b21e8a18
5
5
  SHA512:
6
- metadata.gz: 38758990c7d3443ab1266e868ffef1eacf609474975fccb46a8cec884d0c591d6ba9f1013ede0b9e5cdefd154a190b1245d238f43ccbfa265b687db3b0b58061
7
- data.tar.gz: 901f4f71dd1d202918ca37ae73559e83a77e84272c34c5450e0fcc4b4c0b579ed9dbb4e2a46ce9cf4eee0298f6c1c671b633c94c99556cada5b2e9c7d91ac01a
6
+ metadata.gz: c8c54ed63b31841d3e4f13cf2735def74c7a6dc9db84844d0fba1c6287efa5ae68a8ace336bebef0eaec53595c2926aa03747af8e1651f5daa6fa8bccb712c36
7
+ data.tar.gz: d30fe46823e69769910bf1d3459ae3342bef2efc9baede78c671ffd22e9732b23d9ac023cb3adffa61af7035b1ae6a010bbac363dcc99ef8c4231d68edead485
@@ -1,6 +1,10 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
 
4
+ install:
5
+ - "gem install bundler"
6
+ - "bundle install --jobs=3 --retry=3"
7
+
4
8
  rvm:
5
9
  - "2.0.0"
6
10
  - "2.1.5"
data/README.md CHANGED
@@ -38,7 +38,7 @@ For additional information, refer to the [OmniAuth wiki](https://github.com/intr
38
38
 
39
39
  See the [example](https://github.com/digitaloceancloud/omniauth-digitalocean/blob/master/examples/sinatra/config.ru) Sinatra app for full examples
40
40
 
41
- Note: before running example app, please add your applicaation id and secret to ` example/config.ru ` file.
41
+ Note: before running example app, please add your application id and secret to ` example/config.ru ` file.
42
42
 
43
43
  ## License
44
44
 
@@ -3,22 +3,26 @@ require 'bundler/setup'
3
3
  require 'sinatra'
4
4
  require 'omniauth-digitalocean'
5
5
 
6
- get '/' do
7
- redirect '/auth/digitalocean'
8
- end
6
+ class DigitalOceanExample < Sinatra::Base
7
+ use Rack::Session::Cookie
9
8
 
10
- get '/auth/:provider/callback' do
11
- content_type 'text/plain'
12
- request.env['omniauth.auth'].to_hash.inspect rescue "No Data"
13
- end
9
+ get '/' do
10
+ redirect '/auth/digitalocean'
11
+ end
14
12
 
15
- get '/auth/failure' do
16
- content_type 'text/plain'
17
- request.env['omniauth.auth'].to_hash.inspect rescue "No Data"
18
- end
13
+ get '/auth/:provider/callback' do
14
+ content_type 'text/plain'
15
+ request.env['omniauth.auth'].to_hash.inspect rescue "No Data"
16
+ end
19
17
 
20
- use Rack::Session::Cookie
18
+ get '/auth/failure' do
19
+ content_type 'text/plain'
20
+ request.env['omniauth.auth'].to_hash.inspect rescue "No Data"
21
+ end
21
22
 
22
- use OmniAuth::Builder do
23
- provider :digitalocean, ENV["DIGITALOCEAN_APP_ID"], ENV["DIGITALOCEAN_SECRET"], scope: "read write"
23
+ use OmniAuth::Builder do
24
+ provider OmniAuth::Strategies::Digitalocean, ENV["DIGITALOCEAN_APP_ID"], ENV["DIGITALOCEAN_SECRET"], scope: "read write"
25
+ end
24
26
  end
27
+
28
+ run DigitalOceanExample.run!
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Digitalocean
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -9,10 +9,10 @@ module OmniAuth
9
9
  # use OmniAuth::Strategies::Digitalocean, 'consumerkey', 'consumersecret', :scope => 'read write', :display => 'plain'
10
10
  #
11
11
  class Digitalocean < OmniAuth::Strategies::OAuth2
12
- AUTHENTICATION_PARAMETERS = %w(display state scope)
12
+ AUTHENTICATION_PARAMETERS = %w(display account state scope)
13
13
  BASE_URL = "https://cloud.digitalocean.com"
14
14
 
15
- option :name, :digitalocean
15
+ option :name, "digitalocean"
16
16
 
17
17
  unless OmniAuth.config.test_mode
18
18
  option :client_options, {
@@ -38,6 +38,14 @@ module OmniAuth
38
38
  access_token.params['info']
39
39
  end
40
40
 
41
+ # Over-ride callback_url definition to maintain
42
+ # compatability with omniauth-oauth2 >= 1.4.0
43
+ #
44
+ # See: https://github.com/intridea/omniauth-oauth2/issues/81
45
+ def callback_url
46
+ full_host + script_name + callback_path
47
+ end
48
+
41
49
  # Hook useful for appending parameters into the auth url before sending
42
50
  # to provider.
43
51
  def request_phase
@@ -6,7 +6,7 @@ describe OmniAuth::Strategies::Digitalocean do
6
6
  end
7
7
 
8
8
  describe "production client options" do
9
- it { expect(subject.options.name).to eq(:digitalocean) }
9
+ it { expect(subject.options.name).to eq("digitalocean") }
10
10
 
11
11
  it { expect(subject.options.client_options.site).to eq("https://cloud.digitalocean.com") }
12
12
  it { expect(subject.options.client_options.authorize_url).to eq("https://cloud.digitalocean.com/v1/oauth/authorize") }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phillip Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-03 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.4.2
167
+ rubygems_version: 2.4.6
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Official OmniAuth strategy for Digitalocean