This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install CASino into the dummy test application
- Loading branch information
Showing
29 changed files
with
292 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
language: ruby | ||
before_script: | ||
- "cd spec/dummy && RAILS_ENV=test rake casino_core:db:schema:load && cd ../.." | ||
- "bundle exec rake" | ||
rvm: | ||
- 1.9.3 | ||
- 2.0.0 |
13 changes: 13 additions & 0 deletions
13
spec/dummy/app/assets/stylesheets/casino_and_overrides.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
// Default CASino settings | ||
|
||
// $buttonColor: #0074ad; | ||
// $buttonSecondaryColor: #c2c2c2; | ||
// $linkColor: #0074ad; | ||
// $logo: "logo.png"; | ||
// $logoRetina: "[email protected]"; | ||
// $logoWidth: 146px; | ||
// $logoHeight: 34px; | ||
|
||
|
||
@import 'casino'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
Dummy::Application.routes.draw do | ||
mount CASino::Engine => '/', :as => 'casino' | ||
|
||
mount CASino::Engine => '/', :as => 'CASino' | ||
|
||
end |
12 changes: 12 additions & 0 deletions
12
spec/dummy/db/migrate/20130814091814_create_ticket_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This migration comes from casino (originally 20121112154930) | ||
class CreateTicketGrantingTickets < ActiveRecord::Migration | ||
def change | ||
create_table :ticket_granting_tickets do |t| | ||
t.string :ticket, null: false, unique: true | ||
t.string :username, null: false | ||
t.text :extra_attributes | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
spec/dummy/db/migrate/20130814091815_create_login_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This migration comes from casino (originally 20121112160009) | ||
class CreateLoginTickets < ActiveRecord::Migration | ||
def change | ||
create_table :login_tickets do |t| | ||
t.string :ticket | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
spec/dummy/db/migrate/20130814091816_ticket_should_not_be_null.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121112165804) | ||
class TicketShouldNotBeNull < ActiveRecord::Migration | ||
def change | ||
change_column :login_tickets, :ticket, :string, null: false, unique: true | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
spec/dummy/db/migrate/20130814091817_add_user_agent_to_ticket_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121122180310) | ||
class AddUserAgentToTicketGrantingTickets < ActiveRecord::Migration | ||
def change | ||
add_column :ticket_granting_tickets, :user_agent, :string | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
...mmy/db/migrate/20130814091818_add_index_for_username_to_ticket_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121124170004) | ||
class AddIndexForUsernameToTicketGrantingTickets < ActiveRecord::Migration | ||
def change | ||
add_index :ticket_granting_tickets, :username | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
spec/dummy/db/migrate/20130814091819_create_service_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This migration comes from casino (originally 20121124183542) | ||
class CreateServiceTickets < ActiveRecord::Migration | ||
def change | ||
create_table :service_tickets do |t| | ||
t.string :ticket, null: false, unique: true | ||
t.string :service, null: false | ||
t.integer :ticket_granting_ticket_id, null: false | ||
|
||
t.timestamps | ||
end | ||
add_index :service_tickets, :ticket | ||
add_index :service_tickets, :ticket_granting_ticket_id | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
spec/dummy/db/migrate/20130814091820_add_ticket_indexes.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This migration comes from casino (originally 20121124183732) | ||
class AddTicketIndexes < ActiveRecord::Migration | ||
def change | ||
add_index :ticket_granting_tickets, :ticket | ||
add_index :login_tickets, :ticket | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
spec/dummy/db/migrate/20130814091821_add_consumed_to_service_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121124195013) | ||
class AddConsumedToServiceTickets < ActiveRecord::Migration | ||
def change | ||
add_column :service_tickets, :consumed, :boolean, null: false, default: false | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
.../dummy/db/migrate/20130814091822_add_issued_from_credentials_to_service_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121125091934) | ||
class AddIssuedFromCredentialsToServiceTickets < ActiveRecord::Migration | ||
def change | ||
add_column :service_tickets, :issued_from_credentials, :boolean, null: false, default: false | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
spec/dummy/db/migrate/20130814091823_create_proxy_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This migration comes from casino (originally 20121125185415) | ||
class CreateProxyGrantingTickets < ActiveRecord::Migration | ||
def change | ||
create_table :proxy_granting_tickets do |t| | ||
t.string :ticket, null: false | ||
t.string :iou, null: false | ||
t.integer :ticket_granting_ticket_id, null: false | ||
|
||
t.timestamps | ||
end | ||
add_index :proxy_granting_tickets, :ticket, unique: true | ||
add_index :proxy_granting_tickets, :iou, unique: true | ||
add_index :proxy_granting_tickets, :ticket_granting_ticket_id | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
spec/dummy/db/migrate/20130814091824_tickets_should_be_unique.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This migration comes from casino (originally 20121125190013) | ||
class TicketsShouldBeUnique < ActiveRecord::Migration | ||
def change | ||
[:login_tickets, :service_tickets, :ticket_granting_tickets].each do |table| | ||
remove_index table, :ticket | ||
add_index table, :ticket, unique: true | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
...ummy/db/migrate/20130814091825_proxy_granting_tickets_belongs_to_service_ticket.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This migration comes from casino (originally 20121223135227) | ||
require 'casino_core/model' | ||
|
||
class ProxyGrantingTicketsBelongsToServiceTicket < ActiveRecord::Migration | ||
def change | ||
CASinoCore::Model::ProxyGrantingTicket.delete_all | ||
|
||
remove_index :proxy_granting_tickets, :ticket_granting_ticket_id | ||
remove_column :proxy_granting_tickets, :ticket_granting_ticket_id | ||
|
||
add_column :proxy_granting_tickets, :service_ticket_id, :integer | ||
change_column :proxy_granting_tickets, :service_ticket_id, :integer, null: false | ||
add_index :proxy_granting_tickets, :service_ticket_id | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
spec/dummy/db/migrate/20130814091826_create_proxy_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This migration comes from casino (originally 20121224113737) | ||
class CreateProxyTickets < ActiveRecord::Migration | ||
def change | ||
create_table :proxy_tickets do |t| | ||
t.string :ticket, null: false | ||
t.string :service, null: false | ||
t.boolean :consumed, null: false, default: false | ||
t.integer :proxy_granting_ticket_id, null: false | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :proxy_tickets, :ticket, unique: true | ||
add_index :proxy_tickets, :proxy_granting_ticket_id | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
spec/dummy/db/migrate/20130814091827_add_pgt_url_to_proxy_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This migration comes from casino (originally 20121225153637) | ||
class AddPgtUrlToProxyGrantingTickets < ActiveRecord::Migration | ||
def up | ||
add_column :proxy_granting_tickets, :pgt_url, :string, null: true | ||
CASinoCore::Model::ProxyGrantingTicket.delete_all | ||
change_column :proxy_granting_tickets, :pgt_url, :string, null: false | ||
end | ||
|
||
def down | ||
remove_column :proxy_granting_tickets, :pgt_url | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
.../db/migrate/20130814091828_proxy_granting_ticket_can_be_granted_by_proxy_ticket.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This migration comes from casino (originally 20121225231301) | ||
class ProxyGrantingTicketCanBeGrantedByProxyTicket < ActiveRecord::Migration | ||
def up | ||
add_column :proxy_granting_tickets, :granter_type, :string, null: false, default: 'ServiceTicket' | ||
rename_column :proxy_granting_tickets, :service_ticket_id, :granter_id | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
spec/dummy/db/migrate/20130814091829_no_default_granter_type.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121225231713) | ||
class NoDefaultGranterType < ActiveRecord::Migration | ||
def up | ||
change_column_default :proxy_granting_tickets, :granter_type, nil | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
.../dummy/db/migrate/20130814091830_fix_index_for_granter_on_proxy_granting_ticket.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This migration comes from casino (originally 20121226192211) | ||
class FixIndexForGranterOnProxyGrantingTicket < ActiveRecord::Migration | ||
def change | ||
remove_index :proxy_granting_tickets, :service_ticket_id | ||
add_index :proxy_granting_tickets, [:granter_type, :granter_id], unique: true | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
.../db/migrate/20130814091831_allow_service_tickets_without_ticket_granting_ticket.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20121226211511) | ||
class AllowServiceTicketsWithoutTicketGrantingTicket < ActiveRecord::Migration | ||
def change | ||
change_column :service_tickets, :ticket_granting_ticket_id, :integer, null: true | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
spec/dummy/db/migrate/20130814091832_add_authenticator_to_ticket_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This migration comes from casino (originally 20121231114141) | ||
class AddAuthenticatorToTicketGrantingTickets < ActiveRecord::Migration | ||
def up | ||
add_column :ticket_granting_tickets, :authenticator, :string, null: true | ||
CASinoCore::Model::TicketGrantingTicket.delete_all | ||
change_column :ticket_granting_tickets, :authenticator, :string, null: false | ||
add_index :ticket_granting_tickets, [:authenticator, :username] | ||
remove_index :ticket_granting_tickets, :username | ||
end | ||
|
||
def down | ||
remove_index :ticket_granting_tickets, [:authenticator, :username] | ||
remove_column :ticket_granting_tickets, :authenticator | ||
add_index :ticket_granting_tickets, :username | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
spec/dummy/db/migrate/20130814091833_create_service_rules.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This migration comes from casino (originally 20130105152327) | ||
class CreateServiceRules < ActiveRecord::Migration | ||
def change | ||
create_table :service_rules do |t| | ||
t.boolean :enabled, null: false, default: true | ||
t.integer :order, null: false, default: 10 | ||
t.string :name, null: false | ||
t.string :url, null: false | ||
t.boolean :regex, null: false, default: false | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :service_rules, :url, unique: true | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
spec/dummy/db/migrate/20130814091834_create_users.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This migration comes from casino (originally 20130202210100) | ||
class CreateUsers < ActiveRecord::Migration | ||
def up | ||
create_table :users do |t| | ||
t.string :authenticator, null: false | ||
t.string :username, null: false | ||
t.text :extra_attributes | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :users, [:authenticator, :username], unique: true | ||
|
||
remove_index :ticket_granting_tickets, [:authenticator, :username] | ||
add_column :ticket_granting_tickets, :user_id, :integer, null: true | ||
CASinoCore::Model::TicketGrantingTicket.reset_column_information | ||
CASinoCore::Model::TicketGrantingTicket.all.each do |ticket| | ||
user = CASinoCore::Model::User.where( | ||
authenticator: ticket.authenticator, | ||
username: ticket.username).first_or_initialize | ||
user.extra_attributes = ticket.extra_attributes | ||
user.save! | ||
ticket.user_id = user.id | ||
ticket.save! | ||
end | ||
change_column :ticket_granting_tickets, :user_id, :integer, null: false | ||
remove_columns :ticket_granting_tickets, :authenticator, :username, :extra_attributes | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
spec/dummy/db/migrate/20130814091835_create_two_factor_authenticators.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This migration comes from casino (originally 20130203100015) | ||
class CreateTwoFactorAuthenticators < ActiveRecord::Migration | ||
def change | ||
create_table :two_factor_authenticators do |t| | ||
t.integer :user_id, null: false | ||
t.string :secret, null: false | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :two_factor_authenticators, :user_id | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
spec/dummy/db/migrate/20130814091836_add_active_to_two_factor_authenticators.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20130203101351) | ||
class AddActiveToTwoFactorAuthenticators < ActiveRecord::Migration | ||
def change | ||
add_column :two_factor_authenticators, :active, :boolean, null: false, default: false | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
...0130814091837_add_awaiting_two_factor_authentication_to_ticket_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20130203155008) | ||
class AddAwaitingTwoFactorAuthenticationToTicketGrantingTickets < ActiveRecord::Migration | ||
def change | ||
add_column :ticket_granting_tickets, :awaiting_two_factor_authentication, :boolean, null: false, default: false | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
spec/dummy/db/migrate/20130814091838_add_long_term_to_ticket_granting_tickets.casino.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from casino (originally 20130323111208) | ||
class AddLongTermToTicketGrantingTickets < ActiveRecord::Migration | ||
def change | ||
add_column :ticket_granting_tickets, :long_term, :boolean, null: false, default: false | ||
end | ||
end |