omniauth-pandadoc 1.0.0rc2 → 1.0.0rc3

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
  SHA256:
3
- metadata.gz: d0caba7eb011abc0fb91e4c8fd0170baa160c7c95ed41595e2b7d96c8f4270c6
4
- data.tar.gz: 68952275e28e1ae676431abd94ddbb3e3d9cab50c9fd15689379655439cf9426
3
+ metadata.gz: 3eed4e219f8e70d1982f043aab2b31f9939fc0e426a55461d545503559019b05
4
+ data.tar.gz: 6b29e9cc520aa91faf49d07e8c4a4871fb2f81c1f2872bd0edacc940f7765197
5
5
  SHA512:
6
- metadata.gz: 324525da59bb3b357d0e705732f8bdaea4a3be3cbe7b626d7f60a488c6ee4e4d6e75eeba2a8a731f070943b8e6903340a6c38d42a8f54291dbd245c97acea89b
7
- data.tar.gz: 7bc6a67d8721d3d5bb7603d5bee21e20d83d8750ecdf90150ece6d4f3767227d33abec12eb54101b7e93a3187ddb153a21c5d98aea7396d766b6053efe0a6e11
6
+ metadata.gz: e16930dc7153e6f296a76ebb8ed08531efa36d0192d89167a832dd2da54e39e1c5840cd0779f6ef60552c3a4508fe9ea657eb3c02a0a740050d32bfb90607c11
7
+ data.tar.gz: 56d85c860d219502923ce61d75aabced3612cbbeb711e472e1317376220076637a904d177863f933bfd62e82b2ee2c10036d3fd29ed872af106716c650d11b36
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Pandadoc
5
- VERSION = '1.0.0rc2'
5
+ VERSION = '1.0.0rc3'
6
6
  end
7
7
  end
@@ -5,7 +5,7 @@ module OmniAuth
5
5
  module Strategies
6
6
  # Main class for Pandadoc OAuth2 strategy.
7
7
  class Pandadoc < OmniAuth::Strategies::OAuth2
8
- DEFAULT_SCOPE = 'read+write'
8
+ DEFAULT_SCOPE = 'read+write'.freeze
9
9
 
10
10
  option :client_options,
11
11
  site: 'https://api.pandadoc.com/public/v1',
@@ -14,8 +14,10 @@ module OmniAuth
14
14
 
15
15
  option :provider_ignores_state, true # this is needed for local testing
16
16
 
17
- def request_phase
18
- redirect client.auth_code.authorize_url({ redirect_uri: callback_url }.merge(options.authorize_params))
17
+ def authorize_params
18
+ super.tap do |params|
19
+ params[:scope] ||= DEFAULT_SCOPE
20
+ end
19
21
  end
20
22
  end
21
23
  end
@@ -105,4 +105,18 @@ describe OmniAuth::Strategies::Pandadoc do
105
105
  expect(subject.callback_path).to eq('/auth/foo/callback')
106
106
  end
107
107
  end
108
+
109
+ describe '#authorize_params' do
110
+ it 'takes a custom scope' do
111
+ @options = { scope: 'foo' }
112
+
113
+ expect(subject.authorize_params[:scope]).to eq 'foo'
114
+ end
115
+
116
+ it 'provides a default scope if none is provided' do
117
+ @options = {}
118
+
119
+ expect(subject.authorize_params[:scope]).to eq described_class::DEFAULT_SCOPE
120
+ end
121
+ end
108
122
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-pandadoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0rc2
4
+ version: 1.0.0rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Carey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-20 00:00:00.000000000 Z
12
+ date: 2018-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jwt
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: 1.3.1
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.7.6
140
+ rubygems_version: 2.7.7
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Pandadoc Strategy for OmniAuth