authorized_persona 0.14.0 → 0.15.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 +4 -4
- data/.github/workflows/ci.yml +4 -0
- data/Appraisals +4 -0
- data/Gemfile.lock +3 -3
- data/authorized_persona.gemspec +1 -1
- data/gemfiles/rails_8_0.gemfile.lock +3 -3
- data/gemfiles/rails_8_1.gemfile +10 -0
- data/gemfiles/rails_8_1.gemfile.lock +225 -0
- data/lib/authorized_persona/authorization.rb +2 -2
- data/lib/authorized_persona/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3771cb7baf429186540b88ab974c0904af5ddcd1f01c2cf9dbe88c232d0bc464
|
|
4
|
+
data.tar.gz: 3960b4f8deae656df5ab1a75958f7d26d8a32c29433db97471167cd2cad5a58e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 518e7423826c9c260ad7f085c75fbe007c78931c14702b0982e777079b6399659f0d6c1c18283b1cdf6cbeaa6e3b98313ab30714558bddc8b662b7f805d8db1b
|
|
7
|
+
data.tar.gz: 0f1f667c4424c88eb44b5e2412f30d7309e98a8f6868c15b7b2a4054cc7821ee5dc95bef54c5c9009652c520d63664a4fde4f762ec74aebc12dacb4c39dc08a4
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -11,6 +11,10 @@ jobs:
|
|
|
11
11
|
ruby: ['3.3', '3.4']
|
|
12
12
|
gemfile:
|
|
13
13
|
- gemfiles/rails_8_0.gemfile
|
|
14
|
+
- gemfiles/rails_8_1.gemfile
|
|
15
|
+
exclude:
|
|
16
|
+
- ruby: '3.2'
|
|
17
|
+
gemfile: gemfiles/rails_8_1.gemfile
|
|
14
18
|
steps:
|
|
15
19
|
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
|
|
16
20
|
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
|
data/Appraisals
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
authorized_persona (0.
|
|
5
|
-
railties (>= 8.0, < 8.
|
|
4
|
+
authorized_persona (0.15.0)
|
|
5
|
+
railties (>= 8.0, < 8.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
@@ -189,7 +189,7 @@ PLATFORMS
|
|
|
189
189
|
x86_64-linux
|
|
190
190
|
|
|
191
191
|
DEPENDENCIES
|
|
192
|
-
activemodel (>= 8.0, < 8.
|
|
192
|
+
activemodel (>= 8.0, < 8.2)
|
|
193
193
|
appraisal
|
|
194
194
|
authorized_persona!
|
|
195
195
|
betterlint
|
data/authorized_persona.gemspec
CHANGED
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
26
|
spec.require_paths = ["lib"]
|
|
27
27
|
|
|
28
|
-
rails_version_range = [">= 8.0", "< 8.
|
|
28
|
+
rails_version_range = [">= 8.0", "< 8.2"]
|
|
29
29
|
|
|
30
30
|
spec.add_dependency "railties", *rails_version_range
|
|
31
31
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
authorized_persona (0.
|
|
5
|
-
railties (>= 8.0, < 8.
|
|
4
|
+
authorized_persona (0.15.0)
|
|
5
|
+
railties (>= 8.0, < 8.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
@@ -187,7 +187,7 @@ PLATFORMS
|
|
|
187
187
|
x86_64-linux
|
|
188
188
|
|
|
189
189
|
DEPENDENCIES
|
|
190
|
-
activemodel (>= 8.0, < 8.
|
|
190
|
+
activemodel (>= 8.0, < 8.2)
|
|
191
191
|
appraisal
|
|
192
192
|
authorized_persona!
|
|
193
193
|
betterlint
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
authorized_persona (0.15.0)
|
|
5
|
+
railties (>= 8.0, < 8.2)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
actionpack (8.1.3)
|
|
11
|
+
actionview (= 8.1.3)
|
|
12
|
+
activesupport (= 8.1.3)
|
|
13
|
+
nokogiri (>= 1.8.5)
|
|
14
|
+
rack (>= 2.2.4)
|
|
15
|
+
rack-session (>= 1.0.1)
|
|
16
|
+
rack-test (>= 0.6.3)
|
|
17
|
+
rails-dom-testing (~> 2.2)
|
|
18
|
+
rails-html-sanitizer (~> 1.6)
|
|
19
|
+
useragent (~> 0.16)
|
|
20
|
+
actionview (8.1.3)
|
|
21
|
+
activesupport (= 8.1.3)
|
|
22
|
+
builder (~> 3.1)
|
|
23
|
+
erubi (~> 1.11)
|
|
24
|
+
rails-dom-testing (~> 2.2)
|
|
25
|
+
rails-html-sanitizer (~> 1.6)
|
|
26
|
+
activemodel (8.1.3)
|
|
27
|
+
activesupport (= 8.1.3)
|
|
28
|
+
activesupport (8.1.3)
|
|
29
|
+
base64
|
|
30
|
+
bigdecimal
|
|
31
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
32
|
+
connection_pool (>= 2.2.5)
|
|
33
|
+
drb
|
|
34
|
+
i18n (>= 1.6, < 2)
|
|
35
|
+
json
|
|
36
|
+
logger (>= 1.4.2)
|
|
37
|
+
minitest (>= 5.1)
|
|
38
|
+
securerandom (>= 0.3)
|
|
39
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
40
|
+
uri (>= 0.13.1)
|
|
41
|
+
appraisal (2.5.0)
|
|
42
|
+
bundler
|
|
43
|
+
rake
|
|
44
|
+
thor (>= 0.14.0)
|
|
45
|
+
ast (2.4.3)
|
|
46
|
+
base64 (0.3.0)
|
|
47
|
+
betterlint (1.28.0)
|
|
48
|
+
lint_roller (~> 1.1)
|
|
49
|
+
rubocop (~> 1.82)
|
|
50
|
+
rubocop-capybara (~> 2.22)
|
|
51
|
+
rubocop-factory_bot (~> 2.28)
|
|
52
|
+
rubocop-graphql (~> 1.5, >= 1.5.6)
|
|
53
|
+
rubocop-performance (~> 1.26)
|
|
54
|
+
rubocop-rails (~> 2.34)
|
|
55
|
+
rubocop-rake (~> 0.7)
|
|
56
|
+
rubocop-rspec (~> 3.8)
|
|
57
|
+
rubocop-rspec_rails (~> 2.32)
|
|
58
|
+
bigdecimal (4.1.2)
|
|
59
|
+
builder (3.3.0)
|
|
60
|
+
concurrent-ruby (1.3.8)
|
|
61
|
+
connection_pool (3.0.2)
|
|
62
|
+
crass (1.0.7)
|
|
63
|
+
diff-lcs (1.6.2)
|
|
64
|
+
drb (2.2.3)
|
|
65
|
+
erb (6.0.6)
|
|
66
|
+
erubi (1.13.1)
|
|
67
|
+
i18n (1.15.2)
|
|
68
|
+
concurrent-ruby (~> 1.0)
|
|
69
|
+
io-console (0.8.2)
|
|
70
|
+
irb (1.18.0)
|
|
71
|
+
pp (>= 0.6.0)
|
|
72
|
+
prism (>= 1.3.0)
|
|
73
|
+
rdoc (>= 4.0.0)
|
|
74
|
+
reline (>= 0.4.2)
|
|
75
|
+
json (2.21.1)
|
|
76
|
+
language_server-protocol (3.17.0.6)
|
|
77
|
+
lint_roller (1.1.0)
|
|
78
|
+
logger (1.7.0)
|
|
79
|
+
loofah (2.25.2)
|
|
80
|
+
crass (~> 1.0.2)
|
|
81
|
+
nokogiri (>= 1.12.0)
|
|
82
|
+
mini_portile2 (2.8.9)
|
|
83
|
+
minitest (6.0.6)
|
|
84
|
+
drb (~> 2.0)
|
|
85
|
+
prism (~> 1.5)
|
|
86
|
+
nokogiri (1.17.2)
|
|
87
|
+
mini_portile2 (~> 2.8.2)
|
|
88
|
+
racc (~> 1.4)
|
|
89
|
+
parallel (2.1.0)
|
|
90
|
+
parser (3.3.12.0)
|
|
91
|
+
ast (~> 2.4.1)
|
|
92
|
+
racc
|
|
93
|
+
pp (0.6.4)
|
|
94
|
+
prettyprint
|
|
95
|
+
prettyprint (0.2.0)
|
|
96
|
+
prism (1.9.0)
|
|
97
|
+
racc (1.8.1)
|
|
98
|
+
rack (3.2.6)
|
|
99
|
+
rack-session (2.1.2)
|
|
100
|
+
base64 (>= 0.1.0)
|
|
101
|
+
rack (>= 3.0.0)
|
|
102
|
+
rack-test (2.2.0)
|
|
103
|
+
rack (>= 1.3)
|
|
104
|
+
rackup (2.3.1)
|
|
105
|
+
rack (>= 3)
|
|
106
|
+
rails-dom-testing (2.3.0)
|
|
107
|
+
activesupport (>= 5.0.0)
|
|
108
|
+
minitest
|
|
109
|
+
nokogiri (>= 1.6)
|
|
110
|
+
rails-html-sanitizer (1.7.1)
|
|
111
|
+
loofah (~> 2.25, >= 2.25.2)
|
|
112
|
+
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)
|
|
113
|
+
railties (8.1.3)
|
|
114
|
+
actionpack (= 8.1.3)
|
|
115
|
+
activesupport (= 8.1.3)
|
|
116
|
+
irb (~> 1.13)
|
|
117
|
+
rackup (>= 1.0.0)
|
|
118
|
+
rake (>= 12.2)
|
|
119
|
+
thor (~> 1.0, >= 1.2.2)
|
|
120
|
+
tsort (>= 0.2)
|
|
121
|
+
zeitwerk (~> 2.6)
|
|
122
|
+
rainbow (3.1.1)
|
|
123
|
+
rake (13.4.2)
|
|
124
|
+
rbs (4.0.3)
|
|
125
|
+
logger
|
|
126
|
+
prism (>= 1.6.0)
|
|
127
|
+
tsort
|
|
128
|
+
rdoc (8.0.0)
|
|
129
|
+
erb
|
|
130
|
+
prism (>= 1.6.0)
|
|
131
|
+
rbs (>= 4.0.0)
|
|
132
|
+
tsort
|
|
133
|
+
regexp_parser (2.12.0)
|
|
134
|
+
reline (0.6.3)
|
|
135
|
+
io-console (~> 0.5)
|
|
136
|
+
rspec (3.13.2)
|
|
137
|
+
rspec-core (~> 3.13.0)
|
|
138
|
+
rspec-expectations (~> 3.13.0)
|
|
139
|
+
rspec-mocks (~> 3.13.0)
|
|
140
|
+
rspec-core (3.13.6)
|
|
141
|
+
rspec-support (~> 3.13.0)
|
|
142
|
+
rspec-expectations (3.13.5)
|
|
143
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
144
|
+
rspec-support (~> 3.13.0)
|
|
145
|
+
rspec-mocks (3.13.8)
|
|
146
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
147
|
+
rspec-support (~> 3.13.0)
|
|
148
|
+
rspec-support (3.13.7)
|
|
149
|
+
rubocop (1.88.2)
|
|
150
|
+
json (~> 2.3)
|
|
151
|
+
language_server-protocol (~> 3.17.0.2)
|
|
152
|
+
lint_roller (~> 1.1.0)
|
|
153
|
+
parallel (>= 1.10)
|
|
154
|
+
parser (>= 3.3.0.2)
|
|
155
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
156
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
157
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
158
|
+
ruby-progressbar (~> 1.7)
|
|
159
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
160
|
+
rubocop-ast (1.50.0)
|
|
161
|
+
parser (>= 3.3.7.2)
|
|
162
|
+
prism (~> 1.7)
|
|
163
|
+
rubocop-capybara (2.23.0)
|
|
164
|
+
lint_roller (~> 1.1)
|
|
165
|
+
rubocop (~> 1.81)
|
|
166
|
+
rubocop-factory_bot (2.28.0)
|
|
167
|
+
lint_roller (~> 1.1)
|
|
168
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
169
|
+
rubocop-graphql (1.6.0)
|
|
170
|
+
lint_roller (~> 1.1)
|
|
171
|
+
rubocop (>= 1.72.1, < 2)
|
|
172
|
+
rubocop-performance (1.26.1)
|
|
173
|
+
lint_roller (~> 1.1)
|
|
174
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
175
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
176
|
+
rubocop-rails (2.36.0)
|
|
177
|
+
activesupport (>= 4.2.0)
|
|
178
|
+
lint_roller (~> 1.1)
|
|
179
|
+
rack (>= 1.1)
|
|
180
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
181
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
182
|
+
rubocop-rake (0.7.1)
|
|
183
|
+
lint_roller (~> 1.1)
|
|
184
|
+
rubocop (>= 1.72.1)
|
|
185
|
+
rubocop-rspec (3.10.2)
|
|
186
|
+
lint_roller (~> 1.1)
|
|
187
|
+
regexp_parser (>= 2.0)
|
|
188
|
+
rubocop (~> 1.86, >= 1.86.2)
|
|
189
|
+
rubocop-rspec_rails (2.32.0)
|
|
190
|
+
lint_roller (~> 1.1)
|
|
191
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
192
|
+
rubocop-rspec (~> 3.5)
|
|
193
|
+
ruby-progressbar (1.13.0)
|
|
194
|
+
securerandom (0.3.2)
|
|
195
|
+
thor (1.5.0)
|
|
196
|
+
tsort (0.2.0)
|
|
197
|
+
tzinfo (2.0.6)
|
|
198
|
+
concurrent-ruby (~> 1.0)
|
|
199
|
+
unicode-display_width (3.2.0)
|
|
200
|
+
unicode-emoji (~> 4.1)
|
|
201
|
+
unicode-emoji (4.2.0)
|
|
202
|
+
uri (1.1.1)
|
|
203
|
+
useragent (0.16.11)
|
|
204
|
+
zeitwerk (2.6.18)
|
|
205
|
+
|
|
206
|
+
PLATFORMS
|
|
207
|
+
arm64-darwin-23
|
|
208
|
+
arm64-darwin-25
|
|
209
|
+
x86_64-linux
|
|
210
|
+
|
|
211
|
+
DEPENDENCIES
|
|
212
|
+
activemodel (>= 8.0, < 8.2)
|
|
213
|
+
appraisal
|
|
214
|
+
authorized_persona!
|
|
215
|
+
betterlint
|
|
216
|
+
bundler
|
|
217
|
+
nokogiri (~> 1.17.2)
|
|
218
|
+
railties (~> 8.1.0)
|
|
219
|
+
rake
|
|
220
|
+
rspec (~> 3.0)
|
|
221
|
+
securerandom (~> 0.3.2)
|
|
222
|
+
zeitwerk (~> 2.6.18)
|
|
223
|
+
|
|
224
|
+
BUNDLED WITH
|
|
225
|
+
2.4.21
|
|
@@ -15,7 +15,7 @@ module AuthorizedPersona
|
|
|
15
15
|
|
|
16
16
|
class_methods do
|
|
17
17
|
# Configure authorization for an authorized persona class
|
|
18
|
-
def authorize_persona(class_name:, current_user_method: nil) # rubocop:disable Metrics/
|
|
18
|
+
def authorize_persona(class_name:, current_user_method: nil) # rubocop:disable Metrics/PerceivedComplexity
|
|
19
19
|
raise AuthorizedPersona::Error, "you can only configure authorization once" if authorization_persona_class_name.present?
|
|
20
20
|
raise AuthorizedPersona::Error, "class_name must be a string" unless class_name.is_a?(String)
|
|
21
21
|
raise AuthorizedPersona::Error, "current_user_method must be a symbol" if current_user_method && !current_user_method.is_a?(Symbol)
|
|
@@ -97,7 +97,7 @@ module AuthorizedPersona
|
|
|
97
97
|
respond_to do |format|
|
|
98
98
|
format.html do
|
|
99
99
|
flash[:error] = 'You are not authorized to perform this action.'
|
|
100
|
-
|
|
100
|
+
redirect_back_or_to '/', allow_other_host: false
|
|
101
101
|
end
|
|
102
102
|
format.json do
|
|
103
103
|
render json: {}, status: :unauthorized
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: authorized_persona
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Mileham
|
|
@@ -18,7 +18,7 @@ dependencies:
|
|
|
18
18
|
version: '8.0'
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '8.
|
|
21
|
+
version: '8.2'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -28,7 +28,7 @@ dependencies:
|
|
|
28
28
|
version: '8.0'
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: '8.
|
|
31
|
+
version: '8.2'
|
|
32
32
|
- !ruby/object:Gem::Dependency
|
|
33
33
|
name: activemodel
|
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,7 +38,7 @@ dependencies:
|
|
|
38
38
|
version: '8.0'
|
|
39
39
|
- - "<"
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: '8.
|
|
41
|
+
version: '8.2'
|
|
42
42
|
type: :development
|
|
43
43
|
prerelease: false
|
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -48,7 +48,7 @@ dependencies:
|
|
|
48
48
|
version: '8.0'
|
|
49
49
|
- - "<"
|
|
50
50
|
- !ruby/object:Gem::Version
|
|
51
|
-
version: '8.
|
|
51
|
+
version: '8.2'
|
|
52
52
|
- !ruby/object:Gem::Dependency
|
|
53
53
|
name: appraisal
|
|
54
54
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -145,6 +145,8 @@ files:
|
|
|
145
145
|
- bin/setup
|
|
146
146
|
- gemfiles/rails_8_0.gemfile
|
|
147
147
|
- gemfiles/rails_8_0.gemfile.lock
|
|
148
|
+
- gemfiles/rails_8_1.gemfile
|
|
149
|
+
- gemfiles/rails_8_1.gemfile.lock
|
|
148
150
|
- lib/authorized_persona.rb
|
|
149
151
|
- lib/authorized_persona/authorization.rb
|
|
150
152
|
- lib/authorized_persona/persona.rb
|