casino 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ BˈQm�2�7�{E�7}�K�JB�q��ͼ9v7�;����|�~�Ľ�ggj��� �jPn���N���hZo_;wԾ q�-�$���9��Q���Ri�14X�_"IV>�F��w�b�#�����K��f��m%+v0݌�����27�ɪ��8�u�a��]��[�qHvI
2
+ Zn;OD9 �{.�� ��'P�R�{���ڭ$߮��H���{ZT��&Ӯ�cP��r�����VC�9�"�pԙ`C^��)
@@ -7,19 +7,19 @@
7
7
  var serviceEl = doc.getElementById('service'),
8
8
  service = serviceEl ? serviceEl.getAttribute('value') : null;
9
9
 
10
- if(cookie_regex.test(document.cookie)) {
10
+ if(cookie_regex.test(doc.cookie)) {
11
11
  url = '/login';
12
12
  if(service) {
13
13
  url += '?service=' + encodeURIComponent(service);
14
14
  }
15
- window.location = url;
15
+ win.location = url;
16
16
  } else {
17
17
  setTimeout(checkCookieExists, 1000);
18
18
  }
19
19
  }
20
20
 
21
21
  // Auto-login when logged-in in other browser window (9887c4e)
22
- document.addEventListener('DOMContentLoaded', function() {
22
+ doc.addEventListener('DOMContentLoaded', function() {
23
23
  if(ready_bound) {
24
24
  return;
25
25
  }
@@ -49,6 +49,24 @@ a {
49
49
  }
50
50
  }
51
51
 
52
+ form.button_to {
53
+ display: inline;
54
+ margin: 0;
55
+ padding: 0;
56
+ div { display: inline; }
57
+ input[type=submit] {
58
+ margin: 0;
59
+ padding: 0;
60
+ -webkit-appearance: caret;
61
+ background: none;
62
+ border: none;
63
+ font-size: inherit;
64
+ font-family: inherit;
65
+ cursor: pointer;
66
+ @extend a
67
+ }
68
+ }
69
+
52
70
  label {
53
71
  color: #4d4d4d;
54
72
  display: block;
@@ -4,7 +4,7 @@ class CASino::ServiceTicket < ActiveRecord::Base
4
4
  attr_accessible :ticket, :service, :issued_from_credentials
5
5
  validates :ticket, uniqueness: true
6
6
  belongs_to :ticket_granting_ticket
7
- before_destroy :send_single_sing_out_notification, if: :consumed?
7
+ before_destroy :send_single_sign_out_notification, if: :consumed?
8
8
  has_many :proxy_granting_tickets, as: :granter, dependent: :destroy
9
9
 
10
10
  def self.cleanup_unconsumed
@@ -35,7 +35,7 @@ class CASino::ServiceTicket < ActiveRecord::Base
35
35
  end
36
36
 
37
37
  private
38
- def send_single_sing_out_notification
38
+ def send_single_sign_out_notification
39
39
  notifier = SingleSignOutNotifier.new(self)
40
40
  notifier.notify
41
41
  true
@@ -18,7 +18,7 @@
18
18
  <% if @two_factor_authenticators.blank? %>
19
19
  <%= t('two_factor_authenticators.disabled') %> - <%= link_to t('two_factor_authenticators.enable'), new_two_factor_authenticator_path %>
20
20
  <% else %>
21
- <%= t('two_factor_authenticators.enabled') %> - <%= link_to t('two_factor_authenticators.disable'), two_factor_authenticator_path(@two_factor_authenticators[0].id), method: :delete %>
21
+ <%= t('two_factor_authenticators.enabled') %> - <%= button_to t('two_factor_authenticators.disable'), two_factor_authenticator_path(@two_factor_authenticators[0].id), method: :delete %>
22
22
  <% end %>
23
23
 
24
24
  <h3><%= t('sessions.your_active_sessions') %></h3>
@@ -49,7 +49,7 @@
49
49
  <% if current_ticket_granting_ticket?(ticket_granting_ticket) %>
50
50
  <strong><%= t('sessions.current_session') %></strong>
51
51
  <% else %>
52
- <%= link_to t('sessions.end_session'), session_path(ticket_granting_ticket.id), method: :delete %>
52
+ <%= button_to t('sessions.end_session'), session_path(ticket_granting_ticket.id), method: :delete %>
53
53
  <% end %>
54
54
  </td>
55
55
  </tr>
@@ -11,7 +11,7 @@
11
11
  <%= t('two_factor_authenticators.instructions') %>
12
12
  </p>
13
13
  <div id="qr-code">
14
- <img src="https://chart.googleapis.com/chart?cht=qr&chs=250x250&chl=<%= u "otpauth://totp/#{u CASino.config.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 CASino.config.frontend[:sso_name] + ': ' + @two_factor_authenticator.user.username}?secret=#{@two_factor_authenticator.secret}&issuer=#{u CASino.config.frontend[:sso_name]}" %>" height="250" width="250"><br />
15
15
  </div>
16
16
  <p id="secret">
17
17
  <%= t('two_factor_authenticators.secret') %>: <%= @two_factor_authenticator.secret %>
@@ -6,6 +6,8 @@
6
6
  <%= stylesheet_link_tag "application", :media => "all" %>
7
7
  <%= javascript_include_tag "application" %>
8
8
  <%= csrf_meta_tags %>
9
+ <%= favicon_link_tag 'favicon.png', type: 'image/png' %>
10
+ <%= favicon_link_tag 'logo.png', type: 'image/png', rel: 'logo' %>
9
11
  </head>
10
12
  <body>
11
13
 
@@ -1,3 +1,3 @@
1
1
  module CASino
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
@@ -10,7 +10,5 @@
10
10
  // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
11
  // GO AFTER THE REQUIRES BELOW.
12
12
  //
13
- //= require jquery
14
- //= require jquery_ujs
15
13
  //= require casino
16
14
  //= require_tree .
@@ -16,7 +16,7 @@ describe 'Session overview' do
16
16
  it { should have_text('Active Session') }
17
17
 
18
18
  context 'without other sessions' do
19
- it { should_not have_link('End session') }
19
+ it { should_not have_button('End session') }
20
20
  end
21
21
 
22
22
  context 'when other sessions exist' do
@@ -26,7 +26,7 @@ describe 'Session overview' do
26
26
  end
27
27
  visit sessions_path
28
28
  end
29
- it { should have_link('End session') }
29
+ it { should have_button('End session') }
30
30
  end
31
31
 
32
32
  context 'with two-factor authentication disabled' do
@@ -37,13 +37,13 @@ describe 'Session overview' do
37
37
  visit sessions_path
38
38
  end
39
39
  it { should have_link('Enable', href: new_two_factor_authenticator_path) }
40
- it { should_not have_link('Disable') }
40
+ it { should_not have_button('Disable') }
41
41
  end
42
42
 
43
43
  context 'with two-factor authentication enabled' do
44
44
  before { enable_two_factor_authentication }
45
45
  it { should_not have_link('Enable', href: new_two_factor_authenticator_path) }
46
- it { should have_link('Disable') }
46
+ it { should have_button('Disable') }
47
47
  end
48
48
  end
49
49
 
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'TwoFactorAuthenticator' do
4
+ include CASino::Engine.routes.url_helpers
5
+
6
+ subject { page }
7
+
8
+ context 'when logged in' do
9
+ before do
10
+ sign_in
11
+ end
12
+
13
+ context 'with two-factor authentication enabled' do
14
+ before do
15
+ enable_two_factor_authentication
16
+ end
17
+
18
+ describe 'disabling two-factor authentication' do
19
+ before do
20
+ click_button 'Disable'
21
+ end
22
+
23
+ it { should have_text 'authenticator was successfully deleted' }
24
+
25
+ it 'deletes the two-factor authenticator' do
26
+ CASino::TwoFactorAuthenticator.count.should == 0
27
+ end
28
+ end
29
+ end
30
+ end
31
+ 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: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,8 +10,35 @@ authors:
10
10
  - Samuel Sieg
11
11
  autorequire:
12
12
  bindir: bin
13
- cert_chain: []
14
- date: 2013-10-30 00:00:00.000000000 Z
13
+ cert_chain:
14
+ - !binary |-
15
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLakNDQWhLZ0F3SUJB
16
+ Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE3TVEwd0N3WURWUVFEREFScGJt
17
+ WnYKTVJVd0V3WUtDWkltaVpQeUxHUUJHUllGY21KallYTXhFekFSQmdvSmtp
18
+ YUprL0lzWkFFWkZnTmpiMjB3SGhjTgpNVE13TWpBeU1qSXlOakkyV2hjTk1U
19
+ UXdNakF5TWpJeU5qSTJXakE3TVEwd0N3WURWUVFEREFScGJtWnZNUlV3CkV3
20
+ WUtDWkltaVpQeUxHUUJHUllGY21KallYTXhFekFSQm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eFg5Nlg5WVRYT0hFCndRc0xpK0xqbnorVWFPUmsxZHhabGNYWUdjMzR3Rmcx
38
+ b1VSdnUwRzgvWXlIVUFtSVUvV0tyanIxYmdjZjFWUnYKUjRLRDFNblVWL3Y1
39
+ MDJwaU1sWG1qeE9XZGJLOHl2UUVIa3N1L3pqYkNqU3UrTTJrd0ZtV0dzeDVu
40
+ eCtWZHc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
41
+ date: 2013-11-19 00:00:00.000000000 Z
15
42
  dependencies:
16
43
  - !ruby/object:Gem::Dependency
17
44
  name: capybara
@@ -275,6 +302,7 @@ files:
275
302
  - app/assets/fonts/casino-icons.svg
276
303
  - app/assets/fonts/casino-icons.ttf
277
304
  - app/assets/fonts/casino-icons.woff
305
+ - app/assets/images/favicon.png
278
306
  - app/assets/images/logo.png
279
307
  - app/assets/images/logo@2x.png
280
308
  - app/assets/images/rails.png
@@ -455,6 +483,7 @@ files:
455
483
  - spec/features/login_spec.rb
456
484
  - spec/features/logout_spec.rb
457
485
  - spec/features/session_overview_spec.rb
486
+ - spec/features/two_factor_authenticator_spec.rb
458
487
  - spec/model/login_ticket_spec.rb
459
488
  - spec/model/proxy_ticket_spec.rb
460
489
  - spec/model/service_rule_spec.rb
@@ -583,6 +612,7 @@ test_files:
583
612
  - spec/features/login_spec.rb
584
613
  - spec/features/logout_spec.rb
585
614
  - spec/features/session_overview_spec.rb
615
+ - spec/features/two_factor_authenticator_spec.rb
586
616
  - spec/model/login_ticket_spec.rb
587
617
  - spec/model/proxy_ticket_spec.rb
588
618
  - spec/model/service_rule_spec.rb
Binary file