omniauth-airtable 1.0.0 → 2.0.0

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: 6dc175d3d5b740bce9918994f46c5d6e13b02f3a808bc3d8839d8894c779d61b
4
- data.tar.gz: cf689e7b572766ed8e2de57a41e55dc53ca0ba716f74b78511e1c305c29ffdb0
3
+ metadata.gz: 7adc79d151a495fb0421e33c3ab0439366b65b426af7abc28e2882876e99be1a
4
+ data.tar.gz: 9861a8f1ec008787a8098bac8a343a0662854f8bb1c9e194423ed222cd8a5d25
5
5
  SHA512:
6
- metadata.gz: b49d1be2b22448650fb9193618d9c612632655424e08f7f9841c8fb305d2ff517b76ff8f28857ba664159542924d6c520b5bac9917fe272419287df871105e24
7
- data.tar.gz: 5b08ac8a2c1cd90a8a790f38ead41b24abd6588d83f3a16091c42116db3a75a3cb187143559e55bc6235da936c948f41686f5328538e0f573ed556337d259835
6
+ metadata.gz: '023522241769af7e41bf240715ca61a561310f9d84f45da61f4aa867d595db07983916c8c3736293d09ada8832496d88cfd71b45cdd8ee56a997c2317bef645a'
7
+ data.tar.gz: 66f70d0aee5b3e36b9e154f619ec8efbe26ee3294e04d1641f0633bfb41becf4bcea9f19e676130f24dc60610edc9fcf6584662d0f33d6a23238889f5daa7abd
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby-version: ["2.4", "2.5", "2.6", "2.7", "3.1", "3.2"]
10
+ ruby-version: ["3.0", "3.1", "3.2", "3.3"]
11
11
 
12
12
  steps:
13
13
  - uses: actions/checkout@v3
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .ruby-version
19
+ .DS_Store
data/README.md CHANGED
@@ -16,7 +16,7 @@ gem 'omniauth-airtable'
16
16
 
17
17
  ```ruby
18
18
  use OmniAuth::Builder do
19
- provider :airtable, ENV['AIRTABLE_CLIENT_ID'], ENV['AIRTABLE_CLIENT_SECRET'], { scope: 'useraccount', client_options: { site: 'https://<instance-id>.airtable.com' } }
19
+ provider :airtable, ENV['AIRTABLE_CLIENT_ID'], ENV['AIRTABLE_CLIENT_SECRET'], { scope: 'data.records:read data.records:write schema.bases:read schema.bases:write' }
20
20
  end
21
21
  ```
22
22
 
@@ -26,7 +26,7 @@ In `config/initializers/airtable.rb`
26
26
 
27
27
  ```ruby
28
28
  Rails.application.config.middleware.use OmniAuth::Builder do
29
- provider :airtable, ENV['AIRTABLE_CLIENT_ID'], ENV['AIRTABLE_CLIENT_SECRET'], { scope: 'useraccount', client_options: { site: 'https://<instance-id>.airtable.com' } }
29
+ provider :airtable, ENV['AIRTABLE_CLIENT_ID'], ENV['AIRTABLE_CLIENT_SECRET'], { scope: 'data.records:read data.records:write schema.bases:read schema.bases:write' }
30
30
  end
31
31
  ```
32
32
 
@@ -41,7 +41,7 @@ Rails.application.config.middleware.use OmniAuth::Builder do
41
41
  env['omniauth.strategy'].options[:client_id] = req.params['client_id']
42
42
  env['omniauth.strategy'].options[:client_secret] = req.params['client_secret']
43
43
  end
44
- provider :airtable, nil, nil, { setup: setup_proc, scope: 'useraccount' }
44
+ provider :airtable, nil, nil, { setup: setup_proc, scope: 'data.records:read data.records:write schema.bases:read schema.bases:write' }
45
45
  end
46
46
  ```
47
47
 
@@ -76,7 +76,7 @@ module OmniAuth
76
76
  end
77
77
 
78
78
  def callback_url
79
- full_host + script_name + callback_path
79
+ options.redirect_url || (full_host + callback_path)
80
80
  end
81
81
 
82
82
  def basic_auth_header(client_id, client_secret)
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Airtable
3
- VERSION = "1.0.0"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
@@ -16,8 +16,11 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = OmniAuth::Airtable::VERSION
18
18
 
19
- gem.add_dependency 'omniauth', '~> 1.5'
19
+ gem.required_ruby_version = ">= 3"
20
+
21
+ gem.add_dependency 'omniauth', '~> 2.0'
20
22
  gem.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0'
23
+
21
24
  gem.add_development_dependency 'rspec', '~> 3.5'
22
25
  gem.add_development_dependency 'rack-test'
23
26
  gem.add_development_dependency 'simplecov'
@@ -55,4 +55,26 @@ describe OmniAuth::Strategies::Airtable do
55
55
  end
56
56
  end
57
57
  end
58
+
59
+ describe '#callback_url' do
60
+ let(:base_url) { 'https://example.com' }
61
+
62
+ context 'no script name present' do
63
+ it 'has the correct default callback path' do
64
+ allow(subject).to receive(:full_host) { base_url }
65
+ allow(subject).to receive(:script_name) { '' }
66
+ allow(subject).to receive(:query_string) { '' }
67
+ expect(subject.callback_url).to eq(base_url + '/auth/airtable/callback')
68
+ end
69
+ end
70
+
71
+ context 'script name' do
72
+ it 'should set the callback path with script_name' do
73
+ allow(subject).to receive(:full_host) { base_url }
74
+ allow(subject).to receive(:script_name) { '/v1' }
75
+ allow(subject).to receive(:query_string) { '' }
76
+ expect(subject.callback_url).to eq(base_url + '/v1/auth/airtable/callback')
77
+ end
78
+ end
79
+ end
58
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-airtable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quentin Rousseau
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2024-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '2.0'
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.5'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -125,7 +125,7 @@ homepage: https://github.com/kwent/omniauth-airtable
125
125
  licenses:
126
126
  - MIT
127
127
  metadata: {}
128
- post_install_message:
128
+ post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
131
131
  - lib
@@ -133,15 +133,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
- version: '0'
136
+ version: '3'
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
139
  - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.0.3.1
144
- signing_key:
143
+ rubygems_version: 3.5.3
144
+ signing_key:
145
145
  specification_version: 4
146
146
  summary: Official OmniAuth strategy for Airtable.
147
147
  test_files: