consent 2.3.0 → 2.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48437aa7d5b453f8d1ed90f8525e10ee945181bd85dce3a9632ea026b59e356a
4
- data.tar.gz: dbf503bfb196a35a4675d6f856901d6d5abe202cef736aded8553c2c5a7b8d49
3
+ metadata.gz: 8a7f3d0bface397869a595d46763a6c17aafa1563e074d7b658454fc0b1e4c2f
4
+ data.tar.gz: 301924b497164138ee60d4de3970caa9dee41ebb01697ecccf7ef9fc9202ee70
5
5
  SHA512:
6
- metadata.gz: fad64a2eb8d82d2f40ca9d0417c4e8207284008e11505b16c4b42d22be6d1d9e70079cf21fef8783c7416d602d213cdd2c80613e4a35502081ee8919de981869
7
- data.tar.gz: b14f196498e1332a23e542791e5aa3464268d430b9bd756e3d13248118ca3e9ce561823b3769640ea2cb2f932348d2af92abef9ef0a3cdbb83e862d2bbab7584
6
+ metadata.gz: 7fdc2b3e5ff872bdc11da1688fb362d360f33e217ea5d5ffe6e8a9e2e0438454e94a7402d8c0db32ca738524e690e007a14a9e2ccdc51401a13926887d44d949
7
+ data.tar.gz: 78e9b088d5e3dd9772944155ae8704f33a9b474c952c9513c78f73bff420871eee1352e8d692dd42b5a924e93bf4083023c34574300db6003adb4ad070f08224
data/.rubocop.yml CHANGED
@@ -6,13 +6,5 @@ require:
6
6
  AllCops:
7
7
  TargetRubyVersion: 3.0
8
8
 
9
- Style/FrozenStringLiteralComment:
10
- Exclude:
11
- - 'gemfiles/*'
12
-
13
- Bundler/OrderedGems:
14
- Exclude:
15
- - 'gemfiles/*'
16
-
17
9
  Rails:
18
10
  Enabled: false
data/Appraisals CHANGED
@@ -1,15 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise "rails-6-1" do
4
- gem "rails", "6.1.7.7"
5
- end
6
-
7
- appraise "rails-7-0" do
8
- gem "rails", "7.0.8.7"
9
- end
10
-
11
3
  appraise "rails-7-1" do
12
- gem "rails", "7.1.3.2"
4
+ gem "rails", "7.1.5.2"
13
5
  end
14
6
 
15
7
  appraise "rails-7-2" do
data/Gemfile CHANGED
@@ -5,13 +5,4 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in consent.gemspec
6
6
  gemspec
7
7
 
8
- gem "base64"
9
- gem "bigdecimal"
10
- gem "erb", "< 5.1" # Hold erb to support Ruby < 3.2
11
- gem "logger"
12
- gem "mutex_m"
13
- gem "net-imap", "< 0.5.0"
14
- gem "nokogiri", "< 1.19"
15
8
  gem "rubocop-powerhome", path: "../rubocop-powerhome"
16
- gem "securerandom", "< 0.4" # Hold securerandom to support Ruby 3.0
17
- gem "zeitwerk", "< 2.7.0"
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: ../rubocop-powerhome
3
3
  specs:
4
- rubocop-powerhome (0.5.6)
5
- rubocop (= 1.75.0)
4
+ rubocop-powerhome (0.6.1)
5
+ rubocop (= 1.82.1)
6
6
  rubocop-performance
7
7
  rubocop-rails
8
8
  rubocop-rake
@@ -11,15 +11,15 @@ PATH
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- consent (2.3.0)
14
+ consent (2.5.0)
15
15
  cancancan (= 3.2.1)
16
16
 
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- actionpack (8.0.2)
21
- actionview (= 8.0.2)
22
- activesupport (= 8.0.2)
20
+ actionpack (8.1.3)
21
+ actionview (= 8.1.3)
22
+ activesupport (= 8.1.3)
23
23
  nokogiri (>= 1.8.5)
24
24
  rack (>= 2.2.4)
25
25
  rack-session (>= 1.0.1)
@@ -27,26 +27,26 @@ GEM
27
27
  rails-dom-testing (~> 2.2)
28
28
  rails-html-sanitizer (~> 1.6)
29
29
  useragent (~> 0.16)
30
- actionview (8.0.2)
31
- activesupport (= 8.0.2)
30
+ actionview (8.1.3)
31
+ activesupport (= 8.1.3)
32
32
  builder (~> 3.1)
33
33
  erubi (~> 1.11)
34
34
  rails-dom-testing (~> 2.2)
35
35
  rails-html-sanitizer (~> 1.6)
36
- activemodel (8.0.2)
37
- activesupport (= 8.0.2)
38
- activerecord (8.0.2)
39
- activemodel (= 8.0.2)
40
- activesupport (= 8.0.2)
36
+ activemodel (8.1.3)
37
+ activesupport (= 8.1.3)
38
+ activerecord (8.1.3)
39
+ activemodel (= 8.1.3)
40
+ activesupport (= 8.1.3)
41
41
  timeout (>= 0.4.0)
42
- activesupport (8.0.2)
42
+ activesupport (8.1.3)
43
43
  base64
44
- benchmark (>= 0.3)
45
44
  bigdecimal
46
45
  concurrent-ruby (~> 1.0, >= 1.3.1)
47
46
  connection_pool (>= 2.2.5)
48
47
  drb
49
48
  i18n (>= 1.6, < 2)
49
+ json
50
50
  logger (>= 1.4.2)
51
51
  minitest (>= 5.1)
52
52
  securerandom (>= 0.3)
@@ -58,8 +58,7 @@ GEM
58
58
  thor (>= 0.14.0)
59
59
  ast (2.4.3)
60
60
  base64 (0.3.0)
61
- benchmark (0.4.1)
62
- bigdecimal (3.2.2)
61
+ bigdecimal (4.1.1)
63
62
  builder (3.3.0)
64
63
  byebug (11.1.3)
65
64
  cancancan (3.2.1)
@@ -68,23 +67,24 @@ GEM
68
67
  activesupport (>= 3.0.0)
69
68
  railties (>= 3.0.0)
70
69
  thor (>= 0.14.6)
71
- concurrent-ruby (1.3.5)
72
- connection_pool (2.5.3)
70
+ concurrent-ruby (1.3.6)
71
+ connection_pool (3.0.2)
73
72
  crass (1.0.6)
74
73
  csv (3.3.5)
75
- date (3.4.1)
74
+ date (3.5.1)
76
75
  diff-lcs (1.6.2)
77
76
  drb (2.2.3)
78
- erb (5.0.2)
77
+ erb (6.0.2)
79
78
  erubi (1.13.1)
80
- i18n (1.14.7)
79
+ i18n (1.14.8)
81
80
  concurrent-ruby (~> 1.0)
82
- io-console (0.8.1)
83
- irb (1.15.2)
81
+ io-console (0.8.2)
82
+ irb (1.17.0)
84
83
  pp (>= 0.6.0)
84
+ prism (>= 1.3.0)
85
85
  rdoc (>= 4.0.0)
86
86
  reline (>= 0.4.2)
87
- json (2.13.2)
87
+ json (2.19.3)
88
88
  language_server-protocol (3.17.0.5)
89
89
  license_finder (7.2.1)
90
90
  bundler
@@ -96,85 +96,83 @@ GEM
96
96
  xml-simple (~> 1.1.9)
97
97
  lint_roller (1.1.0)
98
98
  logger (1.7.0)
99
- loofah (2.24.1)
99
+ loofah (2.25.1)
100
100
  crass (~> 1.0.2)
101
101
  nokogiri (>= 1.12.0)
102
102
  method_source (1.1.0)
103
103
  mini_portile2 (2.8.9)
104
- minitest (5.25.5)
105
- mutex_m (0.3.0)
106
- net-imap (0.4.22)
107
- date
108
- net-protocol
109
- net-protocol (0.2.2)
110
- timeout
111
- nokogiri (1.18.10)
104
+ minitest (6.0.3)
105
+ drb (~> 2.0)
106
+ prism (~> 1.5)
107
+ nokogiri (1.19.2)
112
108
  mini_portile2 (~> 2.8.2)
113
109
  racc (~> 1.4)
114
- nokogiri (1.18.10-arm64-darwin)
110
+ nokogiri (1.19.2-arm64-darwin)
115
111
  racc (~> 1.4)
116
- nokogiri (1.18.10-x86_64-linux-gnu)
112
+ nokogiri (1.19.2-x86_64-linux-gnu)
117
113
  racc (~> 1.4)
118
- parallel (1.27.0)
119
- parser (3.3.9.0)
114
+ parallel (1.28.0)
115
+ parser (3.3.11.1)
120
116
  ast (~> 2.4.1)
121
117
  racc
122
- pp (0.6.2)
118
+ pp (0.6.3)
123
119
  prettyprint
124
120
  prettyprint (0.2.0)
125
- prism (1.4.0)
121
+ prism (1.9.0)
126
122
  pry (0.14.2)
127
123
  coderay (~> 1.1)
128
124
  method_source (~> 1.0)
129
125
  pry-byebug (3.10.1)
130
126
  byebug (~> 11.0)
131
127
  pry (>= 0.13, < 0.15)
132
- psych (5.2.6)
128
+ psych (5.3.1)
133
129
  date
134
130
  stringio
135
131
  racc (1.8.1)
136
- rack (3.2.0)
137
- rack-session (2.1.1)
132
+ rack (3.2.6)
133
+ rack-session (2.1.2)
138
134
  base64 (>= 0.1.0)
139
135
  rack (>= 3.0.0)
140
136
  rack-test (2.2.0)
141
137
  rack (>= 1.3)
142
- rackup (2.2.1)
138
+ rackup (2.3.1)
143
139
  rack (>= 3)
144
140
  rails-dom-testing (2.3.0)
145
141
  activesupport (>= 5.0.0)
146
142
  minitest
147
143
  nokogiri (>= 1.6)
148
- rails-html-sanitizer (1.6.2)
149
- loofah (~> 2.21)
144
+ rails-html-sanitizer (1.7.0)
145
+ loofah (~> 2.25)
150
146
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
151
- railties (8.0.2)
152
- actionpack (= 8.0.2)
153
- activesupport (= 8.0.2)
147
+ railties (8.1.3)
148
+ actionpack (= 8.1.3)
149
+ activesupport (= 8.1.3)
154
150
  irb (~> 1.13)
155
151
  rackup (>= 1.0.0)
156
152
  rake (>= 12.2)
157
153
  thor (~> 1.0, >= 1.2.2)
154
+ tsort (>= 0.2)
158
155
  zeitwerk (~> 2.6)
159
156
  rainbow (3.1.1)
160
- rake (13.3.0)
161
- rdoc (6.14.2)
157
+ rake (13.3.1)
158
+ rdoc (7.2.0)
162
159
  erb
163
160
  psych (>= 4.0.0)
164
- regexp_parser (2.11.0)
165
- reline (0.6.2)
161
+ tsort
162
+ regexp_parser (2.12.0)
163
+ reline (0.6.3)
166
164
  io-console (~> 0.5)
167
- rexml (3.4.1)
168
- rspec (3.13.1)
165
+ rexml (3.4.4)
166
+ rspec (3.13.2)
169
167
  rspec-core (~> 3.13.0)
170
168
  rspec-expectations (~> 3.13.0)
171
169
  rspec-mocks (~> 3.13.0)
172
- rspec-core (3.13.5)
170
+ rspec-core (3.13.6)
173
171
  rspec-support (~> 3.13.0)
174
172
  rspec-expectations (3.13.5)
175
173
  diff-lcs (>= 1.2.0, < 2.0)
176
174
  rspec-support (~> 3.13.0)
177
- rspec-mocks (3.13.5)
175
+ rspec-mocks (3.13.8)
178
176
  diff-lcs (>= 1.2.0, < 2.0)
179
177
  rspec-support (~> 3.13.0)
180
178
  rspec-rails (6.1.5)
@@ -185,8 +183,8 @@ GEM
185
183
  rspec-expectations (~> 3.13)
186
184
  rspec-mocks (~> 3.13)
187
185
  rspec-support (~> 3.13)
188
- rspec-support (3.13.4)
189
- rubocop (1.75.0)
186
+ rspec-support (3.13.7)
187
+ rubocop (1.82.1)
190
188
  json (~> 2.3)
191
189
  language_server-protocol (~> 3.17.0.2)
192
190
  lint_roller (~> 1.1.0)
@@ -194,50 +192,51 @@ GEM
194
192
  parser (>= 3.3.0.2)
195
193
  rainbow (>= 2.2.2, < 4.0)
196
194
  regexp_parser (>= 2.9.3, < 3.0)
197
- rubocop-ast (>= 1.43.0, < 2.0)
195
+ rubocop-ast (>= 1.48.0, < 2.0)
198
196
  ruby-progressbar (~> 1.7)
199
197
  unicode-display_width (>= 2.4.0, < 4.0)
200
- rubocop-ast (1.46.0)
198
+ rubocop-ast (1.49.1)
201
199
  parser (>= 3.3.7.2)
202
- prism (~> 1.4)
203
- rubocop-performance (1.24.0)
200
+ prism (~> 1.7)
201
+ rubocop-performance (1.26.1)
204
202
  lint_roller (~> 1.1)
205
- rubocop (>= 1.72.1, < 2.0)
206
- rubocop-ast (>= 1.38.0, < 2.0)
207
- rubocop-rails (2.30.3)
203
+ rubocop (>= 1.75.0, < 2.0)
204
+ rubocop-ast (>= 1.47.1, < 2.0)
205
+ rubocop-rails (2.34.3)
208
206
  activesupport (>= 4.2.0)
209
207
  lint_roller (~> 1.1)
210
208
  rack (>= 1.1)
211
- rubocop (>= 1.72.1, < 2.0)
212
- rubocop-ast (>= 1.38.0, < 2.0)
209
+ rubocop (>= 1.75.0, < 2.0)
210
+ rubocop-ast (>= 1.44.0, < 2.0)
213
211
  rubocop-rake (0.7.1)
214
212
  lint_roller (~> 1.1)
215
213
  rubocop (>= 1.72.1)
216
- rubocop-rspec (3.6.0)
214
+ rubocop-rspec (3.9.0)
217
215
  lint_roller (~> 1.1)
218
- rubocop (~> 1.72, >= 1.72.1)
216
+ rubocop (~> 1.81)
219
217
  ruby-progressbar (1.13.0)
220
218
  rubyzip (2.4.1)
221
- securerandom (0.3.2)
222
- sqlite3 (1.7.3)
219
+ securerandom (0.4.1)
220
+ sqlite3 (2.9.2)
223
221
  mini_portile2 (~> 2.8.0)
224
- sqlite3 (1.7.3-arm64-darwin)
225
- sqlite3 (1.7.3-x86_64-linux)
226
- stringio (3.1.7)
227
- thor (1.4.0)
228
- timeout (0.4.3)
229
- tomlrb (2.0.3)
222
+ sqlite3 (2.9.2-arm64-darwin)
223
+ sqlite3 (2.9.2-x86_64-linux-gnu)
224
+ stringio (3.2.0)
225
+ thor (1.5.0)
226
+ timeout (0.6.1)
227
+ tomlrb (2.0.4)
228
+ tsort (0.2.0)
230
229
  tzinfo (2.0.6)
231
230
  concurrent-ruby (~> 1.0)
232
- unicode-display_width (3.1.4)
233
- unicode-emoji (~> 4.0, >= 4.0.4)
234
- unicode-emoji (4.0.4)
235
- uri (1.0.3)
231
+ unicode-display_width (3.2.0)
232
+ unicode-emoji (~> 4.1)
233
+ unicode-emoji (4.2.0)
234
+ uri (1.1.1)
236
235
  useragent (0.16.11)
237
236
  with_env (1.1.0)
238
237
  xml-simple (1.1.9)
239
238
  rexml
240
- zeitwerk (2.6.18)
239
+ zeitwerk (2.7.5)
241
240
 
242
241
  PLATFORMS
243
242
  arm64-darwin-22
@@ -248,26 +247,17 @@ PLATFORMS
248
247
  DEPENDENCIES
249
248
  activerecord (>= 5)
250
249
  appraisal (~> 2.5.0)
251
- base64
252
- bigdecimal
253
250
  bundler (~> 2.1)
254
251
  combustion (~> 1.3)
255
252
  consent!
256
- erb (< 5.1)
257
253
  license_finder (>= 7.0)
258
- logger
259
- mutex_m
260
- net-imap (< 0.5.0)
261
- nokogiri (< 1.19)
262
254
  pry (>= 0.14.2)
263
255
  pry-byebug (= 3.10.1)
264
256
  rake (~> 13)
265
257
  rspec (~> 3.0)
266
258
  rspec-rails (~> 6.1.5)
267
259
  rubocop-powerhome!
268
- securerandom (< 0.4)
269
- sqlite3 (~> 1.7.3)
270
- zeitwerk (< 2.7.0)
260
+ sqlite3 (~> 2.9)
271
261
 
272
262
  BUNDLED WITH
273
263
  2.5.23
data/consent.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Consent permission based authorization"
13
13
  spec.homepage = "https://github.com/powerhome/power-tools"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 3.0"
15
+ spec.required_ruby_version = ">= 3.2"
16
16
 
17
17
  spec.metadata["rubygems_mfa_required"] = "true"
18
18
  spec.files = `git ls-files`.split.grep_v(/^(test|spec|features)/)
@@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
32
  spec.add_development_dependency "rspec-rails", "~> 6.1.5"
33
33
  spec.add_development_dependency "rubocop-powerhome", "0.5.0"
34
- spec.add_development_dependency "sqlite3", "~> 1.7.3"
34
+ spec.add_development_dependency "sqlite3", "~> 2.9"
35
35
  end
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [2.5.0] - 2026-05-27
4
+
5
+ - Drop support for Ruby < 3.3 and Rails < 7.1 [#396](https://github.com/powerhome/power-tools/pull/396)
6
+ - Added a `PermissionDefinitionPayload.generate` method to generate a payload hash of an application's permission defintions. [#433](https://github.com/powerhome/power-tools/pull/433)
7
+
8
+ ### [2.4.0] - 2026-02-04
9
+ - Adds ability to verify and synchronize permission definitions across environments using deterministic checksums [#387](https://github.com/powerhome/power-tools/pull/387)
10
+
3
11
  ## [2.3.0] - 2025-10-29
4
12
 
5
13
  - Standardize all libs to support ruby 3.0, ruby 3.3 x rails 6.1 through rails 7.2 [#359](https://github.com/powerhome/power-tools/pull/359)
data/docs/README.md CHANGED
@@ -133,6 +133,25 @@ department_id = 13, it will run a query similar to:
133
133
  "SELECT * FROM projects WHERE department_id = 1"
134
134
  ```
135
135
 
136
+ ### Verifying Permission Definitions
137
+
138
+ Consent provides methods to verify and synchronize permission definitions across environments:
139
+
140
+ ```ruby
141
+ # Get the concatenated contents of all permission files
142
+ content = Consent.subjects_content([Rails.root.join('app/permissions')])
143
+
144
+ # Calculate a deterministic checksum
145
+ checksum = Consent.subjects_checksum([Rails.root.join('app/permissions')])
146
+ ```
147
+
148
+ These methods are useful for:
149
+ - Verifying permission files are identical across environments
150
+ - Detecting when permission definitions have changed
151
+ - Synchronizing permissions between systems
152
+
153
+ The checksum is deterministic - the same permission file contents will always produce the same SHA256 hash.
154
+
136
155
  ### Subject
137
156
 
138
157
  The subject is the central point of a group of actions and views. It will typically
@@ -1,17 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
5
  source "https://rubygems.org"
4
6
 
5
- gem "base64"
6
- gem "bigdecimal"
7
- gem "erb", "< 5.1"
8
- gem "logger"
9
- gem "mutex_m"
10
- gem "net-imap", "< 0.5.0"
11
- gem "nokogiri", "< 1.19"
7
+ gem "rails", "7.1.5.2"
12
8
  gem "rubocop-powerhome", path: "../../rubocop-powerhome"
13
- gem "securerandom", "< 0.4"
14
- gem "zeitwerk", "< 2.7.0"
15
- gem "rails", "7.1.3.2"
16
9
 
17
10
  gemspec path: "../"