casino 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/Gemfile.lock +36 -36
- data/app/assets/stylesheets/casino.scss +2 -2
- data/app/views/casino/sessions/new.html.erb +3 -0
- data/casino.gemspec +1 -1
- data/config/locales/de.yml +2 -1
- data/config/locales/en.yml +1 -0
- data/lib/casino/listener/login_credential_acceptor.rb +2 -2
- data/lib/casino/listener/logout.rb +6 -2
- data/lib/casino/version.rb +1 -1
- data/spec/controllers/listener/login_credential_acceptor_spec.rb +11 -1
- data/spec/controllers/listener/logout_spec.rb +17 -0
- metadata +11 -8
- metadata.gz.sig +2 -3
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/login_tickets.rake +0 -7
- data/lib/tasks/service_tickets.rake +0 -9
data.tar.gz.sig
CHANGED
Binary file
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
casino (1.
|
5
|
-
casino_core (~> 1.
|
4
|
+
casino (1.3.0)
|
5
|
+
casino_core (~> 1.4.0)
|
6
6
|
http_accept_language (~> 2.0.0.pre)
|
7
7
|
jquery-rails (~> 2.1)
|
8
8
|
rails (~> 3.2.9)
|
@@ -10,12 +10,12 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionmailer (3.2.
|
14
|
-
actionpack (= 3.2.
|
15
|
-
mail (~> 2.
|
16
|
-
actionpack (3.2.
|
17
|
-
activemodel (= 3.2.
|
18
|
-
activesupport (= 3.2.
|
13
|
+
actionmailer (3.2.13)
|
14
|
+
actionpack (= 3.2.13)
|
15
|
+
mail (~> 2.5.3)
|
16
|
+
actionpack (3.2.13)
|
17
|
+
activemodel (= 3.2.13)
|
18
|
+
activesupport (= 3.2.13)
|
19
19
|
builder (~> 3.0.0)
|
20
20
|
erubis (~> 2.7.0)
|
21
21
|
journey (~> 1.0.4)
|
@@ -23,24 +23,24 @@ GEM
|
|
23
23
|
rack-cache (~> 1.2)
|
24
24
|
rack-test (~> 0.6.1)
|
25
25
|
sprockets (~> 2.2.1)
|
26
|
-
activemodel (3.2.
|
27
|
-
activesupport (= 3.2.
|
26
|
+
activemodel (3.2.13)
|
27
|
+
activesupport (= 3.2.13)
|
28
28
|
builder (~> 3.0.0)
|
29
|
-
activerecord (3.2.
|
30
|
-
activemodel (= 3.2.
|
31
|
-
activesupport (= 3.2.
|
29
|
+
activerecord (3.2.13)
|
30
|
+
activemodel (= 3.2.13)
|
31
|
+
activesupport (= 3.2.13)
|
32
32
|
arel (~> 3.0.2)
|
33
33
|
tzinfo (~> 0.3.29)
|
34
|
-
activeresource (3.2.
|
35
|
-
activemodel (= 3.2.
|
36
|
-
activesupport (= 3.2.
|
37
|
-
activesupport (3.2.
|
38
|
-
i18n (
|
34
|
+
activeresource (3.2.13)
|
35
|
+
activemodel (= 3.2.13)
|
36
|
+
activesupport (= 3.2.13)
|
37
|
+
activesupport (3.2.13)
|
38
|
+
i18n (= 0.6.1)
|
39
39
|
multi_json (~> 1.0)
|
40
40
|
addressable (2.3.3)
|
41
41
|
arel (3.0.2)
|
42
42
|
builder (3.0.4)
|
43
|
-
casino_core (1.
|
43
|
+
casino_core (1.4.0)
|
44
44
|
activerecord (~> 3.2.9)
|
45
45
|
addressable (~> 2.3)
|
46
46
|
faraday (~> 0.8)
|
@@ -49,22 +49,22 @@ GEM
|
|
49
49
|
useragent (~> 0.4)
|
50
50
|
diff-lcs (1.2.1)
|
51
51
|
erubis (2.7.0)
|
52
|
-
faraday (0.8.
|
52
|
+
faraday (0.8.7)
|
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.
|
56
|
+
i18n (0.6.1)
|
57
57
|
journey (1.0.4)
|
58
58
|
jquery-rails (2.2.1)
|
59
59
|
railties (>= 3.0, < 5.0)
|
60
60
|
thor (>= 0.14, < 2.0)
|
61
61
|
json (1.7.7)
|
62
|
-
mail (2.
|
62
|
+
mail (2.5.3)
|
63
63
|
i18n (>= 0.4.0)
|
64
64
|
mime-types (~> 1.16)
|
65
65
|
treetop (~> 1.4.8)
|
66
66
|
mime-types (1.21)
|
67
|
-
multi_json (1.7.
|
67
|
+
multi_json (1.7.2)
|
68
68
|
multipart-post (1.2.0)
|
69
69
|
polyglot (0.3.3)
|
70
70
|
rack (1.4.5)
|
@@ -74,17 +74,17 @@ GEM
|
|
74
74
|
rack
|
75
75
|
rack-test (0.6.2)
|
76
76
|
rack (>= 1.0)
|
77
|
-
rails (3.2.
|
78
|
-
actionmailer (= 3.2.
|
79
|
-
actionpack (= 3.2.
|
80
|
-
activerecord (= 3.2.
|
81
|
-
activeresource (= 3.2.
|
82
|
-
activesupport (= 3.2.
|
77
|
+
rails (3.2.13)
|
78
|
+
actionmailer (= 3.2.13)
|
79
|
+
actionpack (= 3.2.13)
|
80
|
+
activerecord (= 3.2.13)
|
81
|
+
activeresource (= 3.2.13)
|
82
|
+
activesupport (= 3.2.13)
|
83
83
|
bundler (~> 1.0)
|
84
|
-
railties (= 3.2.
|
85
|
-
railties (3.2.
|
86
|
-
actionpack (= 3.2.
|
87
|
-
activesupport (= 3.2.
|
84
|
+
railties (= 3.2.13)
|
85
|
+
railties (3.2.13)
|
86
|
+
actionpack (= 3.2.13)
|
87
|
+
activesupport (= 3.2.13)
|
88
88
|
rack-ssl (~> 1.3.2)
|
89
89
|
rake (>= 0.8.7)
|
90
90
|
rdoc (~> 3.4)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
rspec-core (~> 2.13.0)
|
98
98
|
rspec-expectations (~> 2.13.0)
|
99
99
|
rspec-mocks (~> 2.13.0)
|
100
|
-
rspec-core (2.13.
|
100
|
+
rspec-core (2.13.1)
|
101
101
|
rspec-expectations (2.13.0)
|
102
102
|
diff-lcs (>= 1.1.3, < 2.0)
|
103
103
|
rspec-mocks (2.13.0)
|
@@ -120,12 +120,12 @@ GEM
|
|
120
120
|
sqlite3 (1.3.7)
|
121
121
|
terminal-table (1.4.5)
|
122
122
|
thor (0.17.0)
|
123
|
-
tilt (1.3.
|
123
|
+
tilt (1.3.6)
|
124
124
|
treetop (1.4.12)
|
125
125
|
polyglot
|
126
126
|
polyglot (>= 0.3.1)
|
127
127
|
tzinfo (0.3.37)
|
128
|
-
useragent (0.
|
128
|
+
useragent (0.5.0)
|
129
129
|
|
130
130
|
PLATFORMS
|
131
131
|
ruby
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@import url(
|
1
|
+
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,600);
|
2
2
|
@import "casino/normalize";
|
3
3
|
|
4
4
|
/// DEFAULT SETTINGS ///
|
@@ -208,7 +208,7 @@ table {
|
|
208
208
|
/// LOGIN ///
|
209
209
|
.login {
|
210
210
|
> div {
|
211
|
-
height:
|
211
|
+
height: 275px;
|
212
212
|
}
|
213
213
|
|
214
214
|
.logo {
|
@@ -13,6 +13,9 @@
|
|
13
13
|
<%= text_field_tag :username, params[:username] %>
|
14
14
|
<%= label_tag :password, t('login.label_password') %>
|
15
15
|
<%= password_field_tag :password %>
|
16
|
+
<%= label_tag :rememberMe do %>
|
17
|
+
<%= check_box_tag :rememberMe, 1, params[:rememberMe] %> <%= t('login.label_remember_me') %>
|
18
|
+
<% end %>
|
16
19
|
<%= button_tag t('login.label_button'), :class => 'button' %>
|
17
20
|
<% end %>
|
18
21
|
</div>
|
data/casino.gemspec
CHANGED
@@ -32,5 +32,5 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_runtime_dependency 'rails', '~> 3.2.9'
|
33
33
|
s.add_runtime_dependency 'jquery-rails', '~> 2.1'
|
34
34
|
s.add_runtime_dependency 'http_accept_language', '~> 2.0.0.pre'
|
35
|
-
s.add_runtime_dependency 'casino_core', '~> 1.
|
35
|
+
s.add_runtime_dependency 'casino_core', '~> 1.4.0'
|
36
36
|
end
|
data/config/locales/de.yml
CHANGED
@@ -6,6 +6,7 @@ de:
|
|
6
6
|
label_username: "Benutzername"
|
7
7
|
label_password: "Passwort"
|
8
8
|
label_button: "Login"
|
9
|
+
label_remember_me: "Eingeloggt bleiben"
|
9
10
|
service_not_allowed:
|
10
11
|
title: "Service nicht erlaubt"
|
11
12
|
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."
|
@@ -14,7 +15,7 @@ de:
|
|
14
15
|
description: "Bitte geben Sie ein gültiges Einmalkennwort an."
|
15
16
|
code: "Code"
|
16
17
|
submit: "Fortfahren"
|
17
|
-
invalid_otp: "Das eingegebene Einmalkennwort ist
|
18
|
+
invalid_otp: "Das eingegebene Einmalkennwort ist ungültig."
|
18
19
|
logout:
|
19
20
|
title: "Auf Wiedersehen."
|
20
21
|
logged_out_without_url: "Sie haben sich erfolgreich ausgeloggt."
|
data/config/locales/en.yml
CHANGED
@@ -6,6 +6,7 @@ en:
|
|
6
6
|
label_username: "Username"
|
7
7
|
label_password: "Password"
|
8
8
|
label_button: "Login"
|
9
|
+
label_remember_me: "Stay logged in"
|
9
10
|
service_not_allowed:
|
10
11
|
title: "Service not allowed"
|
11
12
|
message: "This SSO server is not configured to allow logins to \"%{service}\". If you think this is an error, please contact your administrator."
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'casino/listener'
|
2
2
|
|
3
3
|
class CASino::Listener::LoginCredentialAcceptor < CASino::Listener
|
4
|
-
def user_logged_in(url, ticket_granting_ticket)
|
5
|
-
@controller.cookies[:tgt] = ticket_granting_ticket
|
4
|
+
def user_logged_in(url, ticket_granting_ticket, cookie_expiry_time = nil)
|
5
|
+
@controller.cookies[:tgt] = { value: ticket_granting_ticket, expires: cookie_expiry_time }
|
6
6
|
if url.nil?
|
7
7
|
@controller.redirect_to sessions_path, status: :see_other
|
8
8
|
else
|
@@ -1,8 +1,12 @@
|
|
1
1
|
require 'casino/listener'
|
2
2
|
|
3
3
|
class CASino::Listener::Logout < CASino::Listener
|
4
|
-
def user_logged_out(url)
|
5
|
-
|
4
|
+
def user_logged_out(url, redirect_immediately = false)
|
5
|
+
if redirect_immediately
|
6
|
+
@controller.redirect_to url, status: :see_other
|
7
|
+
else
|
8
|
+
assign(:url, url)
|
9
|
+
end
|
6
10
|
@controller.cookies.delete :tgt
|
7
11
|
end
|
8
12
|
end
|
data/lib/casino/version.rb
CHANGED
@@ -28,7 +28,17 @@ describe CASino::Listener::LoginCredentialAcceptor do
|
|
28
28
|
|
29
29
|
it 'creates the tgt cookie' do
|
30
30
|
listener.user_logged_in(url, ticket_granting_ticket)
|
31
|
-
controller.cookies[:tgt].should == ticket_granting_ticket
|
31
|
+
controller.cookies[:tgt][:value].should == ticket_granting_ticket
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with cookie expiry time' do
|
36
|
+
let(:url) { Object.new }
|
37
|
+
let(:expiry_time) { Time.now }
|
38
|
+
it 'set the tgt cookie expiry time' do
|
39
|
+
listener.user_logged_in(url, ticket_granting_ticket, expiry_time)
|
40
|
+
controller.cookies[:tgt][:value].should == ticket_granting_ticket
|
41
|
+
controller.cookies[:tgt][:expires].should == expiry_time
|
32
42
|
end
|
33
43
|
end
|
34
44
|
end
|
@@ -17,5 +17,22 @@ describe CASino::Listener::Logout do
|
|
17
17
|
listener.user_logged_out(url)
|
18
18
|
controller.cookies[:tgt].should be_nil
|
19
19
|
end
|
20
|
+
|
21
|
+
context 'with redirect_immediately flag' do
|
22
|
+
before(:each) do
|
23
|
+
controller.stub(:redirect_to)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'tells the controller to redirect the client' do
|
27
|
+
controller.should_receive(:redirect_to).with(url, status: :see_other)
|
28
|
+
listener.user_logged_out(url, true)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'deletes an existing ticket-granting ticket cookie' do
|
32
|
+
controller.cookies = { tgt: 'TGT-12345' }
|
33
|
+
listener.user_logged_out(url, true)
|
34
|
+
controller.cookies[:tgt].should be_nil
|
35
|
+
end
|
36
|
+
end
|
20
37
|
end
|
21
38
|
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.
|
4
|
+
version: 1.3.0
|
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-03-
|
41
|
+
date: 2013-03-24 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rake
|
@@ -175,7 +175,7 @@ dependencies:
|
|
175
175
|
requirements:
|
176
176
|
- - ~>
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version: 1.
|
178
|
+
version: 1.4.0
|
179
179
|
type: :runtime
|
180
180
|
prerelease: false
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -183,7 +183,7 @@ dependencies:
|
|
183
183
|
requirements:
|
184
184
|
- - ~>
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: 1.
|
186
|
+
version: 1.4.0
|
187
187
|
description: CASino is a simple CAS (Central Authentication Service) server using
|
188
188
|
CASinoCore as its backend.
|
189
189
|
email:
|
@@ -267,9 +267,6 @@ files:
|
|
267
267
|
- lib/generators/casino/templates/casino_and_overrides.scss
|
268
268
|
- lib/generators/casino/templates/casino_core.rb
|
269
269
|
- lib/generators/casino/templates/database.yml
|
270
|
-
- lib/tasks/.gitkeep
|
271
|
-
- lib/tasks/login_tickets.rake
|
272
|
-
- lib/tasks/service_tickets.rake
|
273
270
|
- public/404.html
|
274
271
|
- public/422.html
|
275
272
|
- public/500.html
|
@@ -347,15 +344,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
347
344
|
- - ! '>='
|
348
345
|
- !ruby/object:Gem::Version
|
349
346
|
version: '0'
|
347
|
+
segments:
|
348
|
+
- 0
|
349
|
+
hash: 2368767182679843920
|
350
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
351
351
|
none: false
|
352
352
|
requirements:
|
353
353
|
- - ! '>='
|
354
354
|
- !ruby/object:Gem::Version
|
355
355
|
version: '0'
|
356
|
+
segments:
|
357
|
+
- 0
|
358
|
+
hash: 2368767182679843920
|
356
359
|
requirements: []
|
357
360
|
rubyforge_project:
|
358
|
-
rubygems_version: 1.8.
|
361
|
+
rubygems_version: 1.8.25
|
359
362
|
signing_key:
|
360
363
|
specification_version: 3
|
361
364
|
summary: A simple CAS server written in Ruby using the Rails framework.
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
�
|
3
|
-
�Kst���S���A\�8aH���0����WP�F�MK�_�5�Kv�%�ߛy8��K�D ��c�}
|
1
|
+
��1�z3�Y�;9D�1#�2ڀ�ԇ$�lLٲ|5� ������DAM�~�U����B/I�n��-=�Sd'�m��n\����Xw�ssʩ�9�Ԯ1�#*�Y�S�4��/��@+�� c$�Aˊ�'�)��.n��;�����+̾S.@���M
|
2
|
+
MR�=�i_/H��s�|qڄ ʜb?n�30�w;�H1��9�<�����(��@I�f�x�C�=��^ I�沏�㐡Ǖ���K�YY���"�yড�Y
|
data/lib/tasks/.gitkeep
DELETED
File without changes
|
@@ -1,9 +0,0 @@
|
|
1
|
-
namespace :service_tickets do
|
2
|
-
desc 'Remove expired service tickets.'
|
3
|
-
task cleanup: :environment do
|
4
|
-
[:consumed, :unconsumed].each do |type|
|
5
|
-
rows_affected = ServiceTicket.send("cleanup_#{type}")
|
6
|
-
puts "Deleted #{rows_affected} #{type} service tickets."
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|