omniauth-bonofa 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0919ccf0b439415dd0585fa0f57ee32276cc9992
4
- data.tar.gz: 46ca1a0f108e71aadb303a1aa1a2b620ccd8ba4b
3
+ metadata.gz: 248711e825d1fc85223d2f527703777fcac414d3
4
+ data.tar.gz: ca22c631ee4c013df68b56df6d252bf7dbcf4df9
5
5
  SHA512:
6
- metadata.gz: 44ded82b6ff7f485f71a522ddb66fcbf4c9221b6f9ff25bdb56a0577e9b01362b216ecffac7cea3e0d710a93e02efcbc99f42f1fa0e059ddfbda29a8151640f4
7
- data.tar.gz: afa7d822e4407c6126899ad4fab9f145a338682c03876dc44480ea0f0b69584fda6f639fa830eda145331a758c2640e62ec8753102d3531b17ac82b4e00d16d9
6
+ metadata.gz: 1885018018a10052a8f0e385dfdbbb5489f283a49cb71fce9a8a57afa91aec657d67f808dbca695b25d8a170c93e75e3f5fd18bbee6e4d846f5dc83f15050bbc
7
+ data.tar.gz: fac372cdd43630a788b27d398559ac56383e3efe120f02b81293006b1661d24a0c3aa96ae05984997dd1cab98938804cb6ebe05e5654ffd037962650e1e53649
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-bonofa (0.0.1)
4
+ omniauth-bonofa (0.0.5)
5
5
  omniauth-oauth2 (~> 1.1.1)
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  faraday (0.9.0)
11
11
  multipart-post (>= 1.2, < 3)
12
- hashie (2.1.1)
12
+ hashie (2.1.2)
13
13
  jwt (1.0.0)
14
14
  metaclass (0.0.4)
15
15
  minitest (5.3.4)
@@ -1,2 +1 @@
1
- require "omniauth/bonofa/configuration"
2
1
  require "omniauth/bonofa"
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Bonofa
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -1,4 +1,3 @@
1
- require "omniauth/bonofa/configuration"
2
1
  require 'omniauth/strategies/oauth2'
3
2
 
4
3
  module OmniAuth
@@ -6,6 +5,11 @@ module OmniAuth
6
5
  class Bonofa < OmniAuth::Strategies::OAuth2
7
6
  option :name, :bonofa
8
7
 
8
+ option :client_options, {
9
+ :site => "https://shop.bonofa.com",
10
+ :authorize_url => "/oauth/authorize"
11
+ }
12
+
9
13
  uid { raw_info["id"] }
10
14
 
11
15
  info do
@@ -25,10 +29,6 @@ module OmniAuth
25
29
  { :raw_info => raw_info }
26
30
  end
27
31
 
28
- def client
29
- ::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(Omniauth::Bonofa.configuration.client_options))
30
- end
31
-
32
32
  def raw_info
33
33
  @raw_info ||= access_token.get('/api/v1/me.json').parsed
34
34
  end
Binary file
@@ -8,8 +8,8 @@ class StrategyTest < StrategyTestCase
8
8
  end
9
9
 
10
10
  class ClientTest < StrategyTestCase
11
- test 'has correct Bonofa site' do
12
- assert_equal 'http://shop.opportunity-2014.com', strategy.client.site
11
+ test 'has correct baio site' do
12
+ assert_equal 'https://shop.bonofa.com', strategy.client.site
13
13
  end
14
14
 
15
15
  test 'has correct authorize url' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-bonofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -95,13 +95,11 @@ files:
95
95
  - Rakefile
96
96
  - lib/omniauth-bonofa.rb
97
97
  - lib/omniauth/bonofa.rb
98
- - lib/omniauth/bonofa/configuration.rb
99
98
  - lib/omniauth/bonofa/version.rb
100
99
  - lib/omniauth/strategies/bonofa.rb
101
- - omniauth-bonofa-0.0.3.gem
100
+ - omniauth-bonofa-0.0.4.gem
102
101
  - omniauth-bonofa.gemspec
103
102
  - tests/bonofa_test.rb
104
- - tests/configuration_test.rb
105
103
  - tests/support/shared_examples.rb
106
104
  - tests/test_helper.rb
107
105
  homepage: https://github.com/c7devteam/bonofa_main_omniauth
@@ -1,36 +0,0 @@
1
- module Omniauth
2
- module Bonofa
3
- class << self
4
- attr_reader :configuration
5
- end
6
-
7
- def self.configuration
8
- @@configuration ||= Configuration.instance
9
- end
10
-
11
- def self.configure
12
- yield(self.configuration) if block_given?
13
- end
14
-
15
- class Configuration
16
- attr_writer :site, :authorize_url
17
- include Singleton
18
-
19
- def site
20
- @site || "http://shop.opportunity-2014.com"
21
- end
22
-
23
- def authorize_url
24
- @authorize_url || "/oauth/authorize"
25
- end
26
-
27
- def client_options
28
- {
29
- :site => self.site,
30
- :authorize_url => self.authorize_url
31
- }
32
- end
33
-
34
- end
35
- end
36
- end
Binary file
@@ -1,23 +0,0 @@
1
- require 'test_helper'
2
- require 'omniauth-bonofa'
3
-
4
- class StrategyTest < StrategyTestCase
5
- include OAuth2StrategyTests
6
- end
7
-
8
- class ConfigurationTest < StrategyTestCase
9
- test "should set the configuration vars from site url" do
10
- Omniauth::Bonofa.configure do |config|
11
- config.site = "http://www.bonofa-test.com"
12
- end
13
- assert_equal Omniauth::Bonofa.configuration.site, "http://www.bonofa-test.com"
14
- assert_equal 'http://www.bonofa-test.com', strategy.client.site
15
- end
16
-
17
- test "should set configuration vars" do
18
- Omniauth::Bonofa.configure do |config|
19
- config.authorize_url = "/oauth/authorize"
20
- end
21
- assert_equal Omniauth::Bonofa.configuration.authorize_url, "/oauth/authorize"
22
- end
23
- end