omniauth-bancsabadell 0.1.0 → 0.1.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: ee1614508c03d7dd4c763a4561e9c2ea74f4bc9b
4
- data.tar.gz: d8f802d6671854e15f33e92ecb49f1bbf9865d31
3
+ metadata.gz: 00b1e8ebc396335ca92f3cdbbbffac7774a1e5d6
4
+ data.tar.gz: 52f37336f9d15be9388d02459ef287ba0a3e7113
5
5
  SHA512:
6
- metadata.gz: cfbd3b3e276b2784140a161747b0e4694c00856a19fc051c83330b129baaadfd273d6735e9fc2fe4b320de02d66f49cb2685d3e3de4f5782595442d33056cec1
7
- data.tar.gz: 8cc5201205d03a022b74270908e7cea37dc7e988a891ae6de7b4371bdee54b856f07681522e4639c8ea15b1d1708e4238463ddefd6f36155f6b907ffa024e7ae
6
+ metadata.gz: 5a00d11a623ae05a682f730836454af8f33ad92915b00dc2833b86e19fe86e56bc0cc21a6bd20c229cb706fce722cf5a705a76caaeeeb5acae95c9644dbaf614
7
+ data.tar.gz: 154cbdfc2bd8a5f4f6611e9ff9c8b874d7ce5c68dad79b1d43c9d7741332a8d6b2e9d76a55797d7d87022291661e4f62f52164211ccbe6031fc1f85daee407aa
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg*
data/Gemfile.lock CHANGED
@@ -2,16 +2,16 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  omniauth-bancsabadell (0.1.0)
5
- omniauth-oauth2 (~> 1.2)
5
+ omniauth-oauth2 (~> 1.4)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- faraday (0.9.0)
10
+ faraday (0.9.2)
11
11
  multipart-post (>= 1.2, < 3)
12
- hashie (3.3.1)
13
- jwt (1.0.0)
14
- multi_json (1.10.1)
12
+ hashie (3.4.3)
13
+ jwt (1.5.2)
14
+ multi_json (1.11.0)
15
15
  multi_xml (0.5.5)
16
16
  multipart-post (2.0.0)
17
17
  oauth2 (1.0.0)
@@ -23,15 +23,16 @@ GEM
23
23
  omniauth (1.2.2)
24
24
  hashie (>= 1.2, < 4)
25
25
  rack (~> 1.0)
26
- omniauth-oauth2 (1.2.0)
27
- faraday (>= 0.8, < 0.10)
28
- multi_json (~> 1.3)
26
+ omniauth-oauth2 (1.4.0)
29
27
  oauth2 (~> 1.0)
30
28
  omniauth (~> 1.2)
31
- rack (1.5.2)
29
+ rack (1.6.4)
32
30
 
33
31
  PLATFORMS
34
32
  ruby
35
33
 
36
34
  DEPENDENCIES
37
35
  omniauth-bancsabadell!
36
+
37
+ BUNDLED WITH
38
+ 1.10.6
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Bancsabadell
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -3,14 +3,25 @@ require 'omniauth/strategies/oauth2'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Bancsabadell < OmniAuth::Strategies::OAuth2
6
- API_BS_HOST = 'https://developers.bancsabadell.com'
6
+ def self.api_host
7
+ @api_host ||= if %w(development staging).include?(ENV['RAILS_ENV'])
8
+ 'https://developers.bancsabadell.com'
9
+ else
10
+ 'https://oauth.bancsabadell.com'
11
+ end
12
+ end
7
13
 
8
14
  option :client_options, {
9
- site: 'https://developers.bancsabadell.com',
10
- authorize_url: 'https://developers.bancsabadell.com/AuthServerBS/oauth/authorize',
11
- token_url: 'https://developers.bancsabadell.com/AuthServerBS/oauth/token'
15
+ site: api_host,
16
+ authorize_url: "#{api_host}/AuthServerBS/oauth/authorize",
17
+ token_url: "#{api_host}/AuthServerBS/oauth/token",
18
+ setup: true
12
19
  }
13
20
 
21
+ def callback_url
22
+ full_host + script_name + callback_path # + query_string
23
+ end
24
+
14
25
  def request_phase
15
26
  super
16
27
  end
@@ -19,7 +30,7 @@ module OmniAuth
19
30
  super.merge({
20
31
  response_type: :code,
21
32
  client_id: options.client_id,
22
- scope: "read write"
33
+ scope: "read"
23
34
  })
24
35
  end
25
36
  end
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
16
16
  s.require_paths = ['lib']
17
17
 
18
- s.add_runtime_dependency 'omniauth-oauth2', '~> 1.2'
18
+ s.add_runtime_dependency 'omniauth-oauth2', '~> 1.4'
19
19
  end
@@ -1,4 +1,4 @@
1
- silence_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if Rails.env.development? }
1
+ silence_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if(Rails.env.development? || Rails.env.staging?)}
2
2
 
3
3
  Rails.application.config.middleware.use OmniAuth::Builder do
4
4
  provider :bancsabadell,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-bancsabadell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Bellonch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-11 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '1.4'
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
- version: '1.2'
26
+ version: '1.4'
27
27
  description:
28
28
  email:
29
29
  - albert@getquipu.com
@@ -32,10 +32,12 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - ".DS_Store"
35
+ - ".gitignore"
35
36
  - CHANGELOG.md
36
37
  - Gemfile
37
38
  - Gemfile.lock
38
39
  - README.md
40
+ - Rakefile
39
41
  - lib/.DS_Store
40
42
  - lib/omniauth-bancsabadell.rb
41
43
  - lib/omniauth/.DS_Store
@@ -124,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
126
  version: '0'
125
127
  requirements: []
126
128
  rubyforge_project:
127
- rubygems_version: 2.2.2
129
+ rubygems_version: 2.4.5
128
130
  signing_key:
129
131
  specification_version: 4
130
132
  summary: BancSabadell OAuth2 Strategy for OmniAuth