ae_declarative_authorization 0.11.0.pre1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +8 -0
- data/.ruby-version +1 -1
- data/Appraisals +33 -19
- data/Gemfile +1 -2
- data/lib/declarative_authorization/controller/grape.rb +4 -9
- data/lib/declarative_authorization/controller_permission.rb +5 -1
- data/lib/declarative_authorization/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e24437f98ca9123a9e0c007325f8cfe0b88ed691b4cfcba2be9e9972d413b263
|
4
|
+
data.tar.gz: 7c2b45c40951f5bc8ffc71f8c6b739727ee83aaaaea9f27f0d39f07640d3febb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e437f0d1a24441216a86efd1213973be469838819409445c5af8c892c80939a460c2d789493954ec5c5f74ae41c429e2dc66b39d02fbd505f28954c442ff1cb
|
7
|
+
data.tar.gz: f25064eb69ea987a0387fc152dbf98cc1ac87e8b01de4fba54a87cfe2a5aa4acd5ecf525d39095a7a39f973c2e44ddc664b92ca90b814f3632b0fc79758cdd96
|
data/.circleci/config.yml
CHANGED
@@ -8,6 +8,12 @@ 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
|
+
|
11
17
|
test-ruby-253:
|
12
18
|
docker:
|
13
19
|
- image: circleci/ruby:2.5.3
|
@@ -23,6 +29,8 @@ jobs:
|
|
23
29
|
workflows:
|
24
30
|
rc:
|
25
31
|
jobs:
|
32
|
+
- test-ruby-233:
|
33
|
+
context: appfolio_test_context
|
26
34
|
- test-ruby-253:
|
27
35
|
context: appfolio_test_context
|
28
36
|
- test-ruby-263:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.3.3
|
data/Appraisals
CHANGED
@@ -1,26 +1,40 @@
|
|
1
|
-
RAILS_VERSIONS = ['5.2.2.1', '6.0.2.1']
|
2
|
-
GRAPE_VERSIONS = ['1.1.0', '1.2.3', '1.3.0']
|
3
|
-
|
4
1
|
case RUBY_VERSION
|
5
2
|
|
6
|
-
when '2.5.3', '2.6.3' then
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
16
|
+
|
17
|
+
appraise "ruby-#{RUBY_VERSION}-rails521" do
|
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
|
28
|
+
|
29
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0')
|
30
|
+
appraise "ruby-#{RUBY_VERSION}-rails6" do
|
31
|
+
gem 'rails', '~> 6.0'
|
32
|
+
gem 'grape', '1.2.3'
|
33
|
+
gem 'rails-controller-testing'
|
34
|
+
gem 'sqlite3', '~> 1.4'
|
22
35
|
end
|
23
36
|
end
|
37
|
+
|
24
38
|
else
|
25
39
|
raise "Unsupported Ruby version #{RUBY_VERSION}"
|
26
40
|
|
data/Gemfile
CHANGED
@@ -57,18 +57,13 @@ module Authorization
|
|
57
57
|
::Rails.logger
|
58
58
|
end
|
59
59
|
|
60
|
+
protected
|
61
|
+
|
60
62
|
def api_class
|
61
63
|
if options[:for].respond_to?(:base)
|
62
|
-
# Grape >= 1.2.0
|
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) }
|
64
|
+
options[:for].base # Grape >= 1.2.0 controller
|
69
65
|
else
|
70
|
-
# Grape
|
71
|
-
options[:for]
|
66
|
+
options[:for] # Grape < 1.2.0 controller
|
72
67
|
end
|
73
68
|
end
|
74
69
|
end
|
@@ -68,7 +68,11 @@ module Authorization
|
|
68
68
|
|
69
69
|
def controller_class(contr)
|
70
70
|
if defined?(Grape) && contr.class < Grape::Endpoint
|
71
|
-
contr.
|
71
|
+
if contr.options[:for].respond_to?(:base)
|
72
|
+
contr.options[:for].base # Grape >= 1.2.0 controller
|
73
|
+
else
|
74
|
+
contr.options[:for] # Grape < 1.2.0 controller
|
75
|
+
end
|
72
76
|
else
|
73
77
|
contr.class # Rails controller
|
74
78
|
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.11.0
|
4
|
+
version: 0.11.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-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blockenspiel
|
@@ -99,11 +99,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
104
|
+
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.0.
|
106
|
+
rubygems_version: 3.0.3
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: ae_declarative_authorization is a Rails gem for maintainable authorization
|