consent 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95c988d7005c2d40bc6c83a00421e15079737a8759ae635764baf1008e0bd588
4
- data.tar.gz: bdd9f0cc35741ecdf89bbc9b68de9819bcedc87b3e98ddc05a00d086c66d0b6d
3
+ metadata.gz: 4b1d6948271b3646f4e11a1dcede687c2fdc39f8c027ae15e13349ac37c2562e
4
+ data.tar.gz: f9d2751cd4be0849b431eae34b2a30f20738fae9f6c32d39545d7cd3945c08fd
5
5
  SHA512:
6
- metadata.gz: '008f73e94d325ab83a1a63ffa696aea1e22c6db5b44ef49f9d11bc2c1d8773d5a9cf3eec7466870b4cfabb2d13ec23f4d6fa3742cfa5dd6c890322e83694fe0a'
7
- data.tar.gz: aaa27addbb0c0372660f8680e981be5b48a5cc5bb30c42f22d0d75a347111f1733c5b410b67ca8f5e5259bdb76b9283f2af93ec5ce18350aeeed47ac48ccdc87
6
+ metadata.gz: 5df36d982389d1f4d3ee114ee8148bd8b117458bef2873895f0c3e731749194ccd81b5e230ff7db4aa3d4a7129432615613f84773cf938ed0f5fe53ea16e812a
7
+ data.tar.gz: 4386963f1938a72c92555f15f0b656c6fb0e3a2353bdab85306911065c1fe5cce25686454d27a0c171a1631dae68edc2f79fb4dd30e84ab4ffa07b125d42357f
data/.gitignore CHANGED
@@ -11,7 +11,6 @@ vendor/bundle
11
11
  *.log
12
12
  *.sqlite
13
13
  *.sqlite3
14
- Gemfile.lock
15
14
 
16
15
  # Ignore uploaded files in development
17
16
  /storage/*
data/.rubocop.yml CHANGED
@@ -4,7 +4,15 @@ require:
4
4
  - rubocop-powerhome
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.7
7
+ TargetRubyVersion: 3.0
8
+
9
+ Style/FrozenStringLiteralComment:
10
+ Exclude:
11
+ - 'gemfiles/*'
12
+
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'gemfiles/*'
8
16
 
9
17
  Rails:
10
18
  Enabled: false
data/Appraisals ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
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
+ appraise "rails-7-1" do
12
+ gem "rails", "7.1.3.2"
13
+ end
data/Gemfile CHANGED
@@ -5,6 +5,11 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in consent.gemspec
6
6
  gemspec
7
7
 
8
- rails_version = ENV.fetch("RAILS_VERSION", ">= 5")
9
-
10
- gem "rails", rails_version
8
+ gem "base64"
9
+ gem "bigdecimal"
10
+ gem "logger"
11
+ gem "mutex_m"
12
+ gem "net-imap", "< 0.5.0"
13
+ gem "nokogiri", "< 1.18"
14
+ gem "rubocop-powerhome", path: "../rubocop-powerhome"
15
+ gem "zeitwerk", "< 2.7.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,259 @@
1
+ PATH
2
+ remote: ../rubocop-powerhome
3
+ specs:
4
+ rubocop-powerhome (0.5.3)
5
+ rubocop (= 1.66.1)
6
+ rubocop-performance
7
+ rubocop-rails
8
+ rubocop-rake
9
+ rubocop-rspec
10
+
11
+ PATH
12
+ remote: .
13
+ specs:
14
+ consent (2.1.0)
15
+ cancancan (= 3.2.1)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ actionpack (8.0.1)
21
+ actionview (= 8.0.1)
22
+ activesupport (= 8.0.1)
23
+ nokogiri (>= 1.8.5)
24
+ rack (>= 2.2.4)
25
+ rack-session (>= 1.0.1)
26
+ rack-test (>= 0.6.3)
27
+ rails-dom-testing (~> 2.2)
28
+ rails-html-sanitizer (~> 1.6)
29
+ useragent (~> 0.16)
30
+ actionview (8.0.1)
31
+ activesupport (= 8.0.1)
32
+ builder (~> 3.1)
33
+ erubi (~> 1.11)
34
+ rails-dom-testing (~> 2.2)
35
+ rails-html-sanitizer (~> 1.6)
36
+ activemodel (8.0.1)
37
+ activesupport (= 8.0.1)
38
+ activerecord (8.0.1)
39
+ activemodel (= 8.0.1)
40
+ activesupport (= 8.0.1)
41
+ timeout (>= 0.4.0)
42
+ activesupport (8.0.1)
43
+ base64
44
+ benchmark (>= 0.3)
45
+ bigdecimal
46
+ concurrent-ruby (~> 1.0, >= 1.3.1)
47
+ connection_pool (>= 2.2.5)
48
+ drb
49
+ i18n (>= 1.6, < 2)
50
+ logger (>= 1.4.2)
51
+ minitest (>= 5.1)
52
+ securerandom (>= 0.3)
53
+ tzinfo (~> 2.0, >= 2.0.5)
54
+ uri (>= 0.13.1)
55
+ appraisal (2.5.0)
56
+ bundler
57
+ rake
58
+ thor (>= 0.14.0)
59
+ ast (2.4.2)
60
+ base64 (0.2.0)
61
+ benchmark (0.4.0)
62
+ bigdecimal (3.1.9)
63
+ builder (3.3.0)
64
+ byebug (11.1.3)
65
+ cancancan (3.2.1)
66
+ coderay (1.1.3)
67
+ combustion (1.5.0)
68
+ activesupport (>= 3.0.0)
69
+ railties (>= 3.0.0)
70
+ thor (>= 0.14.6)
71
+ concurrent-ruby (1.3.5)
72
+ connection_pool (2.5.0)
73
+ crass (1.0.6)
74
+ csv (3.3.2)
75
+ date (3.4.1)
76
+ diff-lcs (1.6.0)
77
+ drb (2.2.1)
78
+ erubi (1.13.1)
79
+ i18n (1.14.7)
80
+ concurrent-ruby (~> 1.0)
81
+ io-console (0.8.0)
82
+ irb (1.15.1)
83
+ pp (>= 0.6.0)
84
+ rdoc (>= 4.0.0)
85
+ reline (>= 0.4.2)
86
+ json (2.10.1)
87
+ language_server-protocol (3.17.0.4)
88
+ license_finder (7.2.1)
89
+ bundler
90
+ csv (~> 3.2)
91
+ rubyzip (>= 1, < 3)
92
+ thor (~> 1.2)
93
+ tomlrb (>= 1.3, < 2.1)
94
+ with_env (= 1.1.0)
95
+ xml-simple (~> 1.1.9)
96
+ logger (1.6.6)
97
+ loofah (2.24.0)
98
+ crass (~> 1.0.2)
99
+ nokogiri (>= 1.12.0)
100
+ method_source (1.1.0)
101
+ mini_portile2 (2.8.8)
102
+ minitest (5.25.4)
103
+ mutex_m (0.3.0)
104
+ net-imap (0.4.19)
105
+ date
106
+ net-protocol
107
+ net-protocol (0.2.2)
108
+ timeout
109
+ nokogiri (1.17.2)
110
+ mini_portile2 (~> 2.8.2)
111
+ racc (~> 1.4)
112
+ nokogiri (1.17.2-arm64-darwin)
113
+ racc (~> 1.4)
114
+ nokogiri (1.17.2-x86_64-linux)
115
+ racc (~> 1.4)
116
+ parallel (1.26.3)
117
+ parser (3.3.7.1)
118
+ ast (~> 2.4.1)
119
+ racc
120
+ pp (0.6.2)
121
+ prettyprint
122
+ prettyprint (0.2.0)
123
+ pry (0.14.2)
124
+ coderay (~> 1.1)
125
+ method_source (~> 1.0)
126
+ pry-byebug (3.10.1)
127
+ byebug (~> 11.0)
128
+ pry (>= 0.13, < 0.15)
129
+ psych (5.2.3)
130
+ date
131
+ stringio
132
+ racc (1.8.1)
133
+ rack (3.1.10)
134
+ rack-session (2.1.0)
135
+ base64 (>= 0.1.0)
136
+ rack (>= 3.0.0)
137
+ rack-test (2.2.0)
138
+ rack (>= 1.3)
139
+ rackup (2.2.1)
140
+ rack (>= 3)
141
+ rails-dom-testing (2.2.0)
142
+ activesupport (>= 5.0.0)
143
+ minitest
144
+ nokogiri (>= 1.6)
145
+ rails-html-sanitizer (1.6.2)
146
+ loofah (~> 2.21)
147
+ 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)
148
+ railties (8.0.1)
149
+ actionpack (= 8.0.1)
150
+ activesupport (= 8.0.1)
151
+ irb (~> 1.13)
152
+ rackup (>= 1.0.0)
153
+ rake (>= 12.2)
154
+ thor (~> 1.0, >= 1.2.2)
155
+ zeitwerk (~> 2.6)
156
+ rainbow (3.1.1)
157
+ rake (13.2.1)
158
+ rdoc (6.12.0)
159
+ psych (>= 4.0.0)
160
+ regexp_parser (2.10.0)
161
+ reline (0.6.0)
162
+ io-console (~> 0.5)
163
+ rexml (3.4.1)
164
+ rspec (3.13.0)
165
+ rspec-core (~> 3.13.0)
166
+ rspec-expectations (~> 3.13.0)
167
+ rspec-mocks (~> 3.13.0)
168
+ rspec-core (3.13.3)
169
+ rspec-support (~> 3.13.0)
170
+ rspec-expectations (3.13.3)
171
+ diff-lcs (>= 1.2.0, < 2.0)
172
+ rspec-support (~> 3.13.0)
173
+ rspec-mocks (3.13.2)
174
+ diff-lcs (>= 1.2.0, < 2.0)
175
+ rspec-support (~> 3.13.0)
176
+ rspec-rails (6.1.5)
177
+ actionpack (>= 6.1)
178
+ activesupport (>= 6.1)
179
+ railties (>= 6.1)
180
+ rspec-core (~> 3.13)
181
+ rspec-expectations (~> 3.13)
182
+ rspec-mocks (~> 3.13)
183
+ rspec-support (~> 3.13)
184
+ rspec-support (3.13.2)
185
+ rubocop (1.66.1)
186
+ json (~> 2.3)
187
+ language_server-protocol (>= 3.17.0)
188
+ parallel (~> 1.10)
189
+ parser (>= 3.3.0.2)
190
+ rainbow (>= 2.2.2, < 4.0)
191
+ regexp_parser (>= 2.4, < 3.0)
192
+ rubocop-ast (>= 1.32.2, < 2.0)
193
+ ruby-progressbar (~> 1.7)
194
+ unicode-display_width (>= 2.4.0, < 3.0)
195
+ rubocop-ast (1.38.0)
196
+ parser (>= 3.3.1.0)
197
+ rubocop-performance (1.23.1)
198
+ rubocop (>= 1.48.1, < 2.0)
199
+ rubocop-ast (>= 1.31.1, < 2.0)
200
+ rubocop-rails (2.29.1)
201
+ activesupport (>= 4.2.0)
202
+ rack (>= 1.1)
203
+ rubocop (>= 1.52.0, < 2.0)
204
+ rubocop-ast (>= 1.31.1, < 2.0)
205
+ rubocop-rake (0.6.0)
206
+ rubocop (~> 1.0)
207
+ rubocop-rspec (3.4.0)
208
+ rubocop (~> 1.61)
209
+ ruby-progressbar (1.13.0)
210
+ rubyzip (2.4.1)
211
+ securerandom (0.4.1)
212
+ sqlite3 (1.7.3)
213
+ mini_portile2 (~> 2.8.0)
214
+ sqlite3 (1.7.3-arm64-darwin)
215
+ sqlite3 (1.7.3-x86_64-linux)
216
+ stringio (3.1.3)
217
+ thor (1.3.2)
218
+ timeout (0.4.3)
219
+ tomlrb (2.0.3)
220
+ tzinfo (2.0.6)
221
+ concurrent-ruby (~> 1.0)
222
+ unicode-display_width (2.6.0)
223
+ uri (1.0.2)
224
+ useragent (0.16.11)
225
+ with_env (1.1.0)
226
+ xml-simple (1.1.9)
227
+ rexml
228
+ zeitwerk (2.6.18)
229
+
230
+ PLATFORMS
231
+ arm64-darwin-22
232
+ arm64-darwin-23
233
+ ruby
234
+ x86_64-linux
235
+
236
+ DEPENDENCIES
237
+ activerecord (>= 5)
238
+ appraisal (~> 2.5.0)
239
+ base64
240
+ bigdecimal
241
+ bundler (~> 2.1)
242
+ combustion (~> 1.3)
243
+ consent!
244
+ license_finder (>= 7.0)
245
+ logger
246
+ mutex_m
247
+ net-imap (< 0.5.0)
248
+ nokogiri (< 1.18)
249
+ pry (>= 0.14.2)
250
+ pry-byebug (= 3.10.1)
251
+ rake (~> 13)
252
+ rspec (~> 3.0)
253
+ rspec-rails (~> 6.1.5)
254
+ rubocop-powerhome!
255
+ sqlite3 (~> 1.7.3)
256
+ zeitwerk (< 2.7.0)
257
+
258
+ BUNDLED WITH
259
+ 2.5.23
@@ -2,9 +2,10 @@
2
2
 
3
3
  module Consent
4
4
  class History < ::Consent::ApplicationRecord
5
+ include Consent::SubjectCoder::Model
6
+
5
7
  enum command: { grant: "grant", revoke: "revoke" }
6
8
 
7
- serialize :subject, ::Consent::SubjectCoder
8
9
  validates :subject, presence: true
9
10
  validates :action, presence: true
10
11
  validates :view, presence: true
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Consent
4
4
  class Permission < ::Consent::ApplicationRecord
5
- serialize :subject, ::Consent::SubjectCoder
5
+ include Consent::SubjectCoder::Model
6
6
 
7
7
  validates :subject, presence: true
8
8
  validates :action, presence: true
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'consent'
4
+ require "bundler/setup"
5
+ require "consent"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'consent'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start
data/consent.gemspec CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path("lib", __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "consent/version"
3
+ require_relative "lib/consent/version"
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = "consent"
@@ -14,22 +12,24 @@ Gem::Specification.new do |spec|
14
12
  spec.description = "Consent permission based authorization"
15
13
  spec.homepage = "https://github.com/powerhome/power-tools"
16
14
  spec.license = "MIT"
17
- spec.required_ruby_version = ">= 2.7"
15
+ spec.required_ruby_version = ">= 3.0"
18
16
 
17
+ spec.metadata["rubygems_mfa_required"] = "true"
19
18
  spec.files = `git ls-files`.split.grep_v(/^(test|spec|features)/)
20
19
  spec.require_paths = ["lib"]
21
20
 
22
21
  spec.add_dependency "cancancan", "3.2.1"
23
22
 
24
23
  spec.add_development_dependency "activerecord", ">= 5"
24
+ spec.add_development_dependency "appraisal", "~> 2.5.0"
25
25
  spec.add_development_dependency "bundler", "~> 2.1"
26
26
  spec.add_development_dependency "combustion", "~> 1.3"
27
27
  spec.add_development_dependency "license_finder", ">= 7.0"
28
- spec.add_development_dependency "pry-byebug", "3.9.0"
28
+ spec.add_development_dependency "pry", ">= 0.14.2"
29
+ spec.add_development_dependency "pry-byebug", "3.10.1"
29
30
  spec.add_development_dependency "rake", "~> 13"
30
31
  spec.add_development_dependency "rspec", "~> 3.0"
31
- spec.add_development_dependency "rspec-rails", "~> 5.1.2"
32
+ spec.add_development_dependency "rspec-rails", "~> 6.1.5"
32
33
  spec.add_development_dependency "rubocop-powerhome", "0.5.0"
33
- spec.add_development_dependency "sqlite3", "~> 1.4.2"
34
- spec.metadata["rubygems_mfa_required"] = "true"
34
+ spec.add_development_dependency "sqlite3", "~> 1.7.3"
35
35
  end
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.1.0] - 2025-02-19
4
+
5
+ - Add support to rails 7.1+ [#308](https://github.com/powerhome/power-tools/pull/308)
6
+ - removed eval_view as a legacy, unsafe concern
7
+
8
+ ## [2.0.1] - 2023-01-08
9
+
10
+ - Bugfixes, minor version bumps
11
+
3
12
  ## [2.0.0] - 2022-09-02
4
13
 
5
14
  - Support multiple versions of rails (>= 5.2.8.1)
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "base64"
6
+ gem "bigdecimal"
7
+ gem "logger"
8
+ gem "mutex_m"
9
+ gem "net-imap", "< 0.5.0"
10
+ gem "nokogiri", "< 1.18"
11
+ gem "rubocop-powerhome", path: "../../rubocop-powerhome"
12
+ gem "zeitwerk", "< 2.7.0"
13
+ gem "rails", "6.1.7.7"
14
+
15
+ gemspec path: "../"