casino_core 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/UPGRADE.md +7 -1
- data/casino-public_cert.pem +19 -0
- data/casino_core.gemspec +3 -0
- data/db/migrate/20130202210100_create_users.rb +34 -0
- data/db/schema.rb +13 -6
- data/lib/casino_core/builder/ticket_validation_response.rb +4 -3
- data/lib/casino_core/helper/ticket_granting_tickets.rb +12 -4
- data/lib/casino_core/model/ticket_granting_ticket.rb +4 -3
- data/lib/casino_core/model/user.rb +8 -0
- data/lib/casino_core/model.rb +1 -0
- data/lib/casino_core/processor/legacy_validator.rb +1 -1
- data/lib/casino_core/processor/session_overview.rb +1 -4
- data/lib/casino_core/version.rb +1 -1
- data/spec/model/ticket_granting_ticket_spec.rb +3 -11
- data/spec/processor/legacy_validator_spec.rb +3 -2
- data/spec/processor/login_credential_acceptor_spec.rb +35 -1
- data/spec/processor/session_destroyer_spec.rb +4 -3
- data/spec/processor/session_overview_spec.rb +3 -2
- data/spec/support/factories/ticket_granting_ticket_factory.rb +1 -3
- data/spec/support/factories/user_factory.rb +11 -0
- data.tar.gz.sig +0 -0
- metadata +36 -4
- metadata.gz.sig +3 -0
data/Gemfile.lock
CHANGED
data/UPGRADE.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
Here is a list of backward-incompatible changes that were introduced.
|
4
4
|
|
5
|
+
## 1.2.0
|
6
|
+
|
7
|
+
API changes:
|
8
|
+
|
9
|
+
* We extracted user data into an entity. Because of this, attributes such as `username` are no longer accessible directly on a `ticket_granting_ticket`. Use `ticket_granting_ticket.user.username` instead.
|
10
|
+
|
5
11
|
## 1.1.0
|
6
12
|
|
7
13
|
API changes:
|
@@ -10,5 +16,5 @@ API changes:
|
|
10
16
|
|
11
17
|
New callbacks:
|
12
18
|
|
13
|
-
* `login_credential_requestor`
|
19
|
+
* `login_credential_requestor` and `login_credential_acceptor` call `#service_not_allowed` on the listener, when a service is not in the service whitelist.
|
14
20
|
* `api/service_ticket_provider` calls `#service_not_allowed_via_api` on the listener, when a service is not in the service whitelist.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDKjCCAhKgAwIBAgIBADANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDARpbmZv
|
3
|
+
MRUwEwYKCZImiZPyLGQBGRYFcmJjYXMxEzARBgoJkiaJk/IsZAEZFgNjb20wHhcN
|
4
|
+
MTMwMjAyMjIyNjI2WhcNMTQwMjAyMjIyNjI2WjA7MQ0wCwYDVQQDDARpbmZvMRUw
|
5
|
+
EwYKCZImiZPyLGQBGRYFcmJjYXMxEzARBgoJkiaJk/IsZAEZFgNjb20wggEiMA0G
|
6
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbdmNy4heNReG8LXB2nakrpArkqWvw
|
7
|
+
jVnxXMLS6T5qebfLWal1PRoPHzbhRGmA3uCYYYuVuXv6V1VmCtnM0mj3YgN6h61D
|
8
|
+
D+Wnh1KT8sUYhRB36MNtmierS1EcMyvRujXRLk6x06Abz9bJadyEW7DS4VkpCz9n
|
9
|
+
f9MEnHqIlyQBPP3zHsDyMrTrIBuvDWPr+aAMKqIXLjqWep1Ebd//ppNcSiVF87s+
|
10
|
+
e0JaFe7/1alxIPGOak/cGEvom42TLGdPKyu0Xjk2n/cWTAlBshFPOQS3hks6Rh8s
|
11
|
+
Vzwj0LQvU0rhXJWHNb6WujKjiwsvzSTlGydNwIENprJIAQJsaIX3RQInAgMBAAGj
|
12
|
+
OTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFKyL/UzGU8IZneOjr73XPCLZJ7QuMAsG
|
13
|
+
A1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAUK+fuki/gUhIlJqM24NCs/y3
|
14
|
+
SoqCGP0z+c5g+BMu3sc3xIN/mH+HYlPaEa6Wj4bwmSVgThaZ54OsmRyZIK1VoAym
|
15
|
+
T4zOqCwt0twT2az1P6XThVMEebLjZDbuQ/oQzU/fA6DYqjnfmYNtgp5qYX6CKNJz
|
16
|
+
w3YRKrK2X6qYYHcHI/KL5wc1DOn+UNU4efmP0VVd5UNfR40IBLNtxX96X9YTXOHE
|
17
|
+
wQsLi+Ljnz+UaORk1dxZlcXYGc34wFg1oURvu0G8/YyHUAmIU/WKrjr1bgcf1VRv
|
18
|
+
R4KD1MnUV/v502piMlXmjxOWdbK8yvQEHksu/zjbCjSu+M2kwFmWGsx5nx+Vdw==
|
19
|
+
-----END CERTIFICATE-----
|
data/casino_core.gemspec
CHANGED
@@ -17,6 +17,9 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ['lib']
|
19
19
|
|
20
|
+
s.signing_key = File.expand_path '~/.gem/casino-private_key.pem'
|
21
|
+
s.cert_chain = ['casino-public_cert.pem']
|
22
|
+
|
20
23
|
s.add_development_dependency 'rake', '~> 10.0'
|
21
24
|
s.add_development_dependency 'rspec', '~> 2.12'
|
22
25
|
s.add_development_dependency 'simplecov', '~> 0.7'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
tgt = CASinoCore::Model::TicketGrantingTicket.new
|
4
|
+
tgt.authenticator = 'foo'
|
5
|
+
tgt.username = 'bar'
|
6
|
+
tgt.ticket = 'TGT-bla'
|
7
|
+
tgt.save!
|
8
|
+
|
9
|
+
create_table :users do |t|
|
10
|
+
t.string :authenticator, null: false
|
11
|
+
t.string :username, null: false
|
12
|
+
t.text :extra_attributes
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
|
17
|
+
add_index :users, [:authenticator, :username], unique: true
|
18
|
+
|
19
|
+
remove_index :ticket_granting_tickets, [:authenticator, :username]
|
20
|
+
add_column :ticket_granting_tickets, :user_id, :integer, null: true
|
21
|
+
CASinoCore::Model::TicketGrantingTicket.reset_column_information
|
22
|
+
CASinoCore::Model::TicketGrantingTicket.all.each do |ticket|
|
23
|
+
user = CASinoCore::Model::User.where(
|
24
|
+
authenticator: ticket.authenticator,
|
25
|
+
username: ticket.username).first_or_initialize
|
26
|
+
user.extra_attributes = ticket.extra_attributes
|
27
|
+
user.save!
|
28
|
+
ticket.user_id = user.id
|
29
|
+
ticket.save!
|
30
|
+
end
|
31
|
+
change_column :ticket_granting_tickets, :user_id, :integer, null: false
|
32
|
+
remove_columns :ticket_granting_tickets, :authenticator, :username, :extra_attributes
|
33
|
+
end
|
34
|
+
end
|
data/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20130202210100) do
|
15
15
|
|
16
16
|
create_table "login_tickets", :force => true do |t|
|
17
17
|
t.string "ticket", :null => false
|
@@ -73,16 +73,23 @@ ActiveRecord::Schema.define(:version => 20130105152327) do
|
|
73
73
|
add_index "service_tickets", ["ticket_granting_ticket_id"], :name => "index_service_tickets_on_ticket_granting_ticket_id"
|
74
74
|
|
75
75
|
create_table "ticket_granting_tickets", :force => true do |t|
|
76
|
-
t.string "ticket",
|
76
|
+
t.string "ticket", :null => false
|
77
|
+
t.datetime "created_at", :null => false
|
78
|
+
t.datetime "updated_at", :null => false
|
79
|
+
t.string "user_agent"
|
80
|
+
t.integer "user_id", :null => false
|
81
|
+
end
|
82
|
+
|
83
|
+
add_index "ticket_granting_tickets", ["ticket"], :name => "index_ticket_granting_tickets_on_ticket", :unique => true
|
84
|
+
|
85
|
+
create_table "users", :force => true do |t|
|
86
|
+
t.string "authenticator", :null => false
|
77
87
|
t.string "username", :null => false
|
78
88
|
t.text "extra_attributes"
|
79
89
|
t.datetime "created_at", :null => false
|
80
90
|
t.datetime "updated_at", :null => false
|
81
|
-
t.string "user_agent"
|
82
|
-
t.string "authenticator", :null => false
|
83
91
|
end
|
84
92
|
|
85
|
-
add_index "
|
86
|
-
add_index "ticket_granting_tickets", ["ticket"], :name => "index_ticket_granting_tickets_on_ticket", :unique => true
|
93
|
+
add_index "users", ["authenticator", "username"], :name => "index_users_on_authenticator_and_username", :unique => true
|
87
94
|
|
88
95
|
end
|
@@ -45,11 +45,12 @@ class CASinoCore::Builder::TicketValidationResponse < CASinoCore::Builder
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def build_success_xml(service_response, ticket, ticket_granting_ticket, proxies)
|
48
|
+
user = ticket_granting_ticket.user
|
48
49
|
service_response.cas :authenticationSuccess do |authentication_success|
|
49
|
-
authentication_success.cas :user,
|
50
|
-
unless
|
50
|
+
authentication_success.cas :user, user.username
|
51
|
+
unless user.extra_attributes.blank?
|
51
52
|
authentication_success.cas :attributes do |attributes|
|
52
|
-
|
53
|
+
user.extra_attributes.each do |key, value|
|
53
54
|
serialize_extra_attribute(attributes, key, value)
|
54
55
|
end
|
55
56
|
end
|
@@ -12,6 +12,7 @@ module CASinoCore
|
|
12
12
|
unless ticket_granting_ticket.nil?
|
13
13
|
if same_browser?(ticket_granting_ticket.user_agent, user_agent)
|
14
14
|
ticket_granting_ticket.user_agent = user_agent
|
15
|
+
ticket_granting_ticket.touch
|
15
16
|
ticket_granting_ticket.save!
|
16
17
|
ticket_granting_ticket
|
17
18
|
else
|
@@ -23,15 +24,22 @@ module CASinoCore
|
|
23
24
|
|
24
25
|
def acquire_ticket_granting_ticket(authentication_result, user_agent = nil)
|
25
26
|
user_data = authentication_result[:user_data]
|
26
|
-
|
27
|
+
user = load_or_initialize_user(authentication_result[:authenticator], user_data[:username], user_data[:extra_attributes])
|
28
|
+
user.ticket_granting_tickets.create!({
|
27
29
|
ticket: random_ticket_string('TGC'),
|
28
|
-
authenticator: authentication_result[:authenticator],
|
29
|
-
username: user_data[:username],
|
30
|
-
extra_attributes: user_data[:extra_attributes],
|
31
30
|
user_agent: user_agent
|
32
31
|
})
|
33
32
|
end
|
34
33
|
|
34
|
+
def load_or_initialize_user(authenticator, username, extra_attributes)
|
35
|
+
user = CASinoCore::Model::User.where(
|
36
|
+
authenticator: authenticator,
|
37
|
+
username: username).first_or_initialize
|
38
|
+
user.extra_attributes = extra_attributes
|
39
|
+
user.save!
|
40
|
+
return user
|
41
|
+
end
|
42
|
+
|
35
43
|
def remove_ticket_granting_ticket(ticket_granting_ticket, user_agent = nil)
|
36
44
|
tgt = find_valid_ticket_granting_ticket(ticket_granting_ticket, user_agent)
|
37
45
|
unless tgt.nil?
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'casino_core/model'
|
2
2
|
|
3
3
|
class CASinoCore::Model::TicketGrantingTicket < ActiveRecord::Base
|
4
|
-
attr_accessible :ticket, :
|
5
|
-
serialize :extra_attributes, Hash
|
4
|
+
attr_accessible :ticket, :user_agent
|
6
5
|
validates :ticket, uniqueness: true
|
6
|
+
|
7
|
+
belongs_to :user
|
7
8
|
has_many :service_tickets
|
8
9
|
|
9
10
|
before_destroy :destroy_service_tickets
|
@@ -24,7 +25,7 @@ class CASinoCore::Model::TicketGrantingTicket < ActiveRecord::Base
|
|
24
25
|
if other_ticket.nil?
|
25
26
|
false
|
26
27
|
else
|
27
|
-
other_ticket.
|
28
|
+
other_ticket.user_id == self.user_id
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
data/lib/casino_core/model.rb
CHANGED
@@ -8,5 +8,6 @@ module CASinoCore
|
|
8
8
|
autoload :ProxyGrantingTicket, 'casino_core/model/proxy_granting_ticket.rb'
|
9
9
|
autoload :ProxyTicket, 'casino_core/model/proxy_ticket.rb'
|
10
10
|
autoload :TicketGrantingTicket, 'casino_core/model/ticket_granting_ticket.rb'
|
11
|
+
autoload :User, 'casino_core/model/user.rb'
|
11
12
|
end
|
12
13
|
end
|
@@ -16,7 +16,7 @@ class CASinoCore::Processor::LegacyValidator < CASinoCore::Processor
|
|
16
16
|
params ||= {}
|
17
17
|
ticket = CASinoCore::Model::ServiceTicket.where(ticket: params[:ticket]).first
|
18
18
|
if !params[:service].nil? && ticket_valid_for_service?(ticket, params[:service], !!params[:renew])
|
19
|
-
@listener.validation_succeeded("yes\n#{ticket.ticket_granting_ticket.username}\n")
|
19
|
+
@listener.validation_succeeded("yes\n#{ticket.ticket_granting_ticket.user.username}\n")
|
20
20
|
else
|
21
21
|
@listener.validation_failed("no\n\n")
|
22
22
|
end
|
@@ -18,10 +18,7 @@ class CASinoCore::Processor::SessionOverview < CASinoCore::Processor
|
|
18
18
|
if tgt.nil?
|
19
19
|
@listener.user_not_logged_in
|
20
20
|
else
|
21
|
-
ticket_granting_tickets =
|
22
|
-
username: tgt.username,
|
23
|
-
authenticator: tgt.authenticator
|
24
|
-
).order('updated_at DESC')
|
21
|
+
ticket_granting_tickets = tgt.user.ticket_granting_tickets
|
25
22
|
@listener.ticket_granting_tickets_found(ticket_granting_tickets)
|
26
23
|
end
|
27
24
|
end
|
data/lib/casino_core/version.rb
CHANGED
@@ -65,23 +65,15 @@ describe CASinoCore::Model::TicketGrantingTicket do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
context 'with a ticket from another user' do
|
68
|
-
let(:other_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket
|
68
|
+
let(:other_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
69
69
|
|
70
70
|
it 'should return false' do
|
71
71
|
ticket_granting_ticket.same_user?(other_ticket_granting_ticket).should == false
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
context 'with a ticket from
|
76
|
-
let(:other_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket,
|
77
|
-
|
78
|
-
it 'should return false' do
|
79
|
-
ticket_granting_ticket.same_user?(other_ticket_granting_ticket).should == false
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
context 'with a ticket from the same user and authenticator' do
|
84
|
-
let(:other_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
75
|
+
context 'with a ticket from the same user' do
|
76
|
+
let(:other_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket, user: ticket_granting_ticket.user }
|
85
77
|
|
86
78
|
it 'should return true' do
|
87
79
|
ticket_granting_ticket.same_user?(other_ticket_granting_ticket).should == true
|
@@ -6,6 +6,7 @@ describe CASinoCore::Processor::LegacyValidator do
|
|
6
6
|
let(:processor) { described_class.new(listener) }
|
7
7
|
let(:service_ticket) { FactoryGirl.create :service_ticket }
|
8
8
|
let(:parameters) { { service: service_ticket.service, ticket: service_ticket.ticket }}
|
9
|
+
let(:username) { service_ticket.ticket_granting_ticket.user.username }
|
9
10
|
|
10
11
|
before(:each) do
|
11
12
|
listener.stub(:validation_failed)
|
@@ -21,7 +22,7 @@ describe CASinoCore::Processor::LegacyValidator do
|
|
21
22
|
end
|
22
23
|
|
23
24
|
it 'calls the #validation_succeeded method on the listener' do
|
24
|
-
listener.should_receive(:validation_succeeded).with("yes\
|
25
|
+
listener.should_receive(:validation_succeeded).with("yes\n#{username}\n")
|
25
26
|
processor.process(parameters)
|
26
27
|
end
|
27
28
|
end
|
@@ -55,7 +56,7 @@ describe CASinoCore::Processor::LegacyValidator do
|
|
55
56
|
end
|
56
57
|
|
57
58
|
it 'calls the #validation_succeeded method on the listener' do
|
58
|
-
listener.should_receive(:validation_succeeded).with("yes\
|
59
|
+
listener.should_receive(:validation_succeeded).with("yes\n#{username}\n")
|
59
60
|
processor.process(parameters_with_renew)
|
60
61
|
end
|
61
62
|
end
|
@@ -33,7 +33,9 @@ describe CASinoCore::Processor::LoginCredentialAcceptor do
|
|
33
33
|
|
34
34
|
context 'with valid credentials' do
|
35
35
|
let(:service) { 'https://www.example.org' }
|
36
|
-
let(:
|
36
|
+
let(:username) { 'testuser' }
|
37
|
+
let(:authenticator) { 'static_1' }
|
38
|
+
let(:login_data) { { lt: login_ticket.ticket, username: username, password: 'foobar123', service: service } }
|
37
39
|
|
38
40
|
before(:each) do
|
39
41
|
listener.stub(:user_logged_in)
|
@@ -77,6 +79,38 @@ describe CASinoCore::Processor::LoginCredentialAcceptor do
|
|
77
79
|
processor.process(login_data)
|
78
80
|
end.should change(CASinoCore::Model::TicketGrantingTicket, :count).by(1)
|
79
81
|
end
|
82
|
+
|
83
|
+
context 'when the user does not exist yet' do
|
84
|
+
it 'generates exactly one user' do
|
85
|
+
lambda do
|
86
|
+
processor.process(login_data)
|
87
|
+
end.should change(CASinoCore::Model::User, :count).by(1)
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'sets the users attributes' do
|
91
|
+
processor.process(login_data)
|
92
|
+
user = CASinoCore::Model::User.last
|
93
|
+
user.username.should == username
|
94
|
+
user.authenticator.should == 'static_1'
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
context 'when the user already exists' do
|
99
|
+
it 'does not regenerate the user' do
|
100
|
+
CASinoCore::Model::User.create! username: username, authenticator: authenticator
|
101
|
+
lambda do
|
102
|
+
processor.process(login_data)
|
103
|
+
end.should_not change(CASinoCore::Model::User, :count)
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'updates the extra attributes' do
|
107
|
+
user = CASinoCore::Model::User.create! username: username, authenticator: authenticator
|
108
|
+
lambda do
|
109
|
+
processor.process(login_data)
|
110
|
+
user.reload
|
111
|
+
end.should change(user, :extra_attributes)
|
112
|
+
end
|
113
|
+
end
|
80
114
|
end
|
81
115
|
|
82
116
|
context 'with a service' do
|
@@ -5,6 +5,7 @@ describe CASinoCore::Processor::SessionDestroyer do
|
|
5
5
|
let(:listener) { Object.new }
|
6
6
|
let(:processor) { described_class.new(listener) }
|
7
7
|
let(:owner_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
8
|
+
let(:user) { owner_ticket_granting_ticket.user }
|
8
9
|
let(:user_agent) { owner_ticket_granting_ticket.user_agent }
|
9
10
|
let(:cookies) { { tgt: owner_ticket_granting_ticket.ticket } }
|
10
11
|
|
@@ -14,12 +15,12 @@ describe CASinoCore::Processor::SessionDestroyer do
|
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with an existing ticket-granting ticket' do
|
17
|
-
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
18
|
+
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket, user: user }
|
18
19
|
let(:service_ticket) { FactoryGirl.create :service_ticket, ticket_granting_ticket: ticket_granting_ticket }
|
19
20
|
let(:consumed_service_ticket) { FactoryGirl.create :service_ticket, :consumed, ticket_granting_ticket: ticket_granting_ticket }
|
20
21
|
let(:params) { { id: ticket_granting_ticket.id } }
|
21
22
|
|
22
|
-
it 'deletes
|
23
|
+
it 'deletes exactly one ticket-granting ticket' do
|
23
24
|
ticket_granting_ticket
|
24
25
|
owner_ticket_granting_ticket
|
25
26
|
lambda do
|
@@ -54,7 +55,7 @@ describe CASinoCore::Processor::SessionDestroyer do
|
|
54
55
|
end
|
55
56
|
|
56
57
|
context 'when trying to delete ticket-granting ticket of another user' do
|
57
|
-
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket
|
58
|
+
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
58
59
|
let(:params) { { id: ticket_granting_ticket.id } }
|
59
60
|
|
60
61
|
it 'does not delete a ticket-granting ticket' do
|
@@ -5,6 +5,7 @@ describe CASinoCore::Processor::SessionOverview do
|
|
5
5
|
let(:listener) { Object.new }
|
6
6
|
let(:processor) { described_class.new(listener) }
|
7
7
|
let(:other_ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
8
|
+
let(:user) { other_ticket_granting_ticket.user }
|
8
9
|
let(:user_agent) { other_ticket_granting_ticket.user_agent }
|
9
10
|
let(:cookies) { { tgt: tgt } }
|
10
11
|
|
@@ -15,7 +16,7 @@ describe CASinoCore::Processor::SessionOverview do
|
|
15
16
|
end
|
16
17
|
|
17
18
|
context 'with an existing ticket-granting ticket' do
|
18
|
-
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
19
|
+
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket, user: user }
|
19
20
|
let(:tgt) { ticket_granting_ticket.ticket }
|
20
21
|
it 'calls the #ticket_granting_tickets_found method on the listener' do
|
21
22
|
listener.should_receive(:ticket_granting_tickets_found) do |tickets|
|
@@ -26,7 +27,7 @@ describe CASinoCore::Processor::SessionOverview do
|
|
26
27
|
end
|
27
28
|
|
28
29
|
context 'with a ticket-granting ticket with same username but different authenticator' do
|
29
|
-
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket
|
30
|
+
let(:ticket_granting_ticket) { FactoryGirl.create :ticket_granting_ticket }
|
30
31
|
let(:tgt) { ticket_granting_ticket.ticket }
|
31
32
|
|
32
33
|
it 'calls the #ticket_granting_tickets_found method on the listener' do
|
@@ -2,12 +2,10 @@ require 'factory_girl'
|
|
2
2
|
|
3
3
|
FactoryGirl.define do
|
4
4
|
factory :ticket_granting_ticket, class: CASinoCore::Model::TicketGrantingTicket do
|
5
|
+
user
|
5
6
|
sequence :ticket do |n|
|
6
7
|
"TGC-ticket#{n}"
|
7
8
|
end
|
8
|
-
authenticator 'test'
|
9
|
-
username 'test'
|
10
|
-
extra_attributes({ fullname: "Test User", age: 15, roles: [:user] })
|
11
9
|
user_agent 'TestBrowser 1.0'
|
12
10
|
end
|
13
11
|
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: casino_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nils Caspar
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
|
-
cert_chain:
|
11
|
+
cert_chain:
|
12
|
+
- !binary |-
|
13
|
+
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLakNDQWhLZ0F3SUJB
|
14
|
+
Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE3TVEwd0N3WURWUVFEREFScGJt
|
15
|
+
WnYKTVJVd0V3WUtDWkltaVpQeUxHUUJHUllGY21KallYTXhFekFSQmdvSmtp
|
16
|
+
YUprL0lzWkFFWkZnTmpiMjB3SGhjTgpNVE13TWpBeU1qSXlOakkyV2hjTk1U
|
17
|
+
UXdNakF5TWpJeU5qSTJXakE3TVEwd0N3WURWUVFEREFScGJtWnZNUlV3CkV3
|
18
|
+
WUtDWkltaVpQeUxHUUJHUllGY21KallYTXhFekFSQmdvSmtpYUprL0lzWkFF
|
19
|
+
WkZnTmpiMjB3Z2dFaU1BMEcKQ1NxR1NJYjNEUUVCQVFVQUE0SUJEd0F3Z2dF
|
20
|
+
S0FvSUJBUURiZG1OeTRoZU5SZUc4TFhCMm5ha3JwQXJrcVd2dwpqVm54WE1M
|
21
|
+
UzZUNXFlYmZMV2FsMVBSb1BIemJoUkdtQTN1Q1lZWXVWdVh2NlYxVm1DdG5N
|
22
|
+
MG1qM1lnTjZoNjFECkQrV25oMUtUOHNVWWhSQjM2TU50bWllclMxRWNNeXZS
|
23
|
+
dWpYUkxrNngwNkFiejliSmFkeUVXN0RTNFZrcEN6OW4KZjlNRW5IcUlseVFC
|
24
|
+
UFAzekhzRHlNclRySUJ1dkRXUHIrYUFNS3FJWExqcVdlcDFFYmQvL3BwTmNT
|
25
|
+
aVZGODdzKwplMEphRmU3LzFhbHhJUEdPYWsvY0dFdm9tNDJUTEdkUEt5dTBY
|
26
|
+
amsybi9jV1RBbEJzaEZQT1FTM2hrczZSaDhzClZ6d2owTFF2VTByaFhKV0hO
|
27
|
+
YjZXdWpLaml3c3Z6U1RsR3lkTndJRU5wckpJQVFKc2FJWDNSUUluQWdNQkFB
|
28
|
+
R2oKT1RBM01Ba0dBMVVkRXdRQ01BQXdIUVlEVlIwT0JCWUVGS3lML1V6R1U4
|
29
|
+
SVpuZU9qcjczWFBDTFpKN1F1TUFzRwpBMVVkRHdRRUF3SUVzREFOQmdrcWhr
|
30
|
+
aUc5dzBCQVFVRkFBT0NBUUVBVUsrZnVraS9nVWhJbEpxTTI0TkNzL3kzClNv
|
31
|
+
cUNHUDB6K2M1ZytCTXUzc2MzeElOL21IK0hZbFBhRWE2V2o0YndtU1ZnVGhh
|
32
|
+
WjU0T3NtUnlaSUsxVm9BeW0KVDR6T3FDd3QwdHdUMmF6MVA2WFRoVk1FZWJM
|
33
|
+
alpEYnVRL29RelUvZkE2RFlxam5mbVlOdGdwNXFZWDZDS05Kegp3M1lSS3JL
|
34
|
+
Mlg2cVlZSGNISS9LTDV3YzFET24rVU5VNGVmbVAwVlZkNVVOZlI0MElCTE50
|
35
|
+
eFg5Nlg5WVRYT0hFCndRc0xpK0xqbnorVWFPUmsxZHhabGNYWUdjMzR3Rmcx
|
36
|
+
b1VSdnUwRzgvWXlIVUFtSVUvV0tyanIxYmdjZjFWUnYKUjRLRDFNblVWL3Y1
|
37
|
+
MDJwaU1sWG1qeE9XZGJLOHl2UUVIa3N1L3pqYkNqU3UrTTJrd0ZtV0dzeDVu
|
38
|
+
eCtWZHc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
12
39
|
date: 2013-02-02 00:00:00.000000000 Z
|
13
40
|
dependencies:
|
14
41
|
- !ruby/object:Gem::Dependency
|
@@ -239,6 +266,7 @@ files:
|
|
239
266
|
- Rakefile
|
240
267
|
- UPGRADE.md
|
241
268
|
- VERSION
|
269
|
+
- casino-public_cert.pem
|
242
270
|
- casino_core.gemspec
|
243
271
|
- config/cas.yml
|
244
272
|
- config/database.yml
|
@@ -262,6 +290,7 @@ files:
|
|
262
290
|
- db/migrate/20121226211511_allow_service_tickets_without_ticket_granting_ticket.rb
|
263
291
|
- db/migrate/20121231114141_add_authenticator_to_ticket_granting_tickets.rb
|
264
292
|
- db/migrate/20130105152327_create_service_rules.rb
|
293
|
+
- db/migrate/20130202210100_create_users.rb
|
265
294
|
- db/schema.rb
|
266
295
|
- lib/casino_core.rb
|
267
296
|
- lib/casino_core/authenticator.rb
|
@@ -286,6 +315,7 @@ files:
|
|
286
315
|
- lib/casino_core/model/service_ticket.rb
|
287
316
|
- lib/casino_core/model/service_ticket/single_sign_out_notifier.rb
|
288
317
|
- lib/casino_core/model/ticket_granting_ticket.rb
|
318
|
+
- lib/casino_core/model/user.rb
|
289
319
|
- lib/casino_core/processor.rb
|
290
320
|
- lib/casino_core/processor/api.rb
|
291
321
|
- lib/casino_core/processor/api/login_credential_acceptor.rb
|
@@ -335,6 +365,7 @@ files:
|
|
335
365
|
- spec/support/factories/service_rule_factory.rb
|
336
366
|
- spec/support/factories/service_ticket_factory.rb
|
337
367
|
- spec/support/factories/ticket_granting_ticket_factory.rb
|
368
|
+
- spec/support/factories/user_factory.rb
|
338
369
|
homepage: http://rbcas.org/
|
339
370
|
licenses:
|
340
371
|
- MIT
|
@@ -350,7 +381,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
350
381
|
version: '0'
|
351
382
|
segments:
|
352
383
|
- 0
|
353
|
-
hash:
|
384
|
+
hash: -2617767929690973862
|
354
385
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
355
386
|
none: false
|
356
387
|
requirements:
|
@@ -359,7 +390,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
390
|
version: '0'
|
360
391
|
segments:
|
361
392
|
- 0
|
362
|
-
hash:
|
393
|
+
hash: -2617767929690973862
|
363
394
|
requirements: []
|
364
395
|
rubyforge_project:
|
365
396
|
rubygems_version: 1.8.24
|
@@ -395,4 +426,5 @@ test_files:
|
|
395
426
|
- spec/support/factories/service_rule_factory.rb
|
396
427
|
- spec/support/factories/service_ticket_factory.rb
|
397
428
|
- spec/support/factories/ticket_granting_ticket_factory.rb
|
429
|
+
- spec/support/factories/user_factory.rb
|
398
430
|
has_rdoc:
|
metadata.gz.sig
ADDED