casino 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/.travis.yml CHANGED
@@ -1,3 +1,6 @@
1
1
  language: ruby
2
2
  before_script:
3
3
  - "cd spec/dummy && RAILS_ENV=test rake casino_core:db:schema:load && cd ../.."
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- casino (1.2.1)
4
+ casino (1.2.2)
5
5
  casino_core (~> 1.3.2)
6
6
  http_accept_language (~> 2.0.0.pre)
7
7
  jquery-rails (~> 2.1)
@@ -37,23 +37,23 @@ GEM
37
37
  activesupport (3.2.12)
38
38
  i18n (~> 0.6)
39
39
  multi_json (~> 1.0)
40
- addressable (2.3.2)
40
+ addressable (2.3.3)
41
41
  arel (3.0.2)
42
42
  builder (3.0.4)
43
- casino_core (1.3.2)
43
+ casino_core (1.3.5)
44
44
  activerecord (~> 3.2.9)
45
45
  addressable (~> 2.3)
46
46
  faraday (~> 0.8)
47
47
  rotp (~> 1.4)
48
48
  terminal-table (~> 1.4)
49
49
  useragent (~> 0.4)
50
- diff-lcs (1.1.3)
50
+ diff-lcs (1.2.1)
51
51
  erubis (2.7.0)
52
- faraday (0.8.5)
52
+ faraday (0.8.6)
53
53
  multipart-post (~> 1.1)
54
54
  hike (1.2.1)
55
55
  http_accept_language (2.0.0.pre)
56
- i18n (0.6.1)
56
+ i18n (0.6.4)
57
57
  journey (1.0.4)
58
58
  jquery-rails (2.2.1)
59
59
  railties (>= 3.0, < 5.0)
@@ -64,8 +64,8 @@ GEM
64
64
  mime-types (~> 1.16)
65
65
  treetop (~> 1.4.8)
66
66
  mime-types (1.21)
67
- multi_json (1.6.1)
68
- multipart-post (1.1.5)
67
+ multi_json (1.7.1)
68
+ multipart-post (1.2.0)
69
69
  polyglot (0.3.3)
70
70
  rack (1.4.5)
71
71
  rack-cache (1.2)
@@ -90,24 +90,24 @@ GEM
90
90
  rdoc (~> 3.4)
91
91
  thor (>= 0.14.6, < 2.0)
92
92
  rake (10.0.3)
93
- rdoc (3.12.1)
93
+ rdoc (3.12.2)
94
94
  json (~> 1.4)
95
95
  rotp (1.4.1)
96
- rspec (2.12.0)
97
- rspec-core (~> 2.12.0)
98
- rspec-expectations (~> 2.12.0)
99
- rspec-mocks (~> 2.12.0)
100
- rspec-core (2.12.2)
101
- rspec-expectations (2.12.1)
102
- diff-lcs (~> 1.1.3)
103
- rspec-mocks (2.12.2)
104
- rspec-rails (2.12.2)
96
+ rspec (2.13.0)
97
+ rspec-core (~> 2.13.0)
98
+ rspec-expectations (~> 2.13.0)
99
+ rspec-mocks (~> 2.13.0)
100
+ rspec-core (2.13.0)
101
+ rspec-expectations (2.13.0)
102
+ diff-lcs (>= 1.1.3, < 2.0)
103
+ rspec-mocks (2.13.0)
104
+ rspec-rails (2.13.0)
105
105
  actionpack (>= 3.0)
106
106
  activesupport (>= 3.0)
107
107
  railties (>= 3.0)
108
- rspec-core (~> 2.12.0)
109
- rspec-expectations (~> 2.12.0)
110
- rspec-mocks (~> 2.12.0)
108
+ rspec-core (~> 2.13.0)
109
+ rspec-expectations (~> 2.13.0)
110
+ rspec-mocks (~> 2.13.0)
111
111
  simplecov (0.7.1)
112
112
  multi_json (~> 1.0)
113
113
  simplecov-html (~> 0.7.1)
@@ -120,11 +120,11 @@ GEM
120
120
  sqlite3 (1.3.7)
121
121
  terminal-table (1.4.5)
122
122
  thor (0.17.0)
123
- tilt (1.3.3)
123
+ tilt (1.3.4)
124
124
  treetop (1.4.12)
125
125
  polyglot
126
126
  polyglot (>= 0.3.1)
127
- tzinfo (0.3.35)
127
+ tzinfo (0.3.37)
128
128
  useragent (0.4.16)
129
129
 
130
130
  PLATFORMS
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CASino [![Build Status](https://secure.travis-ci.org/rbCAS/CASino.png?branch=master)](https://travis-ci.org/rbCAS/CASino)
2
2
 
3
- A simple [CAS](http://www.jasig.org/cas) server written in Ruby using the Rails framework.
3
+ CASino Rails Engine (used in CASinoApp).
4
4
 
5
5
  It currently supports [CAS 1.0 and CAS 2.0](http://www.jasig.org/cas/protocol) as well as [CAS 3.1 Single Sign Out](https://wiki.jasig.org/display/CASUM/Single+Sign+Out) and [CAS RESTful API](https://wiki.jasig.org/display/CASUM/RESTful+API).
6
6
 
@@ -18,6 +18,10 @@ class CASino::SessionsController < CASino::ApplicationController
18
18
  processor(:SessionDestroyer).process(params, cookies, request.user_agent)
19
19
  end
20
20
 
21
+ def destroy_others
22
+ processor(:OtherSessionsDestroyer).process(params, cookies, request.user_agent)
23
+ end
24
+
21
25
  def logout
22
26
  processor(:Logout).process(params, cookies, request.user_agent)
23
27
  end
@@ -1,4 +1,14 @@
1
- <h1>Service not allowed</h1>
2
- <p>
3
- This SSO server is not configured to allow logins to "<%= @service %>". If you think this is an error, please contact your administrator.
4
- </p>
1
+ <div class="container">
2
+ <div class="logout box">
3
+
4
+ <div class="info">
5
+ <h1><%= t 'service_not_allowed.title' %></h1>
6
+ <p>
7
+ <%= t 'service_not_allowed.message', :service => @service %>
8
+ </p>
9
+ </div>
10
+ <div class="logo">
11
+ <%= image_tag "logo.png" %>
12
+ </div>
13
+ </div>
14
+ </div>
@@ -11,7 +11,7 @@
11
11
  <%= t('two_factor_authenticators.instructions') %>
12
12
  </p>
13
13
  <div id="qr-code">
14
- <img src="http://chart.apis.google.com/chart?cht=qr&chs=250x250&chl=<%= u "otpauth://totp/#{u CASinoCore::Settings.frontend[:sso_name] + ': ' + @two_factor_authenticator.user.username}?secret=#{@two_factor_authenticator.secret}" %>" height="250" width="250"><br />
14
+ <img src="https://chart.googleapis.com/chart?cht=qr&chs=250x250&chl=<%= u "otpauth://totp/#{u CASinoCore::Settings.frontend[:sso_name] + ': ' + @two_factor_authenticator.user.username}?secret=#{@two_factor_authenticator.secret}" %>" height="250" width="250"><br />
15
15
  </div>
16
16
  <p>
17
17
  <%= t('two_factor_authenticators.secret') %>: <%= @two_factor_authenticator.secret %>
data/casino.gemspec CHANGED
@@ -17,8 +17,11 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ['lib']
19
19
 
20
- s.signing_key = File.expand_path '~/.gem/casino-private_key.pem'
21
- s.cert_chain = ['casino-public_cert.pem']
20
+ sign_file = File.expand_path '~/.gem/casino-private_key.pem'
21
+ if File.exist?(sign_file)
22
+ s.signing_key = sign_file
23
+ s.cert_chain = ['casino-public_cert.pem']
24
+ end
22
25
 
23
26
  s.add_development_dependency 'rake', '~> 10.0'
24
27
  s.add_development_dependency 'rspec', '~> 2.12'
@@ -6,6 +6,9 @@ de:
6
6
  label_username: "Benutzername"
7
7
  label_password: "Passwort"
8
8
  label_button: "Login"
9
+ service_not_allowed:
10
+ title: "Service nicht erlaubt"
11
+ message: "Dieser SSO-Server ist nicht konfiguriert, um Logins für \"%{service}\" zu erlauben. Wenn Sie denken, es handle sich hierbei um einen Fehler, kontaktieren Sie bitte Ihren Administrator."
9
12
  validate_otp:
10
13
  title: "Zwei-Faktor-Authentifizierung"
11
14
  description: "Bitte geben Sie ein gültiges Einmalkennwort an."
@@ -6,6 +6,9 @@ en:
6
6
  label_username: "Username"
7
7
  label_password: "Password"
8
8
  label_button: "Login"
9
+ service_not_allowed:
10
+ title: "Service not allowed"
11
+ message: "This SSO server is not configured to allow logins to \"%{service}\". If you think this is an error, please contact your administrator."
9
12
  validate_otp:
10
13
  title: "Two-factor authentication"
11
14
  description: "Please enter a valid one-time password."
data/config/routes.rb CHANGED
@@ -7,6 +7,8 @@ CASino::Engine.routes.draw do
7
7
  get 'logout' => 'sessions#logout'
8
8
  post 'validate_otp' => 'sessions#validate_otp'
9
9
 
10
+ get 'destroy-other-sessions' => 'sessions#destroy_others'
11
+
10
12
  get 'validate' => 'service_tickets#validate'
11
13
  get 'serviceValidate' => 'service_tickets#service_validate'
12
14
 
@@ -8,6 +8,7 @@ module CASino
8
8
  autoload :LoginCredentialAcceptor, 'casino/listener/login_credential_acceptor.rb'
9
9
  autoload :LoginCredentialRequestor, 'casino/listener/login_credential_requestor.rb'
10
10
  autoload :Logout, 'casino/listener/logout.rb'
11
+ autoload :OtherSessionsDestroyer, 'casino/listener/other_sessions_destroyer.rb'
11
12
  autoload :ProxyTicketProvider, 'casino/listener/proxy_ticket_provider.rb'
12
13
  autoload :SecondFactorAuthenticationAcceptor, 'casino/listener/second_factor_authentication_acceptor.rb'
13
14
  autoload :SessionDestroyer, 'casino/listener/session_destroyer.rb'
@@ -0,0 +1,7 @@
1
+ require 'casino/listener'
2
+
3
+ class CASino::Listener::OtherSessionsDestroyer < CASino::Listener
4
+ def other_sessions_destroyed(url)
5
+ @controller.redirect_to(url || sessions_path)
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module CASino
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::Listener::OtherSessionsDestroyer do
4
+ include CASino::Engine.routes.url_helpers
5
+ let(:controller) { Struct.new(:cookies).new(cookies: {}) }
6
+ let(:listener) { described_class.new(controller) }
7
+
8
+ before(:each) do
9
+ controller.stub(:redirect_to)
10
+ end
11
+
12
+ describe '#other_sessions_destroyed' do
13
+ let(:service) { 'http://www.example.com/' }
14
+ it 'redirects back to the URL' do
15
+ controller.should_receive(:redirect_to).with(service)
16
+ listener.other_sessions_destroyed(service)
17
+ end
18
+ end
19
+ end
@@ -59,4 +59,13 @@ describe CASino::SessionsController do
59
59
  delete :destroy, id: id
60
60
  end
61
61
  end
62
+
63
+ describe 'GET "destroy_others"' do
64
+ it 'calls the process method of the OtherSessionsDestroyer' do
65
+ CASinoCore::Processor::OtherSessionsDestroyer.any_instance.should_receive(:process) do
66
+ @controller.render nothing: true
67
+ end
68
+ get :destroy_others
69
+ end
70
+ end
62
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casino
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -38,7 +38,7 @@ cert_chain:
38
38
  b1VSdnUwRzgvWXlIVUFtSVUvV0tyanIxYmdjZjFWUnYKUjRLRDFNblVWL3Y1
39
39
  MDJwaU1sWG1qeE9XZGJLOHl2UUVIa3N1L3pqYkNqU3UrTTJrd0ZtV0dzeDVu
40
40
  eCtWZHc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
41
- date: 2013-02-17 00:00:00.000000000 Z
41
+ date: 2013-03-19 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
@@ -250,6 +250,7 @@ files:
250
250
  - lib/casino/listener/login_credential_acceptor.rb
251
251
  - lib/casino/listener/login_credential_requestor.rb
252
252
  - lib/casino/listener/logout.rb
253
+ - lib/casino/listener/other_sessions_destroyer.rb
253
254
  - lib/casino/listener/proxy_ticket_provider.rb
254
255
  - lib/casino/listener/second_factor_authentication_acceptor.rb
255
256
  - lib/casino/listener/session_destroyer.rb
@@ -280,6 +281,7 @@ files:
280
281
  - spec/controllers/listener/login_credential_acceptor_spec.rb
281
282
  - spec/controllers/listener/login_credential_requestor_spec.rb
282
283
  - spec/controllers/listener/logout_spec.rb
284
+ - spec/controllers/listener/other_sessions_destroyer_spec.rb
283
285
  - spec/controllers/listener/proxy_ticket_provider_spec.rb
284
286
  - spec/controllers/listener/second_factor_authentication_acceptor_spec.rb
285
287
  - spec/controllers/listener/session_destroyer_spec.rb
@@ -345,18 +347,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
345
347
  - - ! '>='
346
348
  - !ruby/object:Gem::Version
347
349
  version: '0'
348
- segments:
349
- - 0
350
- hash: 1146680884824081593
351
350
  required_rubygems_version: !ruby/object:Gem::Requirement
352
351
  none: false
353
352
  requirements:
354
353
  - - ! '>='
355
354
  - !ruby/object:Gem::Version
356
355
  version: '0'
357
- segments:
358
- - 0
359
- hash: 1146680884824081593
360
356
  requirements: []
361
357
  rubyforge_project:
362
358
  rubygems_version: 1.8.24
@@ -369,6 +365,7 @@ test_files:
369
365
  - spec/controllers/listener/login_credential_acceptor_spec.rb
370
366
  - spec/controllers/listener/login_credential_requestor_spec.rb
371
367
  - spec/controllers/listener/logout_spec.rb
368
+ - spec/controllers/listener/other_sessions_destroyer_spec.rb
372
369
  - spec/controllers/listener/proxy_ticket_provider_spec.rb
373
370
  - spec/controllers/listener/second_factor_authentication_acceptor_spec.rb
374
371
  - spec/controllers/listener/session_destroyer_spec.rb
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- .=�dV��X*�R���hé}ി���eDn�lA=D��m�%Z�4��H@ ��<fqq�p�>��8���8xu� ��*�>J��|<u@#�}�@�5{<� ݇f9��O��,�����|�'jW�S:f�s[�&�PZ.�������Į��iV㠙
2
- ���W疏� ���|����;$XU~�:C��j'Am2Qp����\v;�Ӵ}[
1
+ �ߐ9��� �<j�p
2
+ GP�����5R>��
3
+ �Kst���S���A\�8aH���0����WP�F�MK�_�5�Kv�%�ߛy8��K�D ��c�}