pundit 2.1.1 → 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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +20 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +26 -0
- data/.github/PULL_REQUEST_TEMPLATE/gem_release_template.md +8 -0
- data/.github/pull_request_template.md +9 -0
- data/.github/workflows/main.yml +112 -0
- data/.github/workflows/push_gem.yml +33 -0
- data/.rubocop.yml +14 -18
- data/CHANGELOG.md +52 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/CONTRIBUTING.md +3 -5
- data/Gemfile +3 -2
- data/README.md +117 -62
- data/SECURITY.md +19 -0
- data/config/rubocop-rspec.yml +5 -0
- data/lib/generators/pundit/install/templates/application_policy.rb +1 -1
- data/lib/generators/pundit/policy/templates/policy.rb +11 -4
- data/lib/generators/rspec/templates/policy_spec.rb +1 -1
- data/lib/pundit/authorization.rb +176 -0
- data/lib/pundit/cache_store/legacy_store.rb +17 -0
- data/lib/pundit/cache_store/null_store.rb +18 -0
- data/lib/pundit/context.rb +127 -0
- data/lib/pundit/policy_finder.rb +1 -1
- data/lib/pundit/rspec.rb +23 -1
- data/lib/pundit/version.rb +1 -1
- data/lib/pundit.rb +35 -249
- data/pundit.gemspec +5 -2
- data/spec/authorization_spec.rb +274 -0
- data/spec/dsl_spec.rb +30 -0
- data/spec/generators_spec.rb +43 -0
- data/spec/policies/post_policy_spec.rb +27 -0
- data/spec/policy_finder_spec.rb +1 -1
- data/spec/pundit_spec.rb +59 -244
- data/spec/spec_helper.rb +123 -39
- metadata +42 -10
- data/.travis.yml +0 -25
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pundit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: railties
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 3.0.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 3.0.0
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: rake
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,16 +127,16 @@ dependencies:
|
|
113
127
|
name: rubocop
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
|
-
- -
|
130
|
+
- - ">="
|
117
131
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0
|
132
|
+
version: '0'
|
119
133
|
type: :development
|
120
134
|
prerelease: false
|
121
135
|
version_requirements: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
|
-
- -
|
137
|
+
- - ">="
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0
|
139
|
+
version: '0'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: simplecov
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,14 +168,19 @@ dependencies:
|
|
154
168
|
description: Object oriented authorization for Rails applications
|
155
169
|
email:
|
156
170
|
- jonas.nicklas@gmail.com
|
157
|
-
-
|
171
|
+
- info@varvet.com
|
158
172
|
executables: []
|
159
173
|
extensions: []
|
160
174
|
extra_rdoc_files: []
|
161
175
|
files:
|
176
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
177
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
178
|
+
- ".github/PULL_REQUEST_TEMPLATE/gem_release_template.md"
|
179
|
+
- ".github/pull_request_template.md"
|
180
|
+
- ".github/workflows/main.yml"
|
181
|
+
- ".github/workflows/push_gem.yml"
|
162
182
|
- ".gitignore"
|
163
183
|
- ".rubocop.yml"
|
164
|
-
- ".travis.yml"
|
165
184
|
- ".yardopts"
|
166
185
|
- CHANGELOG.md
|
167
186
|
- CODE_OF_CONDUCT.md
|
@@ -170,6 +189,8 @@ files:
|
|
170
189
|
- LICENSE.txt
|
171
190
|
- README.md
|
172
191
|
- Rakefile
|
192
|
+
- SECURITY.md
|
193
|
+
- config/rubocop-rspec.yml
|
173
194
|
- lib/generators/pundit/install/USAGE
|
174
195
|
- lib/generators/pundit/install/install_generator.rb
|
175
196
|
- lib/generators/pundit/install/templates/application_policy.rb
|
@@ -181,10 +202,17 @@ files:
|
|
181
202
|
- lib/generators/test_unit/policy_generator.rb
|
182
203
|
- lib/generators/test_unit/templates/policy_test.rb
|
183
204
|
- lib/pundit.rb
|
205
|
+
- lib/pundit/authorization.rb
|
206
|
+
- lib/pundit/cache_store/legacy_store.rb
|
207
|
+
- lib/pundit/cache_store/null_store.rb
|
208
|
+
- lib/pundit/context.rb
|
184
209
|
- lib/pundit/policy_finder.rb
|
185
210
|
- lib/pundit/rspec.rb
|
186
211
|
- lib/pundit/version.rb
|
187
212
|
- pundit.gemspec
|
213
|
+
- spec/authorization_spec.rb
|
214
|
+
- spec/dsl_spec.rb
|
215
|
+
- spec/generators_spec.rb
|
188
216
|
- spec/policies/post_policy_spec.rb
|
189
217
|
- spec/policy_finder_spec.rb
|
190
218
|
- spec/pundit_spec.rb
|
@@ -192,7 +220,8 @@ files:
|
|
192
220
|
homepage: https://github.com/varvet/pundit
|
193
221
|
licenses:
|
194
222
|
- MIT
|
195
|
-
metadata:
|
223
|
+
metadata:
|
224
|
+
rubygems_mfa_required: 'true'
|
196
225
|
post_install_message:
|
197
226
|
rdoc_options: []
|
198
227
|
require_paths:
|
@@ -208,11 +237,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
237
|
- !ruby/object:Gem::Version
|
209
238
|
version: '0'
|
210
239
|
requirements: []
|
211
|
-
rubygems_version: 3.
|
240
|
+
rubygems_version: 3.5.11
|
212
241
|
signing_key:
|
213
242
|
specification_version: 4
|
214
243
|
summary: OO authorization for Rails
|
215
244
|
test_files:
|
245
|
+
- spec/authorization_spec.rb
|
246
|
+
- spec/dsl_spec.rb
|
247
|
+
- spec/generators_spec.rb
|
216
248
|
- spec/policies/post_policy_spec.rb
|
217
249
|
- spec/policy_finder_spec.rb
|
218
250
|
- spec/pundit_spec.rb
|
data/.travis.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: focal
|
3
|
-
|
4
|
-
matrix:
|
5
|
-
include:
|
6
|
-
- name: "RuboCop lint on pre-installed Ruby version"
|
7
|
-
rvm: 2.7.1 # Pre-installed Ruby version
|
8
|
-
before_install:
|
9
|
-
- gem install bundler
|
10
|
-
script: bundle exec rake rubocop # ONLY lint once, first
|
11
|
-
- rvm: 2.6.7
|
12
|
-
before_script:
|
13
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
14
|
-
- chmod +x ./cc-test-reporter
|
15
|
-
- ./cc-test-reporter before-build
|
16
|
-
after_script:
|
17
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
18
|
-
- rvm: 2.7.3
|
19
|
-
- rvm: 3.0.1
|
20
|
-
- rvm: jruby-9.2.17.0
|
21
|
-
env:
|
22
|
-
- JRUBY_OPTS="--debug"
|
23
|
-
- rvm: truffleruby-head
|
24
|
-
allow_failures:
|
25
|
-
- rvm: truffleruby-head
|