cassette 1.1.3 → 1.1.4
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/README.md +6 -3
- data/lib/cassette/authentication/filter.rb +2 -2
- data/lib/cassette/rubycas/helper.rb +2 -2
- data/lib/cassette/version.rb +1 -1
- data/spec/support/controllers/controller_mock.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e63f18eabd5f87a8976aa3c8ae3e6d2aa1a32391
|
4
|
+
data.tar.gz: 5661be8783e0490ac42e48d5185cedc807cfffd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df0891132dfc91b40c9df0ef32bfe6392382cef824f96686c6c4e6577ead9f8371066e5c22b9383621e881bcfef92a5a1a5b07c5cb45d9e28a2d8277edb1a1a
|
7
|
+
data.tar.gz: 14ce3c294dece8fb5db1322b77421d173fb1e8548aaaaae952fe3807a8d8d40a937477ca190ca5c51bbf51cfe4a5703f11a36a7d8eb96802b20caf16475caf0a
|
data/README.md
CHANGED
@@ -56,7 +56,10 @@ class SomeController < ApplicationController
|
|
56
56
|
end
|
57
57
|
```
|
58
58
|
|
59
|
-
Where options are the same options you can pass to Rails' `
|
59
|
+
Where options are the same options you can pass to Rails' `skip_before_action` method.
|
60
|
+
|
61
|
+
You also can skip the whole CAS authentication using an environment variable `NOAUTH=true`. The method `current_user` will keep available. This is useful for development environments. **Be careful not to set and/or forget this variable in production environment**.
|
62
|
+
|
60
63
|
|
61
64
|
### Overriding the authenticated service
|
62
65
|
|
@@ -136,7 +139,7 @@ class SomeController < ApplicationController
|
|
136
139
|
|
137
140
|
# - Allow only employees:
|
138
141
|
#
|
139
|
-
#
|
142
|
+
# before_action :employee_only_filter
|
140
143
|
#
|
141
144
|
# rescue_from Cassette::Errors::NotAnEmployee do
|
142
145
|
# redirect_to '/403.html'
|
@@ -144,7 +147,7 @@ class SomeController < ApplicationController
|
|
144
147
|
|
145
148
|
# - Allow only customers:
|
146
149
|
#
|
147
|
-
#
|
150
|
+
# before_action :customer_only_filter
|
148
151
|
#
|
149
152
|
# rescue_from Cassette::Errors::NotACustomer do
|
150
153
|
# redirect_to '/403.html'
|
@@ -9,13 +9,13 @@ module Cassette
|
|
9
9
|
extend ActiveSupport::Concern
|
10
10
|
|
11
11
|
included do |controller|
|
12
|
-
controller.
|
12
|
+
controller.before_action(:validate_authentication_ticket)
|
13
13
|
controller.send(:attr_accessor, :current_user)
|
14
14
|
end
|
15
15
|
|
16
16
|
module ClassMethods
|
17
17
|
def skip_authentication(*options)
|
18
|
-
|
18
|
+
skip_before_action :validate_authentication_ticket, *options
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -9,13 +9,13 @@ module Cassette
|
|
9
9
|
include UserFactory
|
10
10
|
|
11
11
|
included do
|
12
|
-
|
12
|
+
before_action :validate_authentication_ticket
|
13
13
|
helper_method :current_user
|
14
14
|
end
|
15
15
|
|
16
16
|
module ClassMethods
|
17
17
|
def skip_authentication(*options)
|
18
|
-
|
18
|
+
skip_before_action :validate_authentication_ticket, *options
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
data/lib/cassette/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cassette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Hermida Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|