action_interceptor 0.2.4 → 0.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 +8 -8
- data/README.md +1 -1
- data/Rakefile +0 -1
- data/lib/action_interceptor/common.rb +2 -2
- data/lib/action_interceptor/encryptor.rb +7 -3
- data/lib/action_interceptor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODI1YzZmYmQ1MjU4YjUwY2IwMmJkZTUyNjdiNzVmMDIxMTg4OWYzMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2E5NTczN2RkZWNiZGQxNjgzMzhiNGZmODYyNWM0ZjAxZjBhYWI3Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzNkODA1MWQ4NTQ2YWIwOWRiZGM0NzFjZDRlMWI4YTRlYjNhZDM4Y2Y3YmJi
|
10
|
+
MTk0NDE0NWViZjIyN2ViYjlkYzE5NzNhZmUxNzI0NTVkN2UxOGQ4ZjM3YzBl
|
11
|
+
YWViMWIxZjBlZWNhMzJlZDlkMzQzOTM1ZmEzOGE3Y2FjYzg4OGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTVhN2IyYjFkYTA2YzgwNWZkYTg4OTg5YjU2NjRhYTY1NzUwMjVkMDkyYzQ4
|
14
|
+
YzczMGFjNDhmNjdmYWU0MTE2NTQ3NTFjOGVlM2ZkYmFjODlhZTcxZmI3OWY1
|
15
|
+
MTMyOGZhMDc1ZWQ0ZDg5OGVhNDg4ZWNjYjZjODBlMDVhYzgwZWU=
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Action Interceptor
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/action_interceptor)
|
3
4
|
[](https://travis-ci.org/openstax/action_interceptor)
|
4
|
-
|
5
5
|
[](https://codeclimate.com/github/openstax/action_interceptor)
|
6
6
|
|
7
7
|
Action Interceptor is a Rails engine that makes it easy to have controllers intercept
|
data/Rakefile
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module ActionInterceptor
|
2
2
|
module Common
|
3
3
|
|
4
|
-
protected
|
5
|
-
|
6
4
|
def url_for(options = {})
|
7
5
|
url = super
|
8
6
|
return url unless use_interceptor
|
@@ -17,6 +15,8 @@ module ActionInterceptor
|
|
17
15
|
uri.to_s
|
18
16
|
end
|
19
17
|
|
18
|
+
protected
|
19
|
+
|
20
20
|
# Executes the given block as if it was inside an interceptor
|
21
21
|
def with_interceptor(&block)
|
22
22
|
previous_use_interceptor = use_interceptor
|
@@ -13,9 +13,13 @@ module ActionInterceptor
|
|
13
13
|
|
14
14
|
def self.message_encryptor
|
15
15
|
return @message_encryptor if @message_encryptor
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
|
17
|
+
application = Rails.application
|
18
|
+
config = application.config
|
19
|
+
application_secret = application.secrets[:secret_key_base] \
|
20
|
+
if application.respond_to?(:secrets)
|
21
|
+
application_secret ||= config.secret_key_base if config.respond_to?(:secret_key_base)
|
22
|
+
application_secret ||= config.secret_token
|
19
23
|
|
20
24
|
# This is how Rails 4 generates keys for encrypted cookies
|
21
25
|
# Except that, in Rails 4, MessageEncryptor can take 2 different secrets,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_interceptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|