casino_core 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- wh�|�Pi��vDxM�,I����E�m��*N1� ��\;_JNw��D<^62~;��\�-� M(~������Hx"p5!��*ՏD�,2�G��Aw]k��'��z�7����k�p���L Bf����W���mWQJw喞�l �2w����?��4�9�FbbR>6�����8'��+��cߖ4���{ϽU����J��fP)�y� ��f�
1
+ ��#h��Xf ��]���*t�@޶�!�UL'���RE��(75�~�<���q���\>��{��eґ��kd ��_�����Wǡ��S�,oOAsb�7��������[r�V�� 81'2�Mk��������z�k�룴Z�݉id"Ք443CU|>�9Y9c��1���@�:W��tzA9I�9��n#2S��>t���MHTrS RW}�00�/�il`�x���{9E���8c ����2����
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- casino_core (1.4.0)
4
+ casino_core (1.4.2)
5
5
  activerecord (~> 3.2.9)
6
6
  addressable (~> 2.3)
7
7
  faraday (~> 0.8)
@@ -9,6 +9,8 @@ module CASinoCore
9
9
 
10
10
  class ServiceNotAllowedError < StandardError; end
11
11
 
12
+ RESERVED_CAS_PARAMETER_KEYS = ['service', 'ticket', 'gateway', 'renew']
13
+
12
14
  def acquire_service_ticket(ticket_granting_ticket, service, credentials_supplied = nil)
13
15
  service_url = clean_service_url(service)
14
16
  unless CASinoCore::Model::ServiceRule.allowed?(service_url)
@@ -27,7 +29,7 @@ module CASinoCore
27
29
  return dirty_service if dirty_service.blank?
28
30
  service_uri = Addressable::URI.parse dirty_service
29
31
  unless service_uri.query_values.nil?
30
- service_uri.query_values = service_uri.query_values.except('service', 'ticket', 'gateway', 'renew')
32
+ service_uri.query_values = service_uri.query_values(Array).select { |k,v| !RESERVED_CAS_PARAMETER_KEYS.include?(k) }
31
33
  end
32
34
  if service_uri.query_values.blank?
33
35
  service_uri.query_values = nil
@@ -25,7 +25,7 @@ class CASinoCore::Model::ServiceTicket < ActiveRecord::Base
25
25
 
26
26
  def service_with_ticket_url
27
27
  service_uri = Addressable::URI.parse(self.service)
28
- service_uri.query_values = (service_uri.query_values || {}).merge(ticket: self.ticket)
28
+ service_uri.query_values = (service_uri.query_values(Array) || []) << ['ticket', self.ticket]
29
29
  service_uri.to_s
30
30
  end
31
31
 
@@ -1,3 +1,3 @@
1
1
  module CASinoCore
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.2'
3
3
  end
@@ -99,6 +99,16 @@ describe CASinoCore::Processor::LoginCredentialRequestor do
99
99
  end
100
100
  end
101
101
 
102
+ context 'with a service with nested attributes' do
103
+ let(:service) { 'http://example.com/?a%5B%5D=test&a%5B%5D=example' }
104
+ let(:params) { { service: service } }
105
+
106
+ it 'does not remove the attributes' do
107
+ listener.should_receive(:user_logged_in).with(/\?a%5B%5D=test&a%5B%5D=example&ticket=ST\-[^&]+$/)
108
+ processor.process(params, cookies, user_agent)
109
+ end
110
+ end
111
+
102
112
  context 'without a service' do
103
113
  it 'calls the #user_logged_in method on the listener' do
104
114
  listener.should_receive(:user_logged_in).with(nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casino_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  b1VSdnUwRzgvWXlIVUFtSVUvV0tyanIxYmdjZjFWUnYKUjRLRDFNblVWL3Y1
37
37
  MDJwaU1sWG1qeE9XZGJLOHl2UUVIa3N1L3pqYkNqU3UrTTJrd0ZtV0dzeDVu
38
38
  eCtWZHc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2013-03-26 00:00:00.000000000 Z
39
+ date: 2013-03-29 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
@@ -447,15 +447,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
447
447
  - - ! '>='
448
448
  - !ruby/object:Gem::Version
449
449
  version: '0'
450
+ segments:
451
+ - 0
452
+ hash: -1266012444534367385
450
453
  required_rubygems_version: !ruby/object:Gem::Requirement
451
454
  none: false
452
455
  requirements:
453
456
  - - ! '>='
454
457
  - !ruby/object:Gem::Version
455
458
  version: '0'
459
+ segments:
460
+ - 0
461
+ hash: -1266012444534367385
456
462
  requirements: []
457
463
  rubyforge_project:
458
- rubygems_version: 1.8.24
464
+ rubygems_version: 1.8.25
459
465
  signing_key:
460
466
  specification_version: 3
461
467
  summary: A CAS server core library.
metadata.gz.sig CHANGED
Binary file