rack-cas 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/rack-cas/configuration.rb +2 -1
- data/lib/rack-cas/server.rb +10 -2
- data/lib/rack-cas/service_validation_response.rb +1 -1
- data/lib/rack-cas/version.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: 331bdbb7c24a322d0dfe7c303a559a3e8ca1e90d
|
4
|
+
data.tar.gz: c297ba3e573f426ef8a7f4b115164e69ebc15424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 693e08e44143824390e2c1f432db5f93677fbf89f2c0b8f14ad0cb958ef20d96b94255726a34d67e906685caa21a9717c25de0b493d4745570eabd42cf6e03e4
|
7
|
+
data.tar.gz: 05006fc0e6cbf026c7249fdac340144e0857c6d7b4a6945be635ff708237ed366ca8f5e8681eb77f7345a5d5265826447024ec8f7dee6f67907f3dd2c652add3
|
data/README.md
CHANGED
@@ -36,6 +36,14 @@ config.rack_cas.server_url = 'https://cas.example.com/'
|
|
36
36
|
```
|
37
37
|
If the the server URL depends on your environment, you can define it in the according file: `config/environments/<env>.rb`
|
38
38
|
|
39
|
+
### Protocol
|
40
|
+
|
41
|
+
Since protocol `p3` the protocol is prepended in certain urls. If you wish to use protocol `p3` set the following config variable
|
42
|
+
|
43
|
+
`config.rack_cas.protocol = 'p3'`
|
44
|
+
|
45
|
+
[For more info](http://jasig.github.io/cas/4.1.x/protocol/CAS-Protocol-Specification.html#cas-uris)
|
46
|
+
|
39
47
|
### Single Logout ###
|
40
48
|
|
41
49
|
If you wish to enable [single logout](http://apereo.github.io/cas/4.0.x/installation/Logout-Single-Signout.html) you'll need to modify your configuration as below.
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module RackCAS
|
2
2
|
class Configuration
|
3
3
|
SETTINGS = [:fake, :server_url, :session_store, :exclude_path, :exclude_paths, :extra_attributes_filter,
|
4
|
-
:verify_ssl_cert, :renew, :use_saml_validation, :ignore_intercept_validator, :exclude_request_validator]
|
4
|
+
:verify_ssl_cert, :renew, :use_saml_validation, :ignore_intercept_validator, :exclude_request_validator, :protocol]
|
5
|
+
|
5
6
|
|
6
7
|
SETTINGS.each do |setting|
|
7
8
|
attr_accessor setting
|
data/lib/rack-cas/server.rb
CHANGED
@@ -36,12 +36,20 @@ module RackCAS
|
|
36
36
|
|
37
37
|
def saml_validate_url(service_url)
|
38
38
|
service_url = URL.parse(service_url).remove_param('ticket').to_s
|
39
|
-
@url.dup.append_path('samlValidate').add_params(TARGET: service_url)
|
39
|
+
@url.dup.append_path(path_for_protocol('samlValidate')).add_params(TARGET: service_url)
|
40
40
|
end
|
41
41
|
|
42
42
|
def validate_service_url(service_url, ticket)
|
43
43
|
service_url = URL.parse(service_url).remove_param('ticket').to_s
|
44
|
-
@url.dup.append_path('serviceValidate').add_params(service: service_url, ticket: ticket)
|
44
|
+
@url.dup.append_path(path_for_protocol('serviceValidate')).add_params(service: service_url, ticket: ticket)
|
45
|
+
end
|
46
|
+
|
47
|
+
def path_for_protocol(path)
|
48
|
+
if RackCAS.config.protocol && RackCAS.config.protocol == "p3"
|
49
|
+
"p3/#{path}"
|
50
|
+
else
|
51
|
+
path
|
52
|
+
end
|
45
53
|
end
|
46
54
|
end
|
47
55
|
end
|
@@ -81,7 +81,7 @@ module RackCAS
|
|
81
81
|
http = Net::HTTP.new(@url.host, @url.inferred_port)
|
82
82
|
if @url.scheme == 'https'
|
83
83
|
http.use_ssl = true
|
84
|
-
http.verify_mode = RackCAS.config.verify_ssl_cert
|
84
|
+
http.verify_mode = RackCAS.config.verify_ssl_cert ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
85
85
|
end
|
86
86
|
|
87
87
|
http.start do |conn|
|
data/lib/rack-cas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-cas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|