rack-cas 0.14.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: daf9d3dbf75e0d6a514a5385e4eac0d3d9c892b7
4
- data.tar.gz: 53e90cefe8b5aeaa46f417cb989fbc8a41452af4
3
+ metadata.gz: 331bdbb7c24a322d0dfe7c303a559a3e8ca1e90d
4
+ data.tar.gz: c297ba3e573f426ef8a7f4b115164e69ebc15424
5
5
  SHA512:
6
- metadata.gz: a8869d32aef929055c0ce13d90c064a794512f52aaae28512357c875e50940df1e94f9f7ae5f2e2289e306ca9ebc6ab56e0044ea6583b2e2cd0c68919609eeb6
7
- data.tar.gz: c73417fcef8ab4db3912b9fad3d9c090418c4ee47fffb5f3a88fa40e7615ab99e9aa704d49acfdc42c012872de97516965128f0c67eb09fe6b6bea5fc80ce328
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
@@ -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? ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
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|
@@ -1,3 +1,3 @@
1
1
  module RackCAS
2
- VERSION = '0.14.0'
2
+ VERSION = '0.15.0'
3
3
  end
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.14.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-06-10 00:00:00.000000000 Z
11
+ date: 2016-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack