ae_declarative_authorization 0.11.0 → 0.12.0
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 +4 -4
- data/.circleci/config.yml +0 -8
- data/.ruby-version +1 -1
- data/Appraisals +19 -33
- data/Gemfile +2 -1
- data/lib/declarative_authorization/controller/grape.rb +9 -4
- data/lib/declarative_authorization/controller_permission.rb +1 -5
- data/lib/declarative_authorization/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 751cbedf8879b1cc01f1353a5048e48253a2803b8d41a2acff126c0c39ddff42
|
4
|
+
data.tar.gz: a841b726d3501e12f7abed9143122ebf0325619498567ff044f996efc0a9f972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7572bb84e51d701713e1216d48b1d6d578cd99e5bad6e3f77e9e2f1158df46ac7d8b40c87ab034022c39e3301e6912d663a19b4cd4decb6f15208de6bb4210d
|
7
|
+
data.tar.gz: 955ca7bf9f17d9188ff372ae959ff7cbd95655025daf98cef65e31da1a965c654232f381ec584cccd28846c924f09d4bc84bd8619cf0a277555a3a5895e2b672
|
data/.circleci/config.yml
CHANGED
@@ -8,12 +8,6 @@ commands:
|
|
8
8
|
- run: bundle exec appraisal rake test
|
9
9
|
|
10
10
|
jobs:
|
11
|
-
test-ruby-233:
|
12
|
-
docker:
|
13
|
-
- image: circleci/ruby:2.3.3
|
14
|
-
steps:
|
15
|
-
- bundle_install_and_test
|
16
|
-
|
17
11
|
test-ruby-253:
|
18
12
|
docker:
|
19
13
|
- image: circleci/ruby:2.5.3
|
@@ -29,8 +23,6 @@ jobs:
|
|
29
23
|
workflows:
|
30
24
|
rc:
|
31
25
|
jobs:
|
32
|
-
- test-ruby-233:
|
33
|
-
context: appfolio_test_context
|
34
26
|
- test-ruby-253:
|
35
27
|
context: appfolio_test_context
|
36
28
|
- test-ruby-263:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.6.3
|
data/Appraisals
CHANGED
@@ -1,40 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
when '2.3.3', '2.5.3', '2.6.3' then
|
4
|
-
|
5
|
-
appraise "ruby-#{RUBY_VERSION}-rails507" do
|
6
|
-
gem 'rails', '5.0.7'
|
7
|
-
gem 'grape', '1.1.0'
|
8
|
-
gem 'rails-controller-testing'
|
9
|
-
end
|
10
|
-
|
11
|
-
appraise "ruby-#{RUBY_VERSION}-rails516" do
|
12
|
-
gem 'rails', '5.1.6'
|
13
|
-
gem 'grape', '1.2.3'
|
14
|
-
gem 'rails-controller-testing'
|
15
|
-
end
|
1
|
+
RAILS_VERSIONS = ['5.2.2.1', '6.0.2.1']
|
2
|
+
GRAPE_VERSIONS = ['1.1.0', '1.2.3', '1.3.0']
|
16
3
|
|
17
|
-
|
18
|
-
gem 'rails', '5.2.1'
|
19
|
-
gem 'grape', '1.2.3'
|
20
|
-
gem 'rails-controller-testing'
|
21
|
-
end
|
22
|
-
|
23
|
-
appraise "ruby-#{RUBY_VERSION}-rails522" do
|
24
|
-
gem 'rails', '5.2.2'
|
25
|
-
gem 'grape', '1.2.3'
|
26
|
-
gem 'rails-controller-testing'
|
27
|
-
end
|
4
|
+
case RUBY_VERSION
|
28
5
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
gem '
|
33
|
-
gem '
|
34
|
-
|
6
|
+
when '2.5.3', '2.6.3' then
|
7
|
+
RAILS_VERSIONS.product(GRAPE_VERSIONS).each do |rails_version, grape_version|
|
8
|
+
appraise "ruby-#{RUBY_VERSION}-rails#{rails_version}-grape#{grape_version}" do
|
9
|
+
gem 'rails', rails_version
|
10
|
+
gem 'grape', grape_version
|
11
|
+
|
12
|
+
if Gem::Version.new(grape_version) < Gem::Version.new('1.3.0')
|
13
|
+
# https://github.com/ruby-grape/grape/pull/1956
|
14
|
+
gem "rack", "< 2.1.0"
|
15
|
+
end
|
16
|
+
|
17
|
+
if Gem::Version.new(rails_version) >= Gem::Version.new('6')
|
18
|
+
gem 'sqlite3', '~> 1.4'
|
19
|
+
else
|
20
|
+
gem 'sqlite3', '~> 1.3.0'
|
21
|
+
end
|
35
22
|
end
|
36
23
|
end
|
37
|
-
|
38
24
|
else
|
39
25
|
raise "Unsupported Ruby version #{RUBY_VERSION}"
|
40
26
|
|
data/Gemfile
CHANGED
@@ -57,13 +57,18 @@ module Authorization
|
|
57
57
|
::Rails.logger
|
58
58
|
end
|
59
59
|
|
60
|
-
protected
|
61
|
-
|
62
60
|
def api_class
|
63
61
|
if options[:for].respond_to?(:base)
|
64
|
-
|
62
|
+
# Grape >= 1.2.0 endpoint
|
63
|
+
# Authorization::Controller::Grape can be included into either Grape::API
|
64
|
+
# or Grape::API::Instance, so we need to check both.
|
65
|
+
[
|
66
|
+
options[:for],
|
67
|
+
options[:for].base
|
68
|
+
].detect { |api| api.respond_to?(:decl_auth_context) }
|
65
69
|
else
|
66
|
-
|
70
|
+
# Grape < 1.2.0 endpoint
|
71
|
+
options[:for]
|
67
72
|
end
|
68
73
|
end
|
69
74
|
end
|
@@ -68,11 +68,7 @@ module Authorization
|
|
68
68
|
|
69
69
|
def controller_class(contr)
|
70
70
|
if defined?(Grape) && contr.class < Grape::Endpoint
|
71
|
-
|
72
|
-
contr.options[:for].base # Grape >= 1.2.0 controller
|
73
|
-
else
|
74
|
-
contr.options[:for] # Grape < 1.2.0 controller
|
75
|
-
end
|
71
|
+
contr.api_class
|
76
72
|
else
|
77
73
|
contr.class # Rails controller
|
78
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_declarative_authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AppFolio
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blockenspiel
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.0.
|
106
|
+
rubygems_version: 3.0.6
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: ae_declarative_authorization is a Rails gem for maintainable authorization
|