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 +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/.gitignore +2 -0
- data/README.md +3 -3
- data/lib/omniauth/strategies/airtable.rb +1 -1
- data/lib/omniauth-airtable/version.rb +1 -1
- data/omniauth-airtable.gemspec +4 -1
- data/spec/omniauth/strategies/airtable_spec.rb +22 -0
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7adc79d151a495fb0421e33c3ab0439366b65b426af7abc28e2882876e99be1a
|
4
|
+
data.tar.gz: 9861a8f1ec008787a8098bac8a343a0662854f8bb1c9e194423ed222cd8a5d25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '023522241769af7e41bf240715ca61a561310f9d84f45da61f4aa867d595db07983916c8c3736293d09ada8832496d88cfd71b45cdd8ee56a997c2317bef645a'
|
7
|
+
data.tar.gz: 66f70d0aee5b3e36b9e154f619ec8efbe26ee3294e04d1641f0633bfb41becf4bcea9f19e676130f24dc60610edc9fcf6584662d0f33d6a23238889f5daa7abd
|
data/.github/workflows/ruby.yml
CHANGED
data/.gitignore
CHANGED
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: '
|
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: '
|
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: '
|
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
|
|
data/omniauth-airtable.gemspec
CHANGED
@@ -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.
|
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:
|
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:
|
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: '
|
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: '
|
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: '
|
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.
|
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:
|