casino 3.0.4 → 4.0.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +12 -3
  3. data/app/api/casino/api.rb +7 -0
  4. data/app/api/casino/api/entity/auth_token_ticket.rb +5 -0
  5. data/app/api/casino/api/resource/auth_token_tickets.rb +12 -0
  6. data/app/assets/javascripts/casino/{application.js → application.js.erb} +1 -1
  7. data/app/authenticators/casino/static_authenticator.rb +8 -2
  8. data/app/builders/casino/proxy_response_builder.rb +24 -0
  9. data/app/builders/casino/ticket_validation_response_builder.rb +9 -5
  10. data/app/controllers/casino/application_controller.rb +0 -22
  11. data/app/controllers/casino/auth_tokens_controller.rb +34 -0
  12. data/app/controllers/casino/controller_concern/ticket_validator.rb +30 -0
  13. data/app/controllers/casino/proxy_tickets_controller.rb +42 -2
  14. data/app/controllers/casino/service_tickets_controller.rb +15 -2
  15. data/app/controllers/casino/sessions_controller.rb +59 -8
  16. data/app/controllers/casino/two_factor_authenticators_controller.rb +28 -3
  17. data/app/helpers/casino/sessions_helper.rb +75 -0
  18. data/app/helpers/casino/two_factor_authenticators_helper.rb +12 -0
  19. data/app/models/casino/auth_token_ticket.rb +15 -0
  20. data/app/models/casino/login_ticket.rb +7 -4
  21. data/app/models/casino/model_concern/consumable_ticket.rb +20 -0
  22. data/app/models/casino/model_concern/ticket.rb +28 -0
  23. data/app/models/casino/proxy_granting_ticket.rb +12 -0
  24. data/app/models/casino/proxy_ticket.rb +4 -0
  25. data/app/models/casino/service_ticket.rb +5 -4
  26. data/app/models/casino/ticket_granting_ticket.rb +5 -1
  27. data/app/models/casino/two_factor_authenticator.rb +2 -0
  28. data/app/processors/casino/authentication_processor.rb +73 -0
  29. data/app/processors/casino/browser_processor.rb +12 -0
  30. data/app/processors/casino/proxy_granting_ticket_processor.rb +37 -0
  31. data/app/processors/casino/service_ticket_processor.rb +81 -0
  32. data/app/processors/casino/ticket_granting_ticket_processor.rb +56 -0
  33. data/app/processors/casino/two_factor_authenticator_processor.rb +18 -0
  34. data/app/services/casino/auth_token_validation_service.rb +66 -0
  35. data/app/views/casino/sessions/index.html.erb +2 -2
  36. data/app/views/casino/sessions/new.html.erb +1 -1
  37. data/app/views/casino/sessions/validate_otp.html.erb +1 -1
  38. data/app/views/casino/two_factor_authenticators/new.html.erb +6 -3
  39. data/app/views/layouts/application.html.erb +0 -1
  40. data/casino.gemspec +4 -2
  41. data/config/locales/en.yml +35 -0
  42. data/config/locales/zh-CN.yml +88 -0
  43. data/config/locales/zh-TW.yml +88 -0
  44. data/config/routes.rb +3 -10
  45. data/db/migrate/20140831205255_create_auth_token_tickets.rb +10 -0
  46. data/lib/casino.rb +4 -1
  47. data/lib/casino/tasks/cleanup.rake +13 -1
  48. data/lib/casino/version.rb +1 -1
  49. data/spec/controllers/auth_tokens_controller_spec.rb +75 -0
  50. data/spec/controllers/proxy_tickets_controller_spec.rb +120 -14
  51. data/spec/controllers/service_and_proxy_tickets_controller_spec.rb +224 -0
  52. data/spec/controllers/service_tickets_controller_spec.rb +62 -16
  53. data/spec/controllers/sessions_controller_spec.rb +622 -36
  54. data/spec/controllers/two_factor_authenticators_controller_spec.rb +217 -18
  55. data/spec/dummy/config/cas.yml +3 -0
  56. data/spec/dummy/config/environments/development.rb +0 -4
  57. data/spec/dummy/db/migrate/{20130910094259_create_base_models.casino.rb → 20140831214845_create_core_schema.casino.rb} +55 -32
  58. data/spec/dummy/db/migrate/20140831214846_rename_base_models.casino.rb +102 -0
  59. data/spec/dummy/db/migrate/20140831214847_cleanup_indexes.casino.rb +28 -0
  60. data/spec/dummy/db/migrate/20140831214848_fix_long_index_names.casino.rb +13 -0
  61. data/spec/dummy/db/migrate/20140831214849_change_service_to_text.casino.rb +7 -0
  62. data/spec/dummy/db/migrate/20140831214850_change_user_agent_to_text.casino.rb +6 -0
  63. data/spec/dummy/db/migrate/20140831214851_fix_length_of_text_fields.casino.rb +8 -0
  64. data/spec/dummy/db/migrate/20140831214852_create_auth_token_tickets.casino.rb +11 -0
  65. data/spec/dummy/db/schema.rb +79 -70
  66. data/spec/features/login_spec.rb +0 -9
  67. data/spec/model/auth_token_ticket_spec.rb +23 -0
  68. data/spec/services/auth_token_validation_service_spec.rb +83 -0
  69. data/spec/support/sign_in.rb +4 -0
  70. metadata +139 -210
  71. data/app/controllers/casino/api/v1/tickets_controller.rb +0 -55
  72. data/app/helpers/service_tickets_helper.rb +0 -2
  73. data/app/listeners/casino/legacy_validator_listener.rb +0 -11
  74. data/app/listeners/casino/listener.rb +0 -16
  75. data/app/listeners/casino/login_credential_acceptor_listener.rb +0 -38
  76. data/app/listeners/casino/login_credential_requestor_listener.rb +0 -21
  77. data/app/listeners/casino/logout_listener.rb +0 -12
  78. data/app/listeners/casino/other_sessions_destroyer_listener.rb +0 -7
  79. data/app/listeners/casino/proxy_ticket_provider_listener.rb +0 -11
  80. data/app/listeners/casino/second_factor_authentication_acceptor_listener.rb +0 -26
  81. data/app/listeners/casino/session_destroyer_listener.rb +0 -11
  82. data/app/listeners/casino/session_overview_listener.rb +0 -11
  83. data/app/listeners/casino/ticket_validator_listener.rb +0 -11
  84. data/app/listeners/casino/two_factor_authenticator_activator_listener.rb +0 -23
  85. data/app/listeners/casino/two_factor_authenticator_destroyer_listener.rb +0 -16
  86. data/app/listeners/casino/two_factor_authenticator_overview_listener.rb +0 -11
  87. data/app/listeners/casino/two_factor_authenticator_registrator_listener.rb +0 -11
  88. data/app/processors/casino/api/login_credential_acceptor_processor.rb +0 -46
  89. data/app/processors/casino/api/logout_processor.rb +0 -17
  90. data/app/processors/casino/api/service_ticket_provider_processor.rb +0 -69
  91. data/app/processors/casino/legacy_validator_processor.rb +0 -19
  92. data/app/processors/casino/login_credential_acceptor_processor.rb +0 -63
  93. data/app/processors/casino/login_credential_requestor_processor.rb +0 -70
  94. data/app/processors/casino/logout_processor.rb +0 -23
  95. data/app/processors/casino/other_sessions_destroyer_processor.rb +0 -26
  96. data/app/processors/casino/processor.rb +0 -5
  97. data/app/processors/casino/processor_concern/authentication.rb +0 -87
  98. data/app/processors/casino/processor_concern/browser.rb +0 -14
  99. data/app/processors/casino/processor_concern/login_tickets.rb +0 -28
  100. data/app/processors/casino/processor_concern/proxy_granting_tickets.rb +0 -43
  101. data/app/processors/casino/processor_concern/proxy_tickets.rb +0 -56
  102. data/app/processors/casino/processor_concern/service_tickets.rb +0 -50
  103. data/app/processors/casino/processor_concern/ticket_granting_tickets.rb +0 -65
  104. data/app/processors/casino/processor_concern/tickets.rb +0 -17
  105. data/app/processors/casino/processor_concern/two_factor_authenticators.rb +0 -23
  106. data/app/processors/casino/proxy_ticket_provider_processor.rb +0 -41
  107. data/app/processors/casino/proxy_ticket_validator_processor.rb +0 -22
  108. data/app/processors/casino/second_factor_authentication_acceptor_processor.rb +0 -45
  109. data/app/processors/casino/service_ticket_validator_processor.rb +0 -46
  110. data/app/processors/casino/session_destroyer_processor.rb +0 -25
  111. data/app/processors/casino/session_overview_processor.rb +0 -21
  112. data/app/processors/casino/two_factor_authenticator_activator_processor.rb +0 -41
  113. data/app/processors/casino/two_factor_authenticator_destroyer_processor.rb +0 -33
  114. data/app/processors/casino/two_factor_authenticator_overview_processor.rb +0 -20
  115. data/app/processors/casino/two_factor_authenticator_registrator_processor.rb +0 -24
  116. data/spec/controllers/api/v1/tickets_controller_spec.rb +0 -114
  117. data/spec/controllers/listener/legacy_validator_spec.rb +0 -22
  118. data/spec/controllers/listener/login_credential_acceptor_spec.rb +0 -108
  119. data/spec/controllers/listener/login_credential_requestor_spec.rb +0 -57
  120. data/spec/controllers/listener/logout_spec.rb +0 -38
  121. data/spec/controllers/listener/other_sessions_destroyer_spec.rb +0 -19
  122. data/spec/controllers/listener/proxy_ticket_provider_spec.rb +0 -22
  123. data/spec/controllers/listener/second_factor_authentication_acceptor_spec.rb +0 -74
  124. data/spec/controllers/listener/session_destroyer_spec.rb +0 -25
  125. data/spec/controllers/listener/session_overview_spec.rb +0 -26
  126. data/spec/controllers/listener/ticket_validator_spec.rb +0 -22
  127. data/spec/controllers/listener/two_factor_authenticator_activator_spec.rb +0 -64
  128. data/spec/controllers/listener/two_factor_authenticator_destroyer_spec.rb +0 -40
  129. data/spec/controllers/listener/two_factor_authenticator_overview_spec.rb +0 -16
  130. data/spec/controllers/listener/two_factor_authenticator_registrator_spec.rb +0 -27
  131. data/spec/processor/api/login_credential_acceptor_spec.rb +0 -52
  132. data/spec/processor/api/logout_spec.rb +0 -34
  133. data/spec/processor/api/service_ticket_provider_spec.rb +0 -61
  134. data/spec/processor/legacy_validator_spec.rb +0 -78
  135. data/spec/processor/login_credential_acceptor_spec.rb +0 -164
  136. data/spec/processor/login_credential_requestor_spec.rb +0 -145
  137. data/spec/processor/logout_other_sessions_spec.rb +0 -53
  138. data/spec/processor/logout_spec.rb +0 -72
  139. data/spec/processor/processor_concern/service_tickets_spec.rb +0 -49
  140. data/spec/processor/proxy_ticket_provider_spec.rb +0 -66
  141. data/spec/processor/proxy_ticket_validator_spec.rb +0 -65
  142. data/spec/processor/second_factor_authenticaton_acceptor_spec.rb +0 -94
  143. data/spec/processor/session_destroyer_spec.rb +0 -75
  144. data/spec/processor/session_overview_spec.rb +0 -49
  145. data/spec/processor/ticket_validator_spec.rb +0 -214
  146. data/spec/processor/two_factor_authenticator_activator_spec.rb +0 -122
  147. data/spec/processor/two_factor_authenticator_destroyer_spec.rb +0 -71
  148. data/spec/processor/two_factor_authenticator_overview_spec.rb +0 -56
  149. data/spec/processor/two_factor_authenticator_registrator_spec.rb +0 -48
@@ -0,0 +1,28 @@
1
+ # This migration comes from casino (originally 20131022110146)
2
+ class CleanupIndexes < ActiveRecord::Migration
3
+ def change
4
+ # delete some leftovers in migrated CASino 1.x installations
5
+ remove_deprecated_index_if_exists :login_tickets, [:ticket]
6
+ remove_deprecated_index_if_exists :proxy_granting_tickets, [:granter_type, :granter_id]
7
+ remove_deprecated_index_if_exists :proxy_granting_tickets, [:iou]
8
+ remove_deprecated_index_if_exists :proxy_tickets, [:proxy_granting_ticket_id]
9
+ remove_deprecated_index_if_exists :proxy_tickets, [:ticket]
10
+ remove_deprecated_index_if_exists :service_rules, [:url]
11
+ remove_deprecated_index_if_exists :service_tickets, [:ticket]
12
+ remove_deprecated_index_if_exists :service_tickets, [:ticket_granting_ticket_id]
13
+ remove_deprecated_index_if_exists :ticket_granting_tickets, [:ticket]
14
+ remove_deprecated_index_if_exists :two_factor_authenticators, [:user_id]
15
+ remove_deprecated_index_if_exists :users, [:authenticator, :username]
16
+ end
17
+
18
+ private
19
+ def remove_deprecated_index_if_exists(old_table_name, column_names)
20
+ table_name = :"casino_#{old_table_name}"
21
+ index_name = :"index_#{old_table_name}_on_#{column_names.join('_and_')}"
22
+ if index_name_exists?(table_name, index_name, false)
23
+ remove_index table_name, name: index_name
24
+ else
25
+ puts "index #{index_name} on #{table_name} not found"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ # This migration comes from casino (originally 20131022110246)
2
+ class FixLongIndexNames < ActiveRecord::Migration
3
+ def change
4
+ # Long names prevent us from doing some migrations, because the resulting
5
+ # temporary index names would be longer than 64 characters:
6
+ # Index name 'temp_index_altered_casino_proxy_tickets_on_proxy_granting_ticket_id' on table
7
+ # 'altered_casino_proxy_tickets' is too long; the limit is 64 characters
8
+ remove_index :casino_service_tickets, :ticket_granting_ticket_id
9
+ remove_index :casino_proxy_tickets, :proxy_granting_ticket_id
10
+ add_index :casino_service_tickets, :ticket_granting_ticket_id, name: 'casino_service_tickets_on_tgt_id'
11
+ add_index :casino_proxy_tickets, :proxy_granting_ticket_id, name: 'casino_proxy_tickets_on_pgt_id'
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from casino (originally 20131022110346)
2
+ class ChangeServiceToText < ActiveRecord::Migration
3
+ def change
4
+ change_column :casino_proxy_tickets, :service, :text
5
+ change_column :casino_service_tickets, :service, :text
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from casino (originally 20140821142611)
2
+ class ChangeUserAgentToText < ActiveRecord::Migration
3
+ def change
4
+ change_column :casino_ticket_granting_tickets, :user_agent, :text
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from casino (originally 20140827183611)
2
+ class FixLengthOfTextFields < ActiveRecord::Migration
3
+ def change
4
+ change_column :casino_proxy_tickets, :service, :text, :limit => nil
5
+ change_column :casino_service_tickets, :service, :text, :limit => nil
6
+ change_column :casino_ticket_granting_tickets, :user_agent, :text, :limit => nil
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from casino (originally 20140831205255)
2
+ class CreateAuthTokenTickets < ActiveRecord::Migration
3
+ def change
4
+ create_table :casino_auth_token_tickets do |t|
5
+ t.string :ticket, :null => false
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :casino_auth_token_tickets, :ticket, :unique => true
10
+ end
11
+ end
@@ -9,99 +9,108 @@
9
9
  # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
10
  # you'll amass, the slower it'll run and the greater likelihood for issues).
11
11
  #
12
- # It's strongly recommended to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130910094259) do
14
+ ActiveRecord::Schema.define(version: 20140831214852) do
15
15
 
16
- create_table "casino_login_tickets", :force => true do |t|
17
- t.string "ticket", :null => false
18
- t.datetime "created_at", :null => false
19
- t.datetime "updated_at", :null => false
16
+ create_table "casino_auth_token_tickets", force: true do |t|
17
+ t.string "ticket", null: false
18
+ t.datetime "created_at"
19
+ t.datetime "updated_at"
20
20
  end
21
21
 
22
- add_index "casino_login_tickets", ["ticket"], :name => "index_casino_login_tickets_on_ticket", :unique => true
22
+ add_index "casino_auth_token_tickets", ["ticket"], name: "index_casino_auth_token_tickets_on_ticket", unique: true
23
23
 
24
- create_table "casino_proxy_granting_tickets", :force => true do |t|
25
- t.string "ticket", :null => false
26
- t.string "iou", :null => false
27
- t.integer "granter_id", :null => false
28
- t.string "pgt_url", :null => false
29
- t.string "granter_type", :null => false
30
- t.datetime "created_at", :null => false
31
- t.datetime "updated_at", :null => false
24
+ create_table "casino_login_tickets", force: true do |t|
25
+ t.string "ticket", null: false
26
+ t.datetime "created_at"
27
+ t.datetime "updated_at"
32
28
  end
33
29
 
34
- add_index "casino_proxy_granting_tickets", ["granter_type", "granter_id"], :name => "index_casino_proxy_granting_tickets_on_granter", :unique => true
35
- add_index "casino_proxy_granting_tickets", ["iou"], :name => "index_casino_proxy_granting_tickets_on_iou", :unique => true
36
- add_index "casino_proxy_granting_tickets", ["ticket"], :name => "index_casino_proxy_granting_tickets_on_ticket", :unique => true
37
-
38
- create_table "casino_proxy_tickets", :force => true do |t|
39
- t.string "ticket", :null => false
40
- t.string "service", :null => false
41
- t.boolean "consumed", :default => false, :null => false
42
- t.integer "proxy_granting_ticket_id", :null => false
43
- t.datetime "created_at", :null => false
44
- t.datetime "updated_at", :null => false
30
+ add_index "casino_login_tickets", ["ticket"], name: "index_casino_login_tickets_on_ticket", unique: true
31
+
32
+ create_table "casino_proxy_granting_tickets", force: true do |t|
33
+ t.string "ticket", null: false
34
+ t.string "iou", null: false
35
+ t.integer "granter_id", null: false
36
+ t.string "pgt_url", null: false
37
+ t.string "granter_type", null: false
38
+ t.datetime "created_at"
39
+ t.datetime "updated_at"
40
+ end
41
+
42
+ add_index "casino_proxy_granting_tickets", ["granter_type", "granter_id"], name: "index_casino_proxy_granting_tickets_on_granter", unique: true
43
+ add_index "casino_proxy_granting_tickets", ["granter_type", "granter_id"], name: "index_proxy_granting_tickets_on_granter", unique: true
44
+ add_index "casino_proxy_granting_tickets", ["iou"], name: "index_casino_proxy_granting_tickets_on_iou", unique: true
45
+ add_index "casino_proxy_granting_tickets", ["ticket"], name: "index_casino_proxy_granting_tickets_on_ticket", unique: true
46
+
47
+ create_table "casino_proxy_tickets", force: true do |t|
48
+ t.string "ticket", null: false
49
+ t.text "service", null: false
50
+ t.boolean "consumed", default: false, null: false
51
+ t.integer "proxy_granting_ticket_id", null: false
52
+ t.datetime "created_at"
53
+ t.datetime "updated_at"
45
54
  end
46
55
 
47
- add_index "casino_proxy_tickets", ["proxy_granting_ticket_id"], :name => "index_casino_proxy_tickets_on_proxy_granting_ticket_id"
48
- add_index "casino_proxy_tickets", ["ticket"], :name => "index_casino_proxy_tickets_on_ticket", :unique => true
49
-
50
- create_table "casino_service_rules", :force => true do |t|
51
- t.boolean "enabled", :default => true, :null => false
52
- t.integer "order", :default => 10, :null => false
53
- t.string "name", :null => false
54
- t.string "url", :null => false
55
- t.boolean "regex", :default => false, :null => false
56
- t.datetime "created_at", :null => false
57
- t.datetime "updated_at", :null => false
56
+ add_index "casino_proxy_tickets", ["proxy_granting_ticket_id"], name: "casino_proxy_tickets_on_pgt_id"
57
+ add_index "casino_proxy_tickets", ["ticket"], name: "index_casino_proxy_tickets_on_ticket", unique: true
58
+
59
+ create_table "casino_service_rules", force: true do |t|
60
+ t.boolean "enabled", default: true, null: false
61
+ t.integer "order", default: 10, null: false
62
+ t.string "name", null: false
63
+ t.string "url", null: false
64
+ t.boolean "regex", default: false, null: false
65
+ t.datetime "created_at"
66
+ t.datetime "updated_at"
58
67
  end
59
68
 
60
- add_index "casino_service_rules", ["url"], :name => "index_casino_service_rules_on_url", :unique => true
69
+ add_index "casino_service_rules", ["url"], name: "index_casino_service_rules_on_url", unique: true
61
70
 
62
- create_table "casino_service_tickets", :force => true do |t|
63
- t.string "ticket", :null => false
64
- t.string "service", :null => false
71
+ create_table "casino_service_tickets", force: true do |t|
72
+ t.string "ticket", null: false
73
+ t.text "service", null: false
65
74
  t.integer "ticket_granting_ticket_id"
66
- t.boolean "consumed", :default => false, :null => false
67
- t.boolean "issued_from_credentials", :default => false, :null => false
68
- t.datetime "created_at", :null => false
69
- t.datetime "updated_at", :null => false
75
+ t.boolean "consumed", default: false, null: false
76
+ t.boolean "issued_from_credentials", default: false, null: false
77
+ t.datetime "created_at"
78
+ t.datetime "updated_at"
70
79
  end
71
80
 
72
- add_index "casino_service_tickets", ["ticket"], :name => "index_casino_service_tickets_on_ticket", :unique => true
73
- add_index "casino_service_tickets", ["ticket_granting_ticket_id"], :name => "index_casino_service_tickets_on_ticket_granting_ticket_id"
74
-
75
- create_table "casino_ticket_granting_tickets", :force => true do |t|
76
- t.string "ticket", :null => false
77
- t.string "user_agent"
78
- t.integer "user_id", :null => false
79
- t.boolean "awaiting_two_factor_authentication", :default => false, :null => false
80
- t.boolean "long_term", :default => false, :null => false
81
- t.datetime "created_at", :null => false
82
- t.datetime "updated_at", :null => false
81
+ add_index "casino_service_tickets", ["ticket"], name: "index_casino_service_tickets_on_ticket", unique: true
82
+ add_index "casino_service_tickets", ["ticket_granting_ticket_id"], name: "casino_service_tickets_on_tgt_id"
83
+
84
+ create_table "casino_ticket_granting_tickets", force: true do |t|
85
+ t.string "ticket", null: false
86
+ t.text "user_agent"
87
+ t.integer "user_id", null: false
88
+ t.boolean "awaiting_two_factor_authentication", default: false, null: false
89
+ t.boolean "long_term", default: false, null: false
90
+ t.datetime "created_at"
91
+ t.datetime "updated_at"
83
92
  end
84
93
 
85
- add_index "casino_ticket_granting_tickets", ["ticket"], :name => "index_casino_ticket_granting_tickets_on_ticket", :unique => true
94
+ add_index "casino_ticket_granting_tickets", ["ticket"], name: "index_casino_ticket_granting_tickets_on_ticket", unique: true
86
95
 
87
- create_table "casino_two_factor_authenticators", :force => true do |t|
88
- t.integer "user_id", :null => false
89
- t.string "secret", :null => false
90
- t.boolean "active", :default => false, :null => false
91
- t.datetime "created_at", :null => false
92
- t.datetime "updated_at", :null => false
96
+ create_table "casino_two_factor_authenticators", force: true do |t|
97
+ t.integer "user_id", null: false
98
+ t.string "secret", null: false
99
+ t.boolean "active", default: false, null: false
100
+ t.datetime "created_at"
101
+ t.datetime "updated_at"
93
102
  end
94
103
 
95
- add_index "casino_two_factor_authenticators", ["user_id"], :name => "index_casino_two_factor_authenticators_on_user_id"
104
+ add_index "casino_two_factor_authenticators", ["user_id"], name: "index_casino_two_factor_authenticators_on_user_id"
96
105
 
97
- create_table "casino_users", :force => true do |t|
98
- t.string "authenticator", :null => false
99
- t.string "username", :null => false
106
+ create_table "casino_users", force: true do |t|
107
+ t.string "authenticator", null: false
108
+ t.string "username", null: false
100
109
  t.text "extra_attributes"
101
- t.datetime "created_at", :null => false
102
- t.datetime "updated_at", :null => false
110
+ t.datetime "created_at"
111
+ t.datetime "updated_at"
103
112
  end
104
113
 
105
- add_index "casino_users", ["authenticator", "username"], :name => "index_casino_users_on_authenticator_and_username", :unique => true
114
+ add_index "casino_users", ["authenticator", "username"], name: "index_casino_users_on_authenticator_and_username", unique: true
106
115
 
107
116
  end
@@ -65,13 +65,4 @@ describe 'Login' do
65
65
  it { should have_button('Login') }
66
66
  it { should have_text('Incorrect username or password') }
67
67
  end
68
-
69
- context 'with german locale' do
70
- before do
71
- page.driver.header 'Accept-Language', 'de'
72
- visit login_path
73
- end
74
-
75
- it { should have_text('Benutzername') }
76
- end
77
68
  end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::AuthTokenTicket do
4
+ describe '.cleanup' do
5
+ it 'deletes expired auth token tickets' do
6
+ ticket = described_class.new ticket: 'ATT-12345'
7
+ ticket.save!
8
+ ticket.created_at = 10.minutes.ago
9
+ ticket.save!
10
+ lambda do
11
+ described_class.cleanup
12
+ end.should change(described_class, :count).by(-1)
13
+ described_class.find_by_ticket('ATT-12345').should be_falsey
14
+ end
15
+ end
16
+
17
+ describe '#to_s' do
18
+ it 'returns the ticket identifier' do
19
+ ticket = described_class.new ticket: 'ATT-12345'
20
+ "#{ticket}".should == ticket.ticket
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,83 @@
1
+ require 'spec_helper'
2
+
3
+ describe CASino::AuthTokenValidationService do
4
+ let(:token) { 'le_token' }
5
+ let(:signature) { 'le_signature' }
6
+
7
+ subject { described_class.new(token, signature) }
8
+
9
+ context 'without any token signers' do
10
+ before(:each) do
11
+ Dir.stub(:glob).with(CASino::AuthTokenValidationService::AUTH_TOKEN_SIGNERS_GLOB).and_return(nil)
12
+ end
13
+
14
+ its(:user_data) { should == nil }
15
+ its(:validation_result) { should == nil }
16
+ end
17
+
18
+ context 'with token signers' do
19
+ let(:signer_path) { '/test.pem' }
20
+ let(:signer_path_content) { 'this_is_le_certificate' }
21
+ let(:digest) { 'le_digest' }
22
+ let(:rsa_stub) do
23
+ double(OpenSSL::PKey::RSA).tap do |mock|
24
+ mock.stub(:verify).with(digest, signature, token).and_return(signature_valid)
25
+ end
26
+ end
27
+
28
+ before(:each) do
29
+ Dir.stub(:glob).with(CASino::AuthTokenValidationService::AUTH_TOKEN_SIGNERS_GLOB) do |&block|
30
+ block.call(signer_path)
31
+ end
32
+ File.stub(:read).with(signer_path).and_return(signer_path_content)
33
+ OpenSSL::Digest::SHA256.stub(:new).and_return(digest)
34
+ OpenSSL::PKey::RSA.stub(:new).with(signer_path_content).and_return(rsa_stub)
35
+ end
36
+
37
+ context 'with an invalid signature' do
38
+ let(:signature_valid) { false }
39
+
40
+ its(:user_data) { should == nil }
41
+ its(:validation_result) { should == nil }
42
+ end
43
+
44
+ context 'with a valid signature' do
45
+ let(:signature_valid) { true }
46
+
47
+ before(:each) do
48
+ CASino::AuthTokenTicket.stub(:consume).and_return(ticket_valid)
49
+ end
50
+
51
+ context 'with an invalid ticket' do
52
+ let(:ticket_valid) { false }
53
+
54
+ its(:user_data) { should == nil }
55
+ its(:validation_result) { should == nil }
56
+ end
57
+
58
+ context 'with a valid ticket' do
59
+ let(:ticket_valid) { true }
60
+
61
+ before(:each) do
62
+ JSON.stub(:parse).and_return(token_data)
63
+ end
64
+
65
+ context 'with invalid user data' do
66
+ let(:token_data) { { authenticator: 'test', username: 'example' } }
67
+
68
+ its(:user_data) { should == nil }
69
+ its(:validation_result) { should == nil }
70
+ end
71
+
72
+ context 'with valid user data' do
73
+ let(:token_data) { { authenticator: 'static', username: 'testuser' } }
74
+ let(:user_data) { { username: 'testuser', extra_attributes: { "name" => "Test User", "game" => [ "StarCraft 2", "Doto" ] } } }
75
+ let(:validation_result) { { authenticator: 'static', user_data: user_data } }
76
+
77
+ its(:user_data) { should == user_data }
78
+ its(:validation_result) { should == validation_result }
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,4 @@
1
+ def sign_in(ticket_granting_ticket)
2
+ request.cookies[:tgt] = ticket_granting_ticket.ticket
3
+ request.user_agent = ticket_granting_ticket.user_agent
4
+ end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casino
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
5
- prerelease:
4
+ version: 4.0.0.pre.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nils Caspar
@@ -11,280 +10,280 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-10-01 00:00:00.000000000 Z
13
+ date: 2015-02-09 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: capybara
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ~>
19
+ - - "~>"
22
20
  - !ruby/object:Gem::Version
23
21
  version: '2.1'
24
22
  type: :development
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ~>
26
+ - - "~>"
30
27
  - !ruby/object:Gem::Version
31
28
  version: '2.1'
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: rake
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ~>
33
+ - - "~>"
38
34
  - !ruby/object:Gem::Version
39
35
  version: '10.0'
40
36
  type: :development
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ~>
40
+ - - "~>"
46
41
  - !ruby/object:Gem::Version
47
42
  version: '10.0'
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: rspec
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ~>
47
+ - - "~>"
54
48
  - !ruby/object:Gem::Version
55
49
  version: '3.0'
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ~>
54
+ - - "~>"
62
55
  - !ruby/object:Gem::Version
63
56
  version: '3.0'
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: rspec-its
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ~>
61
+ - - "~>"
70
62
  - !ruby/object:Gem::Version
71
63
  version: '1.0'
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ~>
68
+ - - "~>"
78
69
  - !ruby/object:Gem::Version
79
70
  version: '1.0'
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: rspec-rails
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ~>
75
+ - - "~>"
86
76
  - !ruby/object:Gem::Version
87
77
  version: '3.0'
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ~>
82
+ - - "~>"
94
83
  - !ruby/object:Gem::Version
95
84
  version: '3.0'
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: sqlite3
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
- - - ~>
89
+ - - "~>"
102
90
  - !ruby/object:Gem::Version
103
91
  version: '1.3'
104
92
  type: :development
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
- - - ~>
96
+ - - "~>"
110
97
  - !ruby/object:Gem::Version
111
98
  version: '1.3'
112
99
  - !ruby/object:Gem::Dependency
113
100
  name: factory_girl
114
101
  requirement: !ruby/object:Gem::Requirement
115
- none: false
116
102
  requirements:
117
- - - ~>
103
+ - - "~>"
118
104
  - !ruby/object:Gem::Version
119
105
  version: '4.1'
120
106
  type: :development
121
107
  prerelease: false
122
108
  version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
109
  requirements:
125
- - - ~>
110
+ - - "~>"
126
111
  - !ruby/object:Gem::Version
127
112
  version: '4.1'
128
113
  - !ruby/object:Gem::Dependency
129
114
  name: webmock
130
115
  requirement: !ruby/object:Gem::Requirement
131
- none: false
132
116
  requirements:
133
- - - ~>
117
+ - - "~>"
134
118
  - !ruby/object:Gem::Version
135
119
  version: '1.9'
136
120
  type: :development
137
121
  prerelease: false
138
122
  version_requirements: !ruby/object:Gem::Requirement
139
- none: false
140
123
  requirements:
141
- - - ~>
124
+ - - "~>"
142
125
  - !ruby/object:Gem::Version
143
126
  version: '1.9'
144
127
  - !ruby/object:Gem::Dependency
145
128
  name: coveralls
146
129
  requirement: !ruby/object:Gem::Requirement
147
- none: false
148
130
  requirements:
149
- - - ~>
131
+ - - "~>"
150
132
  - !ruby/object:Gem::Version
151
133
  version: '0.7'
152
134
  type: :development
153
135
  prerelease: false
154
136
  version_requirements: !ruby/object:Gem::Requirement
155
- none: false
156
137
  requirements:
157
- - - ~>
138
+ - - "~>"
158
139
  - !ruby/object:Gem::Version
159
140
  version: '0.7'
160
141
  - !ruby/object:Gem::Dependency
161
142
  name: rails
162
143
  requirement: !ruby/object:Gem::Requirement
163
- none: false
164
144
  requirements:
165
- - - ~>
145
+ - - ">="
166
146
  - !ruby/object:Gem::Version
167
147
  version: 4.1.0
148
+ - - "<"
149
+ - !ruby/object:Gem::Version
150
+ version: 4.3.0
168
151
  type: :runtime
169
152
  prerelease: false
170
153
  version_requirements: !ruby/object:Gem::Requirement
171
- none: false
172
154
  requirements:
173
- - - ~>
155
+ - - ">="
174
156
  - !ruby/object:Gem::Version
175
157
  version: 4.1.0
158
+ - - "<"
159
+ - !ruby/object:Gem::Version
160
+ version: 4.3.0
176
161
  - !ruby/object:Gem::Dependency
177
162
  name: sass-rails
178
163
  requirement: !ruby/object:Gem::Requirement
179
- none: false
180
164
  requirements:
181
- - - ~>
165
+ - - "~>"
182
166
  - !ruby/object:Gem::Version
183
167
  version: 4.0.0
184
168
  type: :runtime
185
169
  prerelease: false
186
170
  version_requirements: !ruby/object:Gem::Requirement
187
- none: false
188
171
  requirements:
189
- - - ~>
172
+ - - "~>"
190
173
  - !ruby/object:Gem::Version
191
174
  version: 4.0.0
192
- - !ruby/object:Gem::Dependency
193
- name: http_accept_language
194
- requirement: !ruby/object:Gem::Requirement
195
- none: false
196
- requirements:
197
- - - ~>
198
- - !ruby/object:Gem::Version
199
- version: 2.0.0.pre
200
- type: :runtime
201
- prerelease: false
202
- version_requirements: !ruby/object:Gem::Requirement
203
- none: false
204
- requirements:
205
- - - ~>
206
- - !ruby/object:Gem::Version
207
- version: 2.0.0.pre
208
175
  - !ruby/object:Gem::Dependency
209
176
  name: addressable
210
177
  requirement: !ruby/object:Gem::Requirement
211
- none: false
212
178
  requirements:
213
- - - ~>
179
+ - - "~>"
214
180
  - !ruby/object:Gem::Version
215
181
  version: '2.3'
216
182
  type: :runtime
217
183
  prerelease: false
218
184
  version_requirements: !ruby/object:Gem::Requirement
219
- none: false
220
185
  requirements:
221
- - - ~>
186
+ - - "~>"
222
187
  - !ruby/object:Gem::Version
223
188
  version: '2.3'
224
189
  - !ruby/object:Gem::Dependency
225
190
  name: terminal-table
226
191
  requirement: !ruby/object:Gem::Requirement
227
- none: false
228
192
  requirements:
229
- - - ~>
193
+ - - "~>"
230
194
  - !ruby/object:Gem::Version
231
195
  version: '1.4'
232
196
  type: :runtime
233
197
  prerelease: false
234
198
  version_requirements: !ruby/object:Gem::Requirement
235
- none: false
236
199
  requirements:
237
- - - ~>
200
+ - - "~>"
238
201
  - !ruby/object:Gem::Version
239
202
  version: '1.4'
240
203
  - !ruby/object:Gem::Dependency
241
204
  name: useragent
242
205
  requirement: !ruby/object:Gem::Requirement
243
- none: false
244
206
  requirements:
245
- - - ~>
207
+ - - "~>"
246
208
  - !ruby/object:Gem::Version
247
209
  version: '0.4'
248
210
  type: :runtime
249
211
  prerelease: false
250
212
  version_requirements: !ruby/object:Gem::Requirement
251
- none: false
252
213
  requirements:
253
- - - ~>
214
+ - - "~>"
254
215
  - !ruby/object:Gem::Version
255
216
  version: '0.4'
256
217
  - !ruby/object:Gem::Dependency
257
218
  name: faraday
258
219
  requirement: !ruby/object:Gem::Requirement
259
- none: false
260
220
  requirements:
261
- - - ~>
221
+ - - "~>"
262
222
  - !ruby/object:Gem::Version
263
223
  version: '0.8'
264
224
  type: :runtime
265
225
  prerelease: false
266
226
  version_requirements: !ruby/object:Gem::Requirement
267
- none: false
268
227
  requirements:
269
- - - ~>
228
+ - - "~>"
270
229
  - !ruby/object:Gem::Version
271
230
  version: '0.8'
272
231
  - !ruby/object:Gem::Dependency
273
232
  name: rotp
274
233
  requirement: !ruby/object:Gem::Requirement
275
- none: false
276
234
  requirements:
277
- - - ~>
235
+ - - "~>"
278
236
  - !ruby/object:Gem::Version
279
237
  version: '2.0'
280
238
  type: :runtime
281
239
  prerelease: false
282
240
  version_requirements: !ruby/object:Gem::Requirement
283
- none: false
284
241
  requirements:
285
- - - ~>
242
+ - - "~>"
286
243
  - !ruby/object:Gem::Version
287
244
  version: '2.0'
245
+ - !ruby/object:Gem::Dependency
246
+ name: grape
247
+ requirement: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - "~>"
250
+ - !ruby/object:Gem::Version
251
+ version: '0.8'
252
+ type: :runtime
253
+ prerelease: false
254
+ version_requirements: !ruby/object:Gem::Requirement
255
+ requirements:
256
+ - - "~>"
257
+ - !ruby/object:Gem::Version
258
+ version: '0.8'
259
+ - !ruby/object:Gem::Dependency
260
+ name: grape-entity
261
+ requirement: !ruby/object:Gem::Requirement
262
+ requirements:
263
+ - - "~>"
264
+ - !ruby/object:Gem::Version
265
+ version: '0.4'
266
+ type: :runtime
267
+ prerelease: false
268
+ version_requirements: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - "~>"
271
+ - !ruby/object:Gem::Version
272
+ version: '0.4'
273
+ - !ruby/object:Gem::Dependency
274
+ name: rqrcode_png
275
+ requirement: !ruby/object:Gem::Requirement
276
+ requirements:
277
+ - - "~>"
278
+ - !ruby/object:Gem::Version
279
+ version: '0.1'
280
+ type: :runtime
281
+ prerelease: false
282
+ version_requirements: !ruby/object:Gem::Requirement
283
+ requirements:
284
+ - - "~>"
285
+ - !ruby/object:Gem::Version
286
+ version: '0.1'
288
287
  description: CASino is a simple CAS (Central Authentication Service) server.
289
288
  email:
290
289
  - ncaspar@me.com
@@ -294,14 +293,17 @@ executables: []
294
293
  extensions: []
295
294
  extra_rdoc_files: []
296
295
  files:
297
- - .gitignore
298
- - .rspec
299
- - .ruby-gemset
300
- - .travis.yml
296
+ - ".gitignore"
297
+ - ".rspec"
298
+ - ".ruby-gemset"
299
+ - ".travis.yml"
301
300
  - Gemfile
302
301
  - LICENSE.txt
303
302
  - README.md
304
303
  - Rakefile
304
+ - app/api/casino/api.rb
305
+ - app/api/casino/api/entity/auth_token_ticket.rb
306
+ - app/api/casino/api/resource/auth_token_tickets.rb
305
307
  - app/assets/fonts/casino-icons.eot
306
308
  - app/assets/fonts/casino-icons.svg
307
309
  - app/assets/fonts/casino-icons.ttf
@@ -310,39 +312,29 @@ files:
310
312
  - app/assets/images/logo.png
311
313
  - app/assets/images/logo@2x.png
312
314
  - app/assets/images/rails.png
313
- - app/assets/javascripts/casino/application.js
315
+ - app/assets/javascripts/casino/application.js.erb
314
316
  - app/assets/javascripts/casino/index.js
315
317
  - app/assets/javascripts/casino/sessions.js
316
318
  - app/assets/stylesheets/casino.scss
317
319
  - app/assets/stylesheets/casino/icons.scss
318
320
  - app/assets/stylesheets/casino/normalize.scss
319
321
  - app/authenticators/casino/static_authenticator.rb
322
+ - app/builders/casino/proxy_response_builder.rb
320
323
  - app/builders/casino/ticket_validation_response_builder.rb
321
- - app/controllers/casino/api/v1/tickets_controller.rb
322
324
  - app/controllers/casino/application_controller.rb
325
+ - app/controllers/casino/auth_tokens_controller.rb
326
+ - app/controllers/casino/controller_concern/ticket_validator.rb
323
327
  - app/controllers/casino/proxy_tickets_controller.rb
324
328
  - app/controllers/casino/service_tickets_controller.rb
325
329
  - app/controllers/casino/sessions_controller.rb
326
330
  - app/controllers/casino/two_factor_authenticators_controller.rb
327
331
  - app/helpers/application_helper.rb
328
332
  - app/helpers/casino/sessions_helper.rb
329
- - app/helpers/service_tickets_helper.rb
330
- - app/listeners/casino/legacy_validator_listener.rb
331
- - app/listeners/casino/listener.rb
332
- - app/listeners/casino/login_credential_acceptor_listener.rb
333
- - app/listeners/casino/login_credential_requestor_listener.rb
334
- - app/listeners/casino/logout_listener.rb
335
- - app/listeners/casino/other_sessions_destroyer_listener.rb
336
- - app/listeners/casino/proxy_ticket_provider_listener.rb
337
- - app/listeners/casino/second_factor_authentication_acceptor_listener.rb
338
- - app/listeners/casino/session_destroyer_listener.rb
339
- - app/listeners/casino/session_overview_listener.rb
340
- - app/listeners/casino/ticket_validator_listener.rb
341
- - app/listeners/casino/two_factor_authenticator_activator_listener.rb
342
- - app/listeners/casino/two_factor_authenticator_destroyer_listener.rb
343
- - app/listeners/casino/two_factor_authenticator_overview_listener.rb
344
- - app/listeners/casino/two_factor_authenticator_registrator_listener.rb
333
+ - app/helpers/casino/two_factor_authenticators_helper.rb
334
+ - app/models/casino/auth_token_ticket.rb
345
335
  - app/models/casino/login_ticket.rb
336
+ - app/models/casino/model_concern/consumable_ticket.rb
337
+ - app/models/casino/model_concern/ticket.rb
346
338
  - app/models/casino/proxy_granting_ticket.rb
347
339
  - app/models/casino/proxy_ticket.rb
348
340
  - app/models/casino/service_rule.rb
@@ -352,34 +344,13 @@ files:
352
344
  - app/models/casino/two_factor_authenticator.rb
353
345
  - app/models/casino/user.rb
354
346
  - app/models/casino/validation_result.rb
355
- - app/processors/casino/api/login_credential_acceptor_processor.rb
356
- - app/processors/casino/api/logout_processor.rb
357
- - app/processors/casino/api/service_ticket_provider_processor.rb
358
- - app/processors/casino/legacy_validator_processor.rb
359
- - app/processors/casino/login_credential_acceptor_processor.rb
360
- - app/processors/casino/login_credential_requestor_processor.rb
361
- - app/processors/casino/logout_processor.rb
362
- - app/processors/casino/other_sessions_destroyer_processor.rb
363
- - app/processors/casino/processor.rb
364
- - app/processors/casino/processor_concern/authentication.rb
365
- - app/processors/casino/processor_concern/browser.rb
366
- - app/processors/casino/processor_concern/login_tickets.rb
367
- - app/processors/casino/processor_concern/proxy_granting_tickets.rb
368
- - app/processors/casino/processor_concern/proxy_tickets.rb
369
- - app/processors/casino/processor_concern/service_tickets.rb
370
- - app/processors/casino/processor_concern/ticket_granting_tickets.rb
371
- - app/processors/casino/processor_concern/tickets.rb
372
- - app/processors/casino/processor_concern/two_factor_authenticators.rb
373
- - app/processors/casino/proxy_ticket_provider_processor.rb
374
- - app/processors/casino/proxy_ticket_validator_processor.rb
375
- - app/processors/casino/second_factor_authentication_acceptor_processor.rb
376
- - app/processors/casino/service_ticket_validator_processor.rb
377
- - app/processors/casino/session_destroyer_processor.rb
378
- - app/processors/casino/session_overview_processor.rb
379
- - app/processors/casino/two_factor_authenticator_activator_processor.rb
380
- - app/processors/casino/two_factor_authenticator_destroyer_processor.rb
381
- - app/processors/casino/two_factor_authenticator_overview_processor.rb
382
- - app/processors/casino/two_factor_authenticator_registrator_processor.rb
347
+ - app/processors/casino/authentication_processor.rb
348
+ - app/processors/casino/browser_processor.rb
349
+ - app/processors/casino/proxy_granting_ticket_processor.rb
350
+ - app/processors/casino/service_ticket_processor.rb
351
+ - app/processors/casino/ticket_granting_ticket_processor.rb
352
+ - app/processors/casino/two_factor_authenticator_processor.rb
353
+ - app/services/casino/auth_token_validation_service.rb
383
354
  - app/views/casino/application/_footer.html.erb
384
355
  - app/views/casino/application/_messages.html.erb
385
356
  - app/views/casino/service_tickets/validate.text.erb
@@ -399,6 +370,8 @@ files:
399
370
  - config/initializers/wrap_parameters.rb
400
371
  - config/locales/de.yml
401
372
  - config/locales/en.yml
373
+ - config/locales/zh-CN.yml
374
+ - config/locales/zh-TW.yml
402
375
  - config/routes.rb
403
376
  - db/migrate/20130809135400_create_core_schema.rb
404
377
  - db/migrate/20130809135401_rename_base_models.rb
@@ -407,6 +380,7 @@ files:
407
380
  - db/migrate/20131022110346_change_service_to_text.rb
408
381
  - db/migrate/20140821142611_change_user_agent_to_text.rb
409
382
  - db/migrate/20140827183611_fix_length_of_text_fields.rb
383
+ - db/migrate/20140831205255_create_auth_token_tickets.rb
410
384
  - lib/assets/.gitkeep
411
385
  - lib/casino.rb
412
386
  - lib/casino/authenticator.rb
@@ -433,22 +407,9 @@ files:
433
407
  - script/rails
434
408
  - spec/authenticator/base_spec.rb
435
409
  - spec/authenticator/static_spec.rb
436
- - spec/controllers/api/v1/tickets_controller_spec.rb
437
- - spec/controllers/listener/legacy_validator_spec.rb
438
- - spec/controllers/listener/login_credential_acceptor_spec.rb
439
- - spec/controllers/listener/login_credential_requestor_spec.rb
440
- - spec/controllers/listener/logout_spec.rb
441
- - spec/controllers/listener/other_sessions_destroyer_spec.rb
442
- - spec/controllers/listener/proxy_ticket_provider_spec.rb
443
- - spec/controllers/listener/second_factor_authentication_acceptor_spec.rb
444
- - spec/controllers/listener/session_destroyer_spec.rb
445
- - spec/controllers/listener/session_overview_spec.rb
446
- - spec/controllers/listener/ticket_validator_spec.rb
447
- - spec/controllers/listener/two_factor_authenticator_activator_spec.rb
448
- - spec/controllers/listener/two_factor_authenticator_destroyer_spec.rb
449
- - spec/controllers/listener/two_factor_authenticator_overview_spec.rb
450
- - spec/controllers/listener/two_factor_authenticator_registrator_spec.rb
410
+ - spec/controllers/auth_tokens_controller_spec.rb
451
411
  - spec/controllers/proxy_tickets_controller_spec.rb
412
+ - spec/controllers/service_and_proxy_tickets_controller_spec.rb
452
413
  - spec/controllers/service_tickets_controller_spec.rb
453
414
  - spec/controllers/sessions_controller_spec.rb
454
415
  - spec/controllers/two_factor_authenticators_controller_spec.rb
@@ -479,7 +440,14 @@ files:
479
440
  - spec/dummy/config/locales/en.yml
480
441
  - spec/dummy/config/routes.rb
481
442
  - spec/dummy/db/.gitkeep
482
- - spec/dummy/db/migrate/20130910094259_create_base_models.casino.rb
443
+ - spec/dummy/db/migrate/20140831214845_create_core_schema.casino.rb
444
+ - spec/dummy/db/migrate/20140831214846_rename_base_models.casino.rb
445
+ - spec/dummy/db/migrate/20140831214847_cleanup_indexes.casino.rb
446
+ - spec/dummy/db/migrate/20140831214848_fix_long_index_names.casino.rb
447
+ - spec/dummy/db/migrate/20140831214849_change_service_to_text.casino.rb
448
+ - spec/dummy/db/migrate/20140831214850_change_user_agent_to_text.casino.rb
449
+ - spec/dummy/db/migrate/20140831214851_fix_length_of_text_fields.casino.rb
450
+ - spec/dummy/db/migrate/20140831214852_create_auth_token_tickets.casino.rb
483
451
  - spec/dummy/db/schema.rb
484
452
  - spec/dummy/lib/assets/.gitkeep
485
453
  - spec/dummy/log/.gitkeep
@@ -492,6 +460,7 @@ files:
492
460
  - spec/features/logout_spec.rb
493
461
  - spec/features/session_overview_spec.rb
494
462
  - spec/features/two_factor_authenticator_spec.rb
463
+ - spec/model/auth_token_ticket_spec.rb
495
464
  - spec/model/login_ticket_spec.rb
496
465
  - spec/model/proxy_ticket_spec.rb
497
466
  - spec/model/service_rule_spec.rb
@@ -499,25 +468,7 @@ files:
499
468
  - spec/model/service_ticket_spec.rb
500
469
  - spec/model/ticket_granting_ticket_spec.rb
501
470
  - spec/model/two_factor_authenticator_spec.rb
502
- - spec/processor/api/login_credential_acceptor_spec.rb
503
- - spec/processor/api/logout_spec.rb
504
- - spec/processor/api/service_ticket_provider_spec.rb
505
- - spec/processor/legacy_validator_spec.rb
506
- - spec/processor/login_credential_acceptor_spec.rb
507
- - spec/processor/login_credential_requestor_spec.rb
508
- - spec/processor/logout_other_sessions_spec.rb
509
- - spec/processor/logout_spec.rb
510
- - spec/processor/processor_concern/service_tickets_spec.rb
511
- - spec/processor/proxy_ticket_provider_spec.rb
512
- - spec/processor/proxy_ticket_validator_spec.rb
513
- - spec/processor/second_factor_authenticaton_acceptor_spec.rb
514
- - spec/processor/session_destroyer_spec.rb
515
- - spec/processor/session_overview_spec.rb
516
- - spec/processor/ticket_validator_spec.rb
517
- - spec/processor/two_factor_authenticator_activator_spec.rb
518
- - spec/processor/two_factor_authenticator_destroyer_spec.rb
519
- - spec/processor/two_factor_authenticator_overview_spec.rb
520
- - spec/processor/two_factor_authenticator_registrator_spec.rb
471
+ - spec/services/auth_token_validation_service_spec.rb
521
472
  - spec/spec_helper.rb
522
473
  - spec/support/.gitkeep
523
474
  - spec/support/casino.rb
@@ -531,53 +482,40 @@ files:
531
482
  - spec/support/factories/user_factory.rb
532
483
  - spec/support/features_helper.rb
533
484
  - spec/support/rspec.rb
485
+ - spec/support/sign_in.rb
534
486
  - spec/support/sqlite3.rb
535
487
  - vendor/assets/javascripts/.gitkeep
536
488
  - vendor/assets/stylesheets/.gitkeep
537
489
  homepage: http://rbcas.org/
538
490
  licenses:
539
491
  - MIT
492
+ metadata: {}
540
493
  post_install_message:
541
494
  rdoc_options: []
542
495
  require_paths:
543
496
  - lib
544
497
  required_ruby_version: !ruby/object:Gem::Requirement
545
- none: false
546
498
  requirements:
547
- - - ! '>='
499
+ - - ">="
548
500
  - !ruby/object:Gem::Version
549
501
  version: '0'
550
502
  required_rubygems_version: !ruby/object:Gem::Requirement
551
- none: false
552
503
  requirements:
553
- - - ! '>='
504
+ - - ">"
554
505
  - !ruby/object:Gem::Version
555
- version: '0'
506
+ version: 1.3.1
556
507
  requirements: []
557
508
  rubyforge_project:
558
- rubygems_version: 1.8.23
509
+ rubygems_version: 2.2.2
559
510
  signing_key:
560
- specification_version: 3
511
+ specification_version: 4
561
512
  summary: A simple CAS server written in Ruby using the Rails framework.
562
513
  test_files:
563
514
  - spec/authenticator/base_spec.rb
564
515
  - spec/authenticator/static_spec.rb
565
- - spec/controllers/api/v1/tickets_controller_spec.rb
566
- - spec/controllers/listener/legacy_validator_spec.rb
567
- - spec/controllers/listener/login_credential_acceptor_spec.rb
568
- - spec/controllers/listener/login_credential_requestor_spec.rb
569
- - spec/controllers/listener/logout_spec.rb
570
- - spec/controllers/listener/other_sessions_destroyer_spec.rb
571
- - spec/controllers/listener/proxy_ticket_provider_spec.rb
572
- - spec/controllers/listener/second_factor_authentication_acceptor_spec.rb
573
- - spec/controllers/listener/session_destroyer_spec.rb
574
- - spec/controllers/listener/session_overview_spec.rb
575
- - spec/controllers/listener/ticket_validator_spec.rb
576
- - spec/controllers/listener/two_factor_authenticator_activator_spec.rb
577
- - spec/controllers/listener/two_factor_authenticator_destroyer_spec.rb
578
- - spec/controllers/listener/two_factor_authenticator_overview_spec.rb
579
- - spec/controllers/listener/two_factor_authenticator_registrator_spec.rb
516
+ - spec/controllers/auth_tokens_controller_spec.rb
580
517
  - spec/controllers/proxy_tickets_controller_spec.rb
518
+ - spec/controllers/service_and_proxy_tickets_controller_spec.rb
581
519
  - spec/controllers/service_tickets_controller_spec.rb
582
520
  - spec/controllers/sessions_controller_spec.rb
583
521
  - spec/controllers/two_factor_authenticators_controller_spec.rb
@@ -608,7 +546,14 @@ test_files:
608
546
  - spec/dummy/config/locales/en.yml
609
547
  - spec/dummy/config/routes.rb
610
548
  - spec/dummy/db/.gitkeep
611
- - spec/dummy/db/migrate/20130910094259_create_base_models.casino.rb
549
+ - spec/dummy/db/migrate/20140831214845_create_core_schema.casino.rb
550
+ - spec/dummy/db/migrate/20140831214846_rename_base_models.casino.rb
551
+ - spec/dummy/db/migrate/20140831214847_cleanup_indexes.casino.rb
552
+ - spec/dummy/db/migrate/20140831214848_fix_long_index_names.casino.rb
553
+ - spec/dummy/db/migrate/20140831214849_change_service_to_text.casino.rb
554
+ - spec/dummy/db/migrate/20140831214850_change_user_agent_to_text.casino.rb
555
+ - spec/dummy/db/migrate/20140831214851_fix_length_of_text_fields.casino.rb
556
+ - spec/dummy/db/migrate/20140831214852_create_auth_token_tickets.casino.rb
612
557
  - spec/dummy/db/schema.rb
613
558
  - spec/dummy/lib/assets/.gitkeep
614
559
  - spec/dummy/log/.gitkeep
@@ -621,6 +566,7 @@ test_files:
621
566
  - spec/features/logout_spec.rb
622
567
  - spec/features/session_overview_spec.rb
623
568
  - spec/features/two_factor_authenticator_spec.rb
569
+ - spec/model/auth_token_ticket_spec.rb
624
570
  - spec/model/login_ticket_spec.rb
625
571
  - spec/model/proxy_ticket_spec.rb
626
572
  - spec/model/service_rule_spec.rb
@@ -628,25 +574,7 @@ test_files:
628
574
  - spec/model/service_ticket_spec.rb
629
575
  - spec/model/ticket_granting_ticket_spec.rb
630
576
  - spec/model/two_factor_authenticator_spec.rb
631
- - spec/processor/api/login_credential_acceptor_spec.rb
632
- - spec/processor/api/logout_spec.rb
633
- - spec/processor/api/service_ticket_provider_spec.rb
634
- - spec/processor/legacy_validator_spec.rb
635
- - spec/processor/login_credential_acceptor_spec.rb
636
- - spec/processor/login_credential_requestor_spec.rb
637
- - spec/processor/logout_other_sessions_spec.rb
638
- - spec/processor/logout_spec.rb
639
- - spec/processor/processor_concern/service_tickets_spec.rb
640
- - spec/processor/proxy_ticket_provider_spec.rb
641
- - spec/processor/proxy_ticket_validator_spec.rb
642
- - spec/processor/second_factor_authenticaton_acceptor_spec.rb
643
- - spec/processor/session_destroyer_spec.rb
644
- - spec/processor/session_overview_spec.rb
645
- - spec/processor/ticket_validator_spec.rb
646
- - spec/processor/two_factor_authenticator_activator_spec.rb
647
- - spec/processor/two_factor_authenticator_destroyer_spec.rb
648
- - spec/processor/two_factor_authenticator_overview_spec.rb
649
- - spec/processor/two_factor_authenticator_registrator_spec.rb
577
+ - spec/services/auth_token_validation_service_spec.rb
650
578
  - spec/spec_helper.rb
651
579
  - spec/support/.gitkeep
652
580
  - spec/support/casino.rb
@@ -660,4 +588,5 @@ test_files:
660
588
  - spec/support/factories/user_factory.rb
661
589
  - spec/support/features_helper.rb
662
590
  - spec/support/rspec.rb
591
+ - spec/support/sign_in.rb
663
592
  - spec/support/sqlite3.rb