consent 2.3.0 → 2.4.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.
@@ -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.0)
5
+ rubocop (= 1.82.1)
6
6
  rubocop-performance
7
7
  rubocop-rails
8
8
  rubocop-rake
@@ -11,7 +11,7 @@ PATH
11
11
  PATH
12
12
  remote: ..
13
13
  specs:
14
- consent (2.3.0)
14
+ consent (2.4.0)
15
15
  cancancan (= 3.2.1)
16
16
 
17
17
  GEM
@@ -94,37 +94,37 @@ GEM
94
94
  thor (>= 0.14.0)
95
95
  ast (2.4.3)
96
96
  base64 (0.3.0)
97
- benchmark (0.4.1)
97
+ benchmark (0.5.0)
98
98
  bigdecimal (3.2.2)
99
99
  builder (3.3.0)
100
100
  byebug (11.1.3)
101
101
  cancancan (3.2.1)
102
- cgi (0.5.0)
102
+ cgi (0.5.1)
103
103
  coderay (1.1.3)
104
104
  combustion (1.5.0)
105
105
  activesupport (>= 3.0.0)
106
106
  railties (>= 3.0.0)
107
107
  thor (>= 0.14.6)
108
- concurrent-ruby (1.3.5)
109
- connection_pool (2.5.3)
108
+ concurrent-ruby (1.3.6)
109
+ connection_pool (2.4.1)
110
110
  crass (1.0.6)
111
111
  csv (3.3.5)
112
- date (3.4.1)
112
+ date (3.5.1)
113
113
  diff-lcs (1.6.2)
114
114
  drb (2.2.3)
115
115
  erb (4.0.4)
116
116
  cgi (>= 0.3.3)
117
117
  erubi (1.13.1)
118
- globalid (1.2.1)
118
+ globalid (1.3.0)
119
119
  activesupport (>= 6.1)
120
- i18n (1.14.7)
120
+ i18n (1.14.8)
121
121
  concurrent-ruby (~> 1.0)
122
- io-console (0.8.1)
123
- irb (1.15.2)
122
+ io-console (0.8.2)
123
+ irb (1.16.0)
124
124
  pp (>= 0.6.0)
125
125
  rdoc (>= 4.0.0)
126
126
  reline (>= 0.4.2)
127
- json (2.13.2)
127
+ json (2.18.1)
128
128
  language_server-protocol (3.17.0.5)
129
129
  license_finder (7.2.1)
130
130
  bundler
@@ -136,20 +136,21 @@ GEM
136
136
  xml-simple (~> 1.1.9)
137
137
  lint_roller (1.1.0)
138
138
  logger (1.7.0)
139
- loofah (2.24.1)
139
+ loofah (2.25.0)
140
140
  crass (~> 1.0.2)
141
141
  nokogiri (>= 1.12.0)
142
- mail (2.8.1)
142
+ mail (2.9.0)
143
+ logger
143
144
  mini_mime (>= 0.1.1)
144
145
  net-imap
145
146
  net-pop
146
147
  net-smtp
147
- marcel (1.0.4)
148
+ marcel (1.1.0)
148
149
  method_source (1.1.0)
149
150
  mini_mime (1.1.5)
150
151
  minitest (5.25.5)
151
152
  mutex_m (0.3.0)
152
- net-imap (0.4.22)
153
+ net-imap (0.4.23)
153
154
  date
154
155
  net-protocol
155
156
  net-pop (0.1.2)
@@ -158,7 +159,7 @@ GEM
158
159
  timeout
159
160
  net-smtp (0.5.1)
160
161
  net-protocol
161
- nio4r (2.7.4)
162
+ nio4r (2.7.5)
162
163
  nokogiri (1.17.2-aarch64-linux)
163
164
  racc (~> 1.4)
164
165
  nokogiri (1.17.2-arm-linux)
@@ -172,30 +173,30 @@ GEM
172
173
  nokogiri (1.17.2-x86_64-linux)
173
174
  racc (~> 1.4)
174
175
  parallel (1.27.0)
175
- parser (3.3.9.0)
176
+ parser (3.3.10.1)
176
177
  ast (~> 2.4.1)
177
178
  racc
178
- pp (0.6.2)
179
+ pp (0.6.3)
179
180
  prettyprint
180
181
  prettyprint (0.2.0)
181
- prism (1.4.0)
182
+ prism (1.9.0)
182
183
  pry (0.14.2)
183
184
  coderay (~> 1.1)
184
185
  method_source (~> 1.0)
185
186
  pry-byebug (3.10.1)
186
187
  byebug (~> 11.0)
187
188
  pry (>= 0.13, < 0.15)
188
- psych (5.2.6)
189
+ psych (5.3.1)
189
190
  date
190
191
  stringio
191
192
  racc (1.8.1)
192
- rack (3.1.16)
193
+ rack (3.1.19)
193
194
  rack-session (2.1.1)
194
195
  base64 (>= 0.1.0)
195
196
  rack (>= 3.0.0)
196
197
  rack-test (2.2.0)
197
198
  rack (>= 1.3)
198
- rackup (2.2.1)
199
+ rackup (2.3.1)
199
200
  rack (>= 3)
200
201
  rails (7.2.2.1)
201
202
  actioncable (= 7.2.2.1)
@@ -227,24 +228,25 @@ GEM
227
228
  thor (~> 1.0, >= 1.2.2)
228
229
  zeitwerk (~> 2.6)
229
230
  rainbow (3.1.1)
230
- rake (13.3.0)
231
- rdoc (6.14.2)
231
+ rake (13.3.1)
232
+ rdoc (7.1.0)
232
233
  erb
233
234
  psych (>= 4.0.0)
234
- regexp_parser (2.11.0)
235
- reline (0.6.2)
235
+ tsort
236
+ regexp_parser (2.11.3)
237
+ reline (0.6.3)
236
238
  io-console (~> 0.5)
237
- rexml (3.4.1)
238
- rspec (3.13.1)
239
+ rexml (3.4.4)
240
+ rspec (3.13.2)
239
241
  rspec-core (~> 3.13.0)
240
242
  rspec-expectations (~> 3.13.0)
241
243
  rspec-mocks (~> 3.13.0)
242
- rspec-core (3.13.5)
244
+ rspec-core (3.13.6)
243
245
  rspec-support (~> 3.13.0)
244
246
  rspec-expectations (3.13.5)
245
247
  diff-lcs (>= 1.2.0, < 2.0)
246
248
  rspec-support (~> 3.13.0)
247
- rspec-mocks (3.13.5)
249
+ rspec-mocks (3.13.7)
248
250
  diff-lcs (>= 1.2.0, < 2.0)
249
251
  rspec-support (~> 3.13.0)
250
252
  rspec-rails (6.1.5)
@@ -255,8 +257,8 @@ GEM
255
257
  rspec-expectations (~> 3.13)
256
258
  rspec-mocks (~> 3.13)
257
259
  rspec-support (~> 3.13)
258
- rspec-support (3.13.4)
259
- rubocop (1.75.0)
260
+ rspec-support (3.13.7)
261
+ rubocop (1.82.1)
260
262
  json (~> 2.3)
261
263
  language_server-protocol (~> 3.17.0.2)
262
264
  lint_roller (~> 1.1.0)
@@ -264,28 +266,28 @@ GEM
264
266
  parser (>= 3.3.0.2)
265
267
  rainbow (>= 2.2.2, < 4.0)
266
268
  regexp_parser (>= 2.9.3, < 3.0)
267
- rubocop-ast (>= 1.43.0, < 2.0)
269
+ rubocop-ast (>= 1.48.0, < 2.0)
268
270
  ruby-progressbar (~> 1.7)
269
271
  unicode-display_width (>= 2.4.0, < 4.0)
270
- rubocop-ast (1.46.0)
272
+ rubocop-ast (1.49.0)
271
273
  parser (>= 3.3.7.2)
272
- prism (~> 1.4)
273
- rubocop-performance (1.24.0)
274
+ prism (~> 1.7)
275
+ rubocop-performance (1.26.1)
274
276
  lint_roller (~> 1.1)
275
- rubocop (>= 1.72.1, < 2.0)
276
- rubocop-ast (>= 1.38.0, < 2.0)
277
- rubocop-rails (2.30.3)
277
+ rubocop (>= 1.75.0, < 2.0)
278
+ rubocop-ast (>= 1.47.1, < 2.0)
279
+ rubocop-rails (2.34.3)
278
280
  activesupport (>= 4.2.0)
279
281
  lint_roller (~> 1.1)
280
282
  rack (>= 1.1)
281
- rubocop (>= 1.72.1, < 2.0)
282
- rubocop-ast (>= 1.38.0, < 2.0)
283
+ rubocop (>= 1.75.0, < 2.0)
284
+ rubocop-ast (>= 1.44.0, < 2.0)
283
285
  rubocop-rake (0.7.1)
284
286
  lint_roller (~> 1.1)
285
287
  rubocop (>= 1.72.1)
286
- rubocop-rspec (3.6.0)
288
+ rubocop-rspec (3.9.0)
287
289
  lint_roller (~> 1.1)
288
- rubocop (~> 1.72, >= 1.72.1)
290
+ rubocop (~> 1.81)
289
291
  ruby-progressbar (1.13.0)
290
292
  rubyzip (2.4.1)
291
293
  securerandom (0.3.2)
@@ -295,15 +297,16 @@ GEM
295
297
  sqlite3 (1.7.3-x86-linux)
296
298
  sqlite3 (1.7.3-x86_64-darwin)
297
299
  sqlite3 (1.7.3-x86_64-linux)
298
- stringio (3.1.7)
299
- thor (1.4.0)
300
- timeout (0.4.3)
301
- tomlrb (2.0.3)
300
+ stringio (3.2.0)
301
+ thor (1.5.0)
302
+ timeout (0.6.0)
303
+ tomlrb (2.0.4)
304
+ tsort (0.2.0)
302
305
  tzinfo (2.0.6)
303
306
  concurrent-ruby (~> 1.0)
304
- unicode-display_width (3.1.4)
305
- unicode-emoji (~> 4.0, >= 4.0.4)
306
- unicode-emoji (4.0.4)
307
+ unicode-display_width (3.2.0)
308
+ unicode-emoji (~> 4.1)
309
+ unicode-emoji (4.2.0)
307
310
  useragent (0.16.11)
308
311
  websocket-driver (0.8.0)
309
312
  base64
@@ -325,17 +328,19 @@ PLATFORMS
325
328
  DEPENDENCIES
326
329
  activerecord (>= 5)
327
330
  appraisal (~> 2.5.0)
328
- base64
329
- bigdecimal
331
+ base64 (~> 0.3.0)
332
+ bigdecimal (~> 3.2.0, < 3.2.3)
330
333
  bundler (~> 2.1)
331
334
  combustion (~> 1.3)
335
+ connection_pool (~> 2.4.1)
332
336
  consent!
333
- erb (< 5.1)
337
+ erb (~> 4.0.4)
334
338
  license_finder (>= 7.0)
335
- logger
336
- mutex_m
339
+ logger (~> 1.7.0)
340
+ minitest (~> 5.25.5)
341
+ mutex_m (~> 0.3.0)
337
342
  net-imap (< 0.5.0)
338
- nokogiri (< 1.19)
343
+ nokogiri (~> 1.17.0, < 1.18)
339
344
  pry (>= 0.14.2)
340
345
  pry-byebug (= 3.10.1)
341
346
  rails (= 7.2.2.1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Consent
4
- VERSION = "2.3.0"
4
+ VERSION = "2.4.0"
5
5
  end
data/lib/consent.rb CHANGED
@@ -83,6 +83,26 @@ module Consent
83
83
  Dir[*permission_files].each { |file| Kernel.load(file) }
84
84
  end
85
85
 
86
+ # Returns the concatenated contents of all permission files
87
+ #
88
+ # @param paths [Array<String,#to_s>] paths where the ruby files are located
89
+ # @return [String] concatenated file contents
90
+ def self.subjects_content(paths)
91
+ permission_files = paths.map { |dir| File.join(dir, "*.rb") }
92
+ files = Dir[*permission_files].sort
93
+ files.map { |file| File.read(file) }.join
94
+ end
95
+
96
+ # Calculates a deterministic checksum of all permission files
97
+ #
98
+ # @param paths [Array<String,#to_s>] paths where the ruby files are located
99
+ # @return [String] SHA256 hexdigest of all permission file contents
100
+ def self.subjects_checksum(paths)
101
+ require "digest/sha2"
102
+
103
+ Digest::SHA256.hexdigest(subjects_content(paths))
104
+ end
105
+
86
106
  # Defines a subject with the given key, label and options
87
107
  #
88
108
  # i.e:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consent
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Palhares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-29 00:00:00.000000000 Z
11
+ date: 2026-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancancan