omniauth-artsy 0.2.1 → 0.2.2

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: 72a0934cb2f200b475f98786ff00b6f6e941e0ea
4
- data.tar.gz: 94efa9e5725f75610d36174e15770ed27582c7fe
3
+ metadata.gz: 360b4024520d1f3647d0feba0f33c40094851ce6
4
+ data.tar.gz: 16328ef3f26ff9c2fb9f9f28d00ce706d65bf674
5
5
  SHA512:
6
- metadata.gz: e3291407926b8f67989fd079e52e201f0c3d59f94a817a8631788dfc906dfe9ae0b2ed982ed7c1af757e5b4f2bcd1d1909dc5acd146d389d4ef440785109ea58
7
- data.tar.gz: baf43adc69c2258fff4a456c9ab27ec25606c283a4f26fc1fa200bccfdba2c310223a6330e8d5f9f0c713dd26b4d5da2d47ad8d6636942b5482ed2557ed5d3b2
6
+ metadata.gz: f533ad7818486e00ae4fe4e51ad0523d9164a9260bec46916600e44481cc90119e66f4e736b6e4ec95718552b6928b980240f52a08efe27ac46dc77d5002b2ec
7
+ data.tar.gz: b9cf21862d613d73aa2f4d5a7f0bbbcfeeddd79e5feb568b45b6eaa52ae90c7e0939fe7fef29a38010bace81472d2a393aece0a0182264b4c81d5bc5f4f420ab
data/.rubocop_todo.yml CHANGED
@@ -9,7 +9,7 @@
9
9
  # Offense count: 2
10
10
  # Configuration parameters: CountComments, ExcludedMethods.
11
11
  Metrics/BlockLength:
12
- Max: 64
12
+ Max: 67
13
13
 
14
14
  # Offense count: 8
15
15
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
data/CHANGELOG.md CHANGED
@@ -1,8 +1,13 @@
1
- 0.2.2 (Next)
1
+ 0.2.3 (Next)
2
2
  ============
3
3
 
4
4
  * Your contribution here.
5
5
 
6
+ 0.2.2
7
+ ============
8
+
9
+ * [#7](https://github.com/artsy/omniauth-artsy/pull/7): Fix issue in configuring Artsy's strategy when using new config - [@ashkan18](https://github.com/ashkan18).
10
+
6
11
  0.2.1
7
12
  ============
8
13
 
@@ -14,7 +14,15 @@ module OmniAuth
14
14
 
15
15
  class << self
16
16
  def configure
17
- block_given? ? yield(Config) : Config
17
+ if block_given?
18
+ yield(Config)
19
+ reconfigure_strategy
20
+ end
21
+ Config
22
+ end
23
+
24
+ def reconfigure_strategy
25
+ Strategies::Artsy.configure
18
26
  end
19
27
 
20
28
  def config
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Artsy
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
@@ -3,10 +3,14 @@ require 'omniauth-oauth2'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Artsy < OmniAuth::Strategies::OAuth2
6
- option :client_options,
7
- site: OmniAuth::Artsy.config.artsy_api_url || ENV['ARTSY_API_URL'] || ENV['gravity_url'],
8
- authorize_url: '/oauth2/authorize?scope=offline_access&response_type=code',
9
- token_url: '/oauth2/access_token?scope=offline_access&response_type=code&grant_type=authorization_code'
6
+ def self.configure
7
+ option :client_options,
8
+ site: OmniAuth::Artsy.config.artsy_api_url || ENV['ARTSY_API_URL'] || ENV['gravity_url'],
9
+ authorize_url: '/oauth2/authorize?scope=offline_access&response_type=code',
10
+ token_url: '/oauth2/access_token?scope=offline_access&response_type=code&grant_type=authorization_code'
11
+ end
12
+
13
+ configure
10
14
 
11
15
  def request_phase
12
16
  super
@@ -3,6 +3,7 @@ require 'spec_helper'
3
3
  describe OmniAuth::Artsy::Config do
4
4
  describe '#configure' do
5
5
  before do
6
+ expect(OmniAuth::Artsy).to receive(:reconfigure_strategy).once
6
7
  OmniAuth::Artsy.configure do |config|
7
8
  config.artsy_api_url = 'http://localhost:3000/api'
8
9
  end
@@ -22,8 +22,11 @@ describe OmniAuth::Strategies::Artsy do
22
22
  end
23
23
 
24
24
  describe '#client_options' do
25
- it 'returns nil for Artsy API URL without setting' do
26
- expect(subject.options.client_options.site).to be_nil
25
+ it 'returns correct url for Artsy API URL when it was set' do
26
+ OmniAuth::Artsy.configure do |config|
27
+ config.artsy_api_url = 'http://api.test.url'
28
+ end
29
+ expect(subject.options.client_options.site).to eq 'http://api.test.url'
27
30
  end
28
31
 
29
32
  it 'has correct authorize url' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-artsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Fareed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.6.11
128
+ rubygems_version: 2.5.2
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Omniauth plugin for Artsy authentication.