rails-acu 1.2.1 → 1.3.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/Gemfile.lock +1 -1
- data/README.md +0 -5
- data/lib/acu/configs.rb +0 -3
- data/lib/acu/injectors.rb +1 -1
- data/lib/acu/version.rb +1 -1
- data/lib/generators/templates/setup.rb +0 -4
- data/spec/dummy/config/initializers/acu_setup.rb +0 -4
- data/spec/dummy/spec/controllers/admin/manage_controller_spec.rb +0 -1
- data/spec/dummy/spec/controllers/home_controller_spec.rb +0 -6
- metadata +1 -2
- data/rails-acu-1.2.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: addca3a90dcfe917856a671ff499f15acf1e7c38
|
4
|
+
data.tar.gz: 9d3eaf5dc3196adb7e1cf99d53ca363caace2ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '069d76042fbf8fd75a26e36e8da8fb3e05d477af281e5e9a457afeea10a1c0e4a61b0f4cd781997e9d675ba851b3ec19f202a052103751c3c0df13aba30b63e9'
|
7
|
+
data.tar.gz: 3eb795d9641a9c1f37cec2a3687731baf009fb5268b96a200cb7e061400d728ef8dc8b2203b723b6aff7be6ebb38059d09c8d7ab9d881b2549fcb5c832d5b734
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -124,10 +124,6 @@ One of the files that `acu:install` command will generate is `acu_setup.rb` whic
|
|
124
124
|
|
125
125
|
```ruby
|
126
126
|
Acu.setup do |config|
|
127
|
-
# name it to the Base Application Controller that your project
|
128
|
-
# is going to use as a base of all of your controllers.
|
129
|
-
config.base_controller = :ApplicationController
|
130
|
-
|
131
127
|
# to tighten the security this is enabled by default
|
132
128
|
# i.e if it checked to be true, then if a request didn't match to any of rules, it will get passed through
|
133
129
|
# otherwise the requests which don't fit into any of rules, the request is denied by default
|
@@ -159,7 +155,6 @@ Here are the details of the configurations:
|
|
159
155
|
|
160
156
|
| Name | Default | Description |
|
161
157
|
| ----- |-------| ------ |
|
162
|
-
| base_controller | `:ApplicationController` | In order that ACU gem to work it will attach some utilities to the base controller of all controllers, so if your base controller's name is something else change it. |
|
163
158
|
| allow_by_default | `false` | Set it `true` if you want to grant access to requests that doesn't fit to any rules you have defined (**Warning:** please be advised, setting it `true` may cause a security hole in your website if you don't cover the rules perfectly!). |
|
164
159
|
| audit_log_file | | The audit log file, useful for rules debugging! |
|
165
160
|
| use_cache | `false` | ACU can utilize the `Rails.cache` to make the rules matching much faster by caching them, but if caching is enabled and you change the please make user you have cleared the ACU caches by `Acu::Monitor.clear_cache`. |
|
data/lib/acu/configs.rb
CHANGED
data/lib/acu/injectors.rb
CHANGED
@@ -5,7 +5,7 @@ module Acu
|
|
5
5
|
class << self
|
6
6
|
|
7
7
|
ActiveSupport::Notifications.subscribe "start_processing.action_controller" do |**args|
|
8
|
-
eval(
|
8
|
+
eval(args[:controller]).class_eval do
|
9
9
|
before_action { Monitor::gaurd }
|
10
10
|
end
|
11
11
|
end
|
data/lib/acu/version.rb
CHANGED
@@ -1,8 +1,4 @@
|
|
1
1
|
Acu.setup do |config|
|
2
|
-
# name it to the Base Application Controller that your project
|
3
|
-
# is going to use as a base of all of your controllers.
|
4
|
-
config.base_controller = :ApplicationController
|
5
|
-
|
6
2
|
# to tighten the security this is enabled by default
|
7
3
|
# i.e if it checked to be true, then if a request didn't match to any of rules, it will get passed through
|
8
4
|
# otherwise the requests which don't fit into any of rules, the request is denied by default
|
@@ -1,8 +1,4 @@
|
|
1
1
|
Acu.setup do |config|
|
2
|
-
# name it to the Base Application Controller that your project
|
3
|
-
# is going to use as a base of all of your controllers.
|
4
|
-
config.base_controller = :ApplicationController
|
5
|
-
|
6
2
|
# to tighten the security this is enabled by default
|
7
3
|
# i.e if it checked to be true, then if a request didn't match to any of rules, it will get passed through
|
8
4
|
# otherwise the requests which don't fit into any of rules, we be denied by default
|
@@ -7,7 +7,6 @@ RSpec.describe HomeController, type: :controller do
|
|
7
7
|
Acu::Rules.reset
|
8
8
|
# reset configs
|
9
9
|
Acu.setup do |config|
|
10
|
-
config.base_controller = :ApplicationController
|
11
10
|
config.allow_by_default = false
|
12
11
|
config.audit_log_file = '/tmp/acu-rspec.log'
|
13
12
|
config.use_cache = false
|
@@ -24,11 +23,6 @@ RSpec.describe HomeController, type: :controller do
|
|
24
23
|
end
|
25
24
|
|
26
25
|
context 'Acu::Config' do
|
27
|
-
it '.base_controller' do
|
28
|
-
setup base_controller: ":FooBarController"
|
29
|
-
expect {get :index}.to raise_error(NameError)
|
30
|
-
end
|
31
|
-
|
32
26
|
it '.allow_by_default = false' do
|
33
27
|
expect {get :index}.to raise_error(Acu::Errors::AccessDenied)
|
34
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-acu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dariush Hasanpour
|
@@ -61,7 +61,6 @@ files:
|
|
61
61
|
- lib/generators/templates/rules.rb
|
62
62
|
- lib/generators/templates/setup.rb
|
63
63
|
- lib/rails-acu.rb
|
64
|
-
- rails-acu-1.2.0.gem
|
65
64
|
- rails-acu.gemspec
|
66
65
|
- spec/dummy/Rakefile
|
67
66
|
- spec/dummy/app/assets/config/manifest.js
|
data/rails-acu-1.2.0.gem
DELETED
Binary file
|