consul 1.0.2 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +42 -0
- data/.gitignore +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +54 -3
- data/Gemfile +1 -1
- data/Gemfile.5-2 +2 -1
- data/Gemfile.5-2.lock +10 -55
- data/{Gemfile.4-2 → Gemfile.6-1} +1 -1
- data/Gemfile.6-1.lock +127 -0
- data/{Gemfile.6-0 → Gemfile.7-0} +1 -1
- data/Gemfile.7-0.lock +132 -0
- data/Gemfile.lock +1 -1
- data/README.md +17 -8
- data/consul.gemspec +5 -1
- data/lib/consul/controller.rb +25 -54
- data/lib/consul/spec/matchers.rb +1 -1
- data/lib/consul/util.rb +32 -2
- data/lib/consul/version.rb +1 -1
- metadata +39 -12
- data/.travis.yml +0 -40
- data/Gemfile.3-2 +0 -20
- data/Gemfile.3-2.lock +0 -156
- data/Gemfile.4-2.lock +0 -158
- data/Gemfile.6-0.lock +0 -188
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a06033efab4b0e24d658424200cb54c5344d477eef168af3d29e5351269e23c6
|
4
|
+
data.tar.gz: 6933c5cc01fd2be2c050079a665a43f72c06e943e06eb871bbe233129bae7ba9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fbc83485d78d84caf40dbec281549e6e24650b4c1fbe6f57c3a2a81324b42f0bfbf90c8b98f4be9e603f7e0056c51335dd95695d6e8904b32fefa7b34f658b0
|
7
|
+
data.tar.gz: 2e4f583711220be120cd5461ea24ac4246607b236fb5812987813aa4779d4d1da59e5cfbdac65d0b31566b0189c10417b9d4c1e5a40f17a510ab78ab151bda23
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
name: Tests
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
strategy:
|
14
|
+
fail-fast: false
|
15
|
+
matrix:
|
16
|
+
include:
|
17
|
+
- ruby: 2.5.3
|
18
|
+
gemfile: Gemfile.5-2
|
19
|
+
- ruby: 2.5.3
|
20
|
+
gemfile: Gemfile.6-1
|
21
|
+
- ruby: 2.7.3
|
22
|
+
gemfile: Gemfile.6-1
|
23
|
+
- ruby: 2.7.3
|
24
|
+
gemfile: Gemfile.7-0
|
25
|
+
- ruby: 3.0.3
|
26
|
+
gemfile: Gemfile.6-1
|
27
|
+
- ruby: 3.0.3
|
28
|
+
gemfile: Gemfile.7-0
|
29
|
+
env:
|
30
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
31
|
+
steps:
|
32
|
+
- uses: actions/checkout@v2
|
33
|
+
- name: Install ruby
|
34
|
+
uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: "${{ matrix.ruby }}"
|
37
|
+
- name: Bundle
|
38
|
+
run: |
|
39
|
+
gem install bundler:1.17.3
|
40
|
+
bundle install --no-deployment
|
41
|
+
- name: Run tests
|
42
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.3
|
data/CHANGELOG.md
CHANGED
@@ -7,11 +7,63 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
7
7
|
|
8
8
|
### Breaking changes
|
9
9
|
|
10
|
-
|
10
|
+
### Compatible changes
|
11
|
+
|
12
|
+
## 1.1.1 - 2022-03-16
|
13
|
+
|
14
|
+
### Compatible changes
|
15
|
+
|
16
|
+
- Activate rubygems MFA
|
17
|
+
- support rails 7
|
18
|
+
|
19
|
+
## 1.1.0 - 2021-09-28
|
20
|
+
|
21
|
+
### Breaking changes
|
22
|
+
|
23
|
+
- remove no longer supported ruby versions (2.3.8, 2.4.5)
|
24
|
+
- Consul no longer depends on the whole rails framework
|
25
|
+
|
26
|
+
### Compatible changes
|
27
|
+
|
28
|
+
- add Ruby 3 compatibility
|
29
|
+
|
30
|
+
## 1.0.3 - 2019-09-23
|
31
|
+
|
32
|
+
### Security fix
|
33
|
+
|
34
|
+
This releases fix a security issue where in a controller with multiple `power` directives, the `:only` and `:except` options of the last directive was applied to all directives.
|
35
|
+
|
36
|
+
Affected code looks like this:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
class UsersController < ApplicationController
|
40
|
+
power :foo
|
41
|
+
power :bar, only: :index
|
42
|
+
|
43
|
+
...
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
In this example both the powers `:foo` and `:bar` were only checked for the `#index` action. Other actions were left unprotected by powers checks.
|
48
|
+
|
49
|
+
Controllers with a single `power` directive are unaffected.
|
50
|
+
Contollers where neither `power` uses `:only` or `:except` options are unaffected.
|
51
|
+
|
52
|
+
This vulnerability has been assigned the CVE identifier CVE-2019-16377.
|
53
|
+
|
11
54
|
|
12
55
|
### Compatible changes
|
13
56
|
|
14
|
-
-
|
57
|
+
- The RSpec matcher `check_power` now also sees powers inherited by a parent controller.
|
58
|
+
|
59
|
+
|
60
|
+
## 1.0.2 - 2019-05-22
|
61
|
+
|
62
|
+
### Compatible changes
|
63
|
+
|
64
|
+
- The `#arity` of power methods with optional arguments is now preserved.
|
65
|
+
|
66
|
+
|
15
67
|
|
16
68
|
## 1.0.1 - 2019-02-27
|
17
69
|
|
@@ -73,4 +125,3 @@ Thanks to derekprior.
|
|
73
125
|
## Older releases
|
74
126
|
|
75
127
|
Please check commits.
|
76
|
-
|
data/Gemfile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Gemfile.
|
1
|
+
Gemfile.7-0
|
data/Gemfile.5-2
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
# Runtime dependencies
|
4
|
-
gem '
|
4
|
+
gem 'railties', '>= 3.2'
|
5
5
|
gem 'assignable_values'
|
6
6
|
|
7
7
|
# Development dependencies
|
@@ -12,6 +12,7 @@ gem 'shoulda-matchers'
|
|
12
12
|
gem 'sqlite3'
|
13
13
|
gem 'database_cleaner'
|
14
14
|
gem 'gemika'
|
15
|
+
gem 'byebug'
|
15
16
|
|
16
17
|
# Gem under test
|
17
18
|
gem 'consul', :path => '.'
|
data/Gemfile.5-2.lock
CHANGED
@@ -1,24 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
consul (1.0
|
4
|
+
consul (1.1.0)
|
5
|
+
activerecord (>= 3.2)
|
6
|
+
activesupport (>= 3.2)
|
5
7
|
edge_rider (>= 0.3.0)
|
6
8
|
memoized (>= 1.0.2)
|
7
|
-
|
9
|
+
railties (>= 3.2)
|
8
10
|
|
9
11
|
GEM
|
10
12
|
remote: https://rubygems.org/
|
11
13
|
specs:
|
12
|
-
actioncable (5.2.2)
|
13
|
-
actionpack (= 5.2.2)
|
14
|
-
nio4r (~> 2.0)
|
15
|
-
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailer (5.2.2)
|
17
|
-
actionpack (= 5.2.2)
|
18
|
-
actionview (= 5.2.2)
|
19
|
-
activejob (= 5.2.2)
|
20
|
-
mail (~> 2.5, >= 2.5.4)
|
21
|
-
rails-dom-testing (~> 2.0)
|
22
14
|
actionpack (5.2.2)
|
23
15
|
actionview (= 5.2.2)
|
24
16
|
activesupport (= 5.2.2)
|
@@ -32,19 +24,12 @@ GEM
|
|
32
24
|
erubi (~> 1.4)
|
33
25
|
rails-dom-testing (~> 2.0)
|
34
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
35
|
-
activejob (5.2.2)
|
36
|
-
activesupport (= 5.2.2)
|
37
|
-
globalid (>= 0.3.6)
|
38
27
|
activemodel (5.2.2)
|
39
28
|
activesupport (= 5.2.2)
|
40
29
|
activerecord (5.2.2)
|
41
30
|
activemodel (= 5.2.2)
|
42
31
|
activesupport (= 5.2.2)
|
43
32
|
arel (>= 9.0)
|
44
|
-
activestorage (5.2.2)
|
45
|
-
actionpack (= 5.2.2)
|
46
|
-
activerecord (= 5.2.2)
|
47
|
-
marcel (~> 0.3.1)
|
48
33
|
activesupport (5.2.2)
|
49
34
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
50
35
|
i18n (>= 0.7, < 2)
|
@@ -54,50 +39,29 @@ GEM
|
|
54
39
|
assignable_values (0.12.1)
|
55
40
|
activerecord (>= 2.3)
|
56
41
|
builder (3.2.3)
|
42
|
+
byebug (11.0.1)
|
57
43
|
concurrent-ruby (1.1.4)
|
58
44
|
crass (1.0.4)
|
59
45
|
database_cleaner (1.7.0)
|
60
46
|
diff-lcs (1.3)
|
61
|
-
edge_rider (0.
|
62
|
-
activerecord
|
47
|
+
edge_rider (2.0.0)
|
48
|
+
activerecord (>= 3.2)
|
63
49
|
erubi (1.8.0)
|
64
|
-
gemika (0.
|
65
|
-
globalid (0.4.2)
|
66
|
-
activesupport (>= 4.2.0)
|
50
|
+
gemika (0.5.0)
|
67
51
|
i18n (1.5.3)
|
68
52
|
concurrent-ruby (~> 1.0)
|
69
53
|
loofah (2.2.3)
|
70
54
|
crass (~> 1.0.2)
|
71
55
|
nokogiri (>= 1.5.9)
|
72
|
-
mail (2.7.1)
|
73
|
-
mini_mime (>= 0.1.1)
|
74
|
-
marcel (0.3.3)
|
75
|
-
mimemagic (~> 0.3.2)
|
76
56
|
memoized (1.0.2)
|
77
57
|
method_source (0.9.2)
|
78
|
-
mimemagic (0.3.3)
|
79
|
-
mini_mime (1.0.1)
|
80
58
|
mini_portile2 (2.4.0)
|
81
59
|
minitest (5.11.3)
|
82
|
-
nio4r (2.3.1)
|
83
60
|
nokogiri (1.10.1)
|
84
61
|
mini_portile2 (~> 2.4.0)
|
85
62
|
rack (2.0.6)
|
86
63
|
rack-test (1.1.0)
|
87
64
|
rack (>= 1.0, < 3)
|
88
|
-
rails (5.2.2)
|
89
|
-
actioncable (= 5.2.2)
|
90
|
-
actionmailer (= 5.2.2)
|
91
|
-
actionpack (= 5.2.2)
|
92
|
-
actionview (= 5.2.2)
|
93
|
-
activejob (= 5.2.2)
|
94
|
-
activemodel (= 5.2.2)
|
95
|
-
activerecord (= 5.2.2)
|
96
|
-
activestorage (= 5.2.2)
|
97
|
-
activesupport (= 5.2.2)
|
98
|
-
bundler (>= 1.3.0)
|
99
|
-
railties (= 5.2.2)
|
100
|
-
sprockets-rails (>= 2.0.0)
|
101
65
|
rails-dom-testing (2.0.3)
|
102
66
|
activesupport (>= 4.2.0)
|
103
67
|
nokogiri (>= 1.6)
|
@@ -138,31 +102,22 @@ GEM
|
|
138
102
|
activesupport (>= 4.0.0)
|
139
103
|
sneaky-save (0.1.2)
|
140
104
|
activerecord (>= 3.2.0)
|
141
|
-
sprockets (3.7.2)
|
142
|
-
concurrent-ruby (~> 1.0)
|
143
|
-
rack (> 1, < 3)
|
144
|
-
sprockets-rails (3.2.1)
|
145
|
-
actionpack (>= 4.0)
|
146
|
-
activesupport (>= 4.0)
|
147
|
-
sprockets (>= 3.0.0)
|
148
105
|
sqlite3 (1.3.13)
|
149
106
|
thor (0.20.3)
|
150
107
|
thread_safe (0.3.6)
|
151
108
|
tzinfo (1.2.5)
|
152
109
|
thread_safe (~> 0.1)
|
153
|
-
websocket-driver (0.7.0)
|
154
|
-
websocket-extensions (>= 0.1.0)
|
155
|
-
websocket-extensions (0.1.3)
|
156
110
|
|
157
111
|
PLATFORMS
|
158
112
|
ruby
|
159
113
|
|
160
114
|
DEPENDENCIES
|
161
115
|
assignable_values
|
116
|
+
byebug
|
162
117
|
consul!
|
163
118
|
database_cleaner
|
164
119
|
gemika
|
165
|
-
|
120
|
+
railties (>= 3.2)
|
166
121
|
rspec
|
167
122
|
rspec-rails
|
168
123
|
rspec_candy
|
data/{Gemfile.4-2 → Gemfile.6-1}
RENAMED
data/Gemfile.6-1.lock
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
consul (1.1.0)
|
5
|
+
activerecord (>= 3.2)
|
6
|
+
activesupport (>= 3.2)
|
7
|
+
edge_rider (>= 0.3.0)
|
8
|
+
memoized (>= 1.0.2)
|
9
|
+
railties (>= 3.2)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
actionpack (6.1.3)
|
15
|
+
actionview (= 6.1.3)
|
16
|
+
activesupport (= 6.1.3)
|
17
|
+
rack (~> 2.0, >= 2.0.9)
|
18
|
+
rack-test (>= 0.6.3)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
21
|
+
actionview (6.1.3)
|
22
|
+
activesupport (= 6.1.3)
|
23
|
+
builder (~> 3.1)
|
24
|
+
erubi (~> 1.4)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
27
|
+
activemodel (6.1.3)
|
28
|
+
activesupport (= 6.1.3)
|
29
|
+
activerecord (6.1.3)
|
30
|
+
activemodel (= 6.1.3)
|
31
|
+
activesupport (= 6.1.3)
|
32
|
+
activesupport (6.1.3)
|
33
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
34
|
+
i18n (>= 1.6, < 2)
|
35
|
+
minitest (>= 5.1)
|
36
|
+
tzinfo (~> 2.0)
|
37
|
+
zeitwerk (~> 2.3)
|
38
|
+
assignable_values (0.16.1)
|
39
|
+
activerecord (>= 2.3)
|
40
|
+
builder (3.2.4)
|
41
|
+
concurrent-ruby (1.1.8)
|
42
|
+
crass (1.0.6)
|
43
|
+
database_cleaner (1.7.0)
|
44
|
+
diff-lcs (1.3)
|
45
|
+
edge_rider (1.1.0)
|
46
|
+
activerecord (>= 3.2)
|
47
|
+
erubi (1.10.0)
|
48
|
+
gemika (0.6.1)
|
49
|
+
i18n (1.8.9)
|
50
|
+
concurrent-ruby (~> 1.0)
|
51
|
+
loofah (2.9.0)
|
52
|
+
crass (~> 1.0.2)
|
53
|
+
nokogiri (>= 1.5.9)
|
54
|
+
memoized (1.0.2)
|
55
|
+
method_source (1.0.0)
|
56
|
+
mini_portile2 (2.5.0)
|
57
|
+
minitest (5.14.4)
|
58
|
+
nokogiri (1.11.2)
|
59
|
+
mini_portile2 (~> 2.5.0)
|
60
|
+
racc (~> 1.4)
|
61
|
+
racc (1.5.2)
|
62
|
+
rack (2.2.3)
|
63
|
+
rack-test (1.1.0)
|
64
|
+
rack (>= 1.0, < 3)
|
65
|
+
rails-dom-testing (2.0.3)
|
66
|
+
activesupport (>= 4.2.0)
|
67
|
+
nokogiri (>= 1.6)
|
68
|
+
rails-html-sanitizer (1.3.0)
|
69
|
+
loofah (~> 2.3)
|
70
|
+
railties (6.1.3)
|
71
|
+
actionpack (= 6.1.3)
|
72
|
+
activesupport (= 6.1.3)
|
73
|
+
method_source
|
74
|
+
rake (>= 0.8.7)
|
75
|
+
thor (~> 1.0)
|
76
|
+
rake (13.0.3)
|
77
|
+
rspec (3.6.0)
|
78
|
+
rspec-core (~> 3.6.0)
|
79
|
+
rspec-expectations (~> 3.6.0)
|
80
|
+
rspec-mocks (~> 3.6.0)
|
81
|
+
rspec-core (3.6.0)
|
82
|
+
rspec-support (~> 3.6.0)
|
83
|
+
rspec-expectations (3.6.0)
|
84
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
+
rspec-support (~> 3.6.0)
|
86
|
+
rspec-mocks (3.6.0)
|
87
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
88
|
+
rspec-support (~> 3.6.0)
|
89
|
+
rspec-rails (3.6.0)
|
90
|
+
actionpack (>= 3.0)
|
91
|
+
activesupport (>= 3.0)
|
92
|
+
railties (>= 3.0)
|
93
|
+
rspec-core (~> 3.6.0)
|
94
|
+
rspec-expectations (~> 3.6.0)
|
95
|
+
rspec-mocks (~> 3.6.0)
|
96
|
+
rspec-support (~> 3.6.0)
|
97
|
+
rspec-support (3.6.0)
|
98
|
+
rspec_candy (0.4.1)
|
99
|
+
rspec
|
100
|
+
sneaky-save
|
101
|
+
shoulda-matchers (3.1.1)
|
102
|
+
activesupport (>= 4.0.0)
|
103
|
+
sneaky-save (0.1.2)
|
104
|
+
activerecord (>= 3.2.0)
|
105
|
+
sqlite3 (1.4.2)
|
106
|
+
thor (1.1.0)
|
107
|
+
tzinfo (2.0.4)
|
108
|
+
concurrent-ruby (~> 1.0)
|
109
|
+
zeitwerk (2.4.2)
|
110
|
+
|
111
|
+
PLATFORMS
|
112
|
+
ruby
|
113
|
+
|
114
|
+
DEPENDENCIES
|
115
|
+
assignable_values
|
116
|
+
consul!
|
117
|
+
database_cleaner
|
118
|
+
gemika
|
119
|
+
railties (>= 3.2)
|
120
|
+
rspec
|
121
|
+
rspec-rails
|
122
|
+
rspec_candy
|
123
|
+
shoulda-matchers
|
124
|
+
sqlite3
|
125
|
+
|
126
|
+
BUNDLED WITH
|
127
|
+
2.2.15
|
data/{Gemfile.6-0 → Gemfile.7-0}
RENAMED
data/Gemfile.7-0.lock
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
consul (1.1.1)
|
5
|
+
activerecord (>= 3.2)
|
6
|
+
activesupport (>= 3.2)
|
7
|
+
edge_rider (>= 0.3.0)
|
8
|
+
memoized (>= 1.0.2)
|
9
|
+
railties (>= 3.2)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
actionpack (7.0.0)
|
15
|
+
actionview (= 7.0.0)
|
16
|
+
activesupport (= 7.0.0)
|
17
|
+
rack (~> 2.0, >= 2.2.0)
|
18
|
+
rack-test (>= 0.6.3)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
21
|
+
actionview (7.0.0)
|
22
|
+
activesupport (= 7.0.0)
|
23
|
+
builder (~> 3.1)
|
24
|
+
erubi (~> 1.4)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
27
|
+
activemodel (7.0.0)
|
28
|
+
activesupport (= 7.0.0)
|
29
|
+
activerecord (7.0.0)
|
30
|
+
activemodel (= 7.0.0)
|
31
|
+
activesupport (= 7.0.0)
|
32
|
+
activesupport (7.0.0)
|
33
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
34
|
+
i18n (>= 1.6, < 2)
|
35
|
+
minitest (>= 5.1)
|
36
|
+
tzinfo (~> 2.0)
|
37
|
+
assignable_values (0.16.5)
|
38
|
+
activerecord (>= 2.3)
|
39
|
+
builder (3.2.4)
|
40
|
+
concurrent-ruby (1.1.9)
|
41
|
+
crass (1.0.6)
|
42
|
+
database_cleaner (2.0.1)
|
43
|
+
database_cleaner-active_record (~> 2.0.0)
|
44
|
+
database_cleaner-active_record (2.0.1)
|
45
|
+
activerecord (>= 5.a)
|
46
|
+
database_cleaner-core (~> 2.0.0)
|
47
|
+
database_cleaner-core (2.0.1)
|
48
|
+
diff-lcs (1.4.4)
|
49
|
+
edge_rider (2.0.0)
|
50
|
+
activerecord (>= 3.2)
|
51
|
+
erubi (1.10.0)
|
52
|
+
gemika (0.6.1)
|
53
|
+
i18n (1.8.11)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
loofah (2.13.0)
|
56
|
+
crass (~> 1.0.2)
|
57
|
+
nokogiri (>= 1.5.9)
|
58
|
+
memoized (1.0.2)
|
59
|
+
method_source (1.0.0)
|
60
|
+
mini_portile2 (2.6.1)
|
61
|
+
minitest (5.15.0)
|
62
|
+
nokogiri (1.12.5)
|
63
|
+
mini_portile2 (~> 2.6.1)
|
64
|
+
racc (~> 1.4)
|
65
|
+
racc (1.6.0)
|
66
|
+
rack (2.2.3)
|
67
|
+
rack-test (1.1.0)
|
68
|
+
rack (>= 1.0, < 3)
|
69
|
+
rails-dom-testing (2.0.3)
|
70
|
+
activesupport (>= 4.2.0)
|
71
|
+
nokogiri (>= 1.6)
|
72
|
+
rails-html-sanitizer (1.4.2)
|
73
|
+
loofah (~> 2.3)
|
74
|
+
railties (7.0.0)
|
75
|
+
actionpack (= 7.0.0)
|
76
|
+
activesupport (= 7.0.0)
|
77
|
+
method_source
|
78
|
+
rake (>= 12.2)
|
79
|
+
thor (~> 1.0)
|
80
|
+
zeitwerk (~> 2.5)
|
81
|
+
rake (13.0.6)
|
82
|
+
rspec (3.10.0)
|
83
|
+
rspec-core (~> 3.10.0)
|
84
|
+
rspec-expectations (~> 3.10.0)
|
85
|
+
rspec-mocks (~> 3.10.0)
|
86
|
+
rspec-core (3.10.1)
|
87
|
+
rspec-support (~> 3.10.0)
|
88
|
+
rspec-expectations (3.10.1)
|
89
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
90
|
+
rspec-support (~> 3.10.0)
|
91
|
+
rspec-mocks (3.10.2)
|
92
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
+
rspec-support (~> 3.10.0)
|
94
|
+
rspec-rails (5.0.2)
|
95
|
+
actionpack (>= 5.2)
|
96
|
+
activesupport (>= 5.2)
|
97
|
+
railties (>= 5.2)
|
98
|
+
rspec-core (~> 3.10)
|
99
|
+
rspec-expectations (~> 3.10)
|
100
|
+
rspec-mocks (~> 3.10)
|
101
|
+
rspec-support (~> 3.10)
|
102
|
+
rspec-support (3.10.3)
|
103
|
+
rspec_candy (0.5.1)
|
104
|
+
rspec
|
105
|
+
sneaky-save
|
106
|
+
shoulda-matchers (5.0.0)
|
107
|
+
activesupport (>= 5.2.0)
|
108
|
+
sneaky-save (0.1.3)
|
109
|
+
activerecord (>= 3.2.0)
|
110
|
+
sqlite3 (1.4.2)
|
111
|
+
thor (1.1.0)
|
112
|
+
tzinfo (2.0.4)
|
113
|
+
concurrent-ruby (~> 1.0)
|
114
|
+
zeitwerk (2.5.1)
|
115
|
+
|
116
|
+
PLATFORMS
|
117
|
+
ruby
|
118
|
+
|
119
|
+
DEPENDENCIES
|
120
|
+
assignable_values
|
121
|
+
consul!
|
122
|
+
database_cleaner
|
123
|
+
gemika
|
124
|
+
railties (>= 7.0)
|
125
|
+
rspec
|
126
|
+
rspec-rails
|
127
|
+
rspec_candy
|
128
|
+
shoulda-matchers
|
129
|
+
sqlite3
|
130
|
+
|
131
|
+
BUNDLED WITH
|
132
|
+
2.2.25
|
data/Gemfile.lock
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Gemfile.
|
1
|
+
Gemfile.7-0.lock
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
Consul — A next gen authorization solution
|
2
2
|
==========================================
|
3
3
|
|
4
|
-
[![
|
4
|
+
[![Tests](https://github.com/makandra/consul/workflows/Tests/badge.svg)](https://github.com/makandra/consul/actions) [![Code Climate](https://codeclimate.com/github/makandra/consul.png)](https://codeclimate.com/github/makandra/consul)
|
5
|
+
|
5
6
|
|
6
7
|
Consul is an authorization solution for Ruby on Rails where you describe *sets of accessible things* to control what a user can see or edit.
|
7
8
|
|
8
9
|
We have used Consul in combination with [assignable_values](https://github.com/makandra/assignable_values) to solve a variety of authorization requirements ranging from boring to bizarre.
|
9
10
|
Also see our crash course video: [Solving bizare authorization requirements with Rails](http://bizarre-authorization.talks.makandra.com/).
|
10
11
|
|
11
|
-
Consul is tested with Rails
|
12
|
+
Consul is tested with Rails 5.2, 6.1 and 7.0 on Ruby 2.5, 2.7 and 3.0 (only if supported, for each Ruby/Rails combination). If you need support for Rails 3.2, please use [v0.13.2](https://github.com/makandra/consul/tree/v0.13.2).
|
12
13
|
|
13
14
|
|
14
15
|
Describing access to your application
|
@@ -46,7 +47,7 @@ class Power
|
|
46
47
|
end
|
47
48
|
```
|
48
49
|
|
49
|
-
There are no restrictions on the name or constructor arguments of
|
50
|
+
There are no restrictions on the name or constructor arguments of this class.
|
50
51
|
|
51
52
|
You can deposit all kinds of objects in your power. See the sections below for details.
|
52
53
|
|
@@ -90,7 +91,7 @@ Or you can ask if the power is given (meaning it's not `nil`):
|
|
90
91
|
power.notes? # => returns true if Power#notes returns a scope and not nil
|
91
92
|
```
|
92
93
|
|
93
|
-
Or you can raise an error unless a power
|
94
|
+
Or you can raise an error unless a power is given, e.g. to guard access into a controller action:
|
94
95
|
|
95
96
|
```rb
|
96
97
|
power.notes! # => raises Consul::Powerless unless Power#notes returns a scope (even if it's empty)
|
@@ -497,7 +498,7 @@ And the following power definitions:
|
|
497
498
|
class Power
|
498
499
|
...
|
499
500
|
|
500
|
-
power :clients do
|
501
|
+
power :clients do
|
501
502
|
Client.active if signed_in?
|
502
503
|
end
|
503
504
|
|
@@ -547,7 +548,9 @@ class ApplicationController < ActionController::Base
|
|
547
548
|
end
|
548
549
|
```
|
549
550
|
|
550
|
-
|
551
|
+
Note that this check is satisfied by *any* `.power` directive in the controller class or its ancestors, even if that `.power` directive has `:only` or `:except` options that do not apply to the current action.
|
552
|
+
|
553
|
+
Should you want to forego the power check (e.g. to remove authorization checks from an entirely public controller):
|
551
554
|
|
552
555
|
```rb
|
553
556
|
class ApiController < ApplicationController
|
@@ -844,8 +847,12 @@ Now run `bundle install` to lock the gem into your project.
|
|
844
847
|
Development
|
845
848
|
-----------
|
846
849
|
|
847
|
-
|
848
|
-
|
850
|
+
We currently develop using Ruby 2.5.3 (see `.ruby-version`) since that version works for current versions of ActiveRecord that we support. GitHub Actions will test additional Ruby versions (2.3.8, 2.4.5, and 3.0.1).
|
851
|
+
|
852
|
+
There are tests in `spec`. We only accept PRs with tests. To run tests:
|
853
|
+
|
854
|
+
- Install Ruby 2.5.3
|
855
|
+
- run `bundle install`
|
849
856
|
- Put your database credentials into `spec/support/database.yml`. There's a `database.sample.yml` you can use as a template.
|
850
857
|
- There are gem bundles in the project root for each rails version that we support.
|
851
858
|
- You can bundle all test applications by saying `bundle exec rake matrix:install`
|
@@ -857,6 +864,8 @@ If you would like to contribute:
|
|
857
864
|
- Push your changes **with specs**.
|
858
865
|
- Send me a pull request.
|
859
866
|
|
867
|
+
Note that we have configured GitHub Actions to automatically run tests in all supported Ruby versions and dependency sets after each push. We will only merge pull requests after a green GitHub Actions run.
|
868
|
+
|
860
869
|
I'm very eager to keep this gem leightweight and on topic. If you're unsure whether a change would make it into the gem, [talk to me beforehand](mailto:henning.koch@makandra.de).
|
861
870
|
|
862
871
|
|
data/consul.gemspec
CHANGED
@@ -13,8 +13,10 @@ Gem::Specification.new do |s|
|
|
13
13
|
|
14
14
|
if RUBY_VERSION.to_f >= 2.0
|
15
15
|
s.metadata = {
|
16
|
+
'source_code_uri' => s.homepage,
|
16
17
|
'bug_tracker_uri' => 'https://github.com/makandra/consul/issues',
|
17
18
|
'changelog_uri' => 'https://github.com/makandra/consul/blob/master/CHANGELOG.md',
|
19
|
+
'rubygems_mfa_required' => 'true',
|
18
20
|
}
|
19
21
|
end
|
20
22
|
|
@@ -24,6 +26,8 @@ Gem::Specification.new do |s|
|
|
24
26
|
s.require_paths = ["lib"]
|
25
27
|
|
26
28
|
s.add_dependency('memoized', '>=1.0.2')
|
27
|
-
s.add_dependency('
|
29
|
+
s.add_dependency('activerecord', '>= 3.2')
|
30
|
+
s.add_dependency('activesupport', '>= 3.2')
|
31
|
+
s.add_dependency('railties', '>= 3.2')
|
28
32
|
s.add_dependency('edge_rider', '>= 0.3.0')
|
29
33
|
end
|