casino_core 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/casino_core.gemspec +1 -1
- data/lib/casino_core/model/login_ticket.rb +4 -0
- data/lib/casino_core/processor/legacy_validator.rb +6 -0
- data/lib/casino_core/processor/login_credential_acceptor.rb +13 -0
- data/lib/casino_core/processor/login_credential_requestor.rb +10 -0
- data/lib/casino_core/processor/logout.rb +9 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/casino_core.gemspec
CHANGED
@@ -2,10 +2,16 @@ require 'casino_core/processor'
|
|
2
2
|
require 'casino_core/helper'
|
3
3
|
require 'casino_core/model'
|
4
4
|
|
5
|
+
# The LegacyValidator processor should be used for GET requests to /validate
|
5
6
|
class CASinoCore::Processor::LegacyValidator < CASinoCore::Processor
|
6
7
|
include CASinoCore::Helper::Logger
|
7
8
|
include CASinoCore::Helper::ServiceTickets
|
8
9
|
|
10
|
+
# This method will call `#validation_succeeded` or `#validation_failed`. In both cases, it supplies
|
11
|
+
# a string as argument. The webapplication should present that string (and nothing else) to the
|
12
|
+
# requestor.
|
13
|
+
#
|
14
|
+
# @param [Hash] params parameters supplied by requestor (a service)
|
9
15
|
def process(params = nil)
|
10
16
|
params ||= {}
|
11
17
|
ticket = CASinoCore::Model::ServiceTicket.where(ticket: params[:ticket]).first
|
@@ -1,11 +1,24 @@
|
|
1
1
|
require 'casino_core/processor'
|
2
2
|
require 'casino_core/helper'
|
3
3
|
|
4
|
+
# This processor should be used for POST requests to /login
|
4
5
|
class CASinoCore::Processor::LoginCredentialAcceptor < CASinoCore::Processor
|
5
6
|
include CASinoCore::Helper::Logger
|
6
7
|
include CASinoCore::Helper::LoginTickets
|
7
8
|
include CASinoCore::Helper::ServiceTickets
|
8
9
|
|
10
|
+
# Use this method to process the request. It expects the username in the parameter "username" and the password
|
11
|
+
# in "password".
|
12
|
+
#
|
13
|
+
# The method will call one of the following methods on the listener:
|
14
|
+
# * `#user_logged_in`: The first argument (String) is the URL (if any), the user should be redirected to.
|
15
|
+
# The second argument (String) is the ticket-granting ticket. It should be stored in a cookie named "tgt".
|
16
|
+
# * `#invalid_login_ticket` and `#invalid_login_credentials`: The first argument is a LoginTicket.
|
17
|
+
# See {CASinoCore::Processor::LoginCredentialRequestor} for details.
|
18
|
+
#
|
19
|
+
# @param [Hash] params parameters supplied by user
|
20
|
+
# @param [Hash] cookies cookies supplied by user
|
21
|
+
# @param [String] user_agent user-agent delivered by the client
|
9
22
|
def process(params = nil, cookies = nil, user_agent = nil)
|
10
23
|
params ||= {}
|
11
24
|
cookies ||= {}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'casino_core/processor'
|
2
2
|
require 'casino_core/helper'
|
3
3
|
|
4
|
+
# This processor should be used for GET requests to /login
|
4
5
|
class CASinoCore::Processor::LoginCredentialRequestor < CASinoCore::Processor
|
5
6
|
include CASinoCore::Helper::Browser
|
6
7
|
include CASinoCore::Helper::Logger
|
@@ -8,6 +9,15 @@ class CASinoCore::Processor::LoginCredentialRequestor < CASinoCore::Processor
|
|
8
9
|
include CASinoCore::Helper::ServiceTickets
|
9
10
|
include CASinoCore::Helper::TicketGrantingTickets
|
10
11
|
|
12
|
+
# Use this method to process the request.
|
13
|
+
#
|
14
|
+
# The method will call one of the following methods on the listener:
|
15
|
+
# * `#user_logged_in`: The first argument (String) is the URL (if any), the user should be redirected to.
|
16
|
+
# * `#user_not_logged_in`: The first argument is a LoginTicket. It should be stored in a hidden field with name "lt".
|
17
|
+
#
|
18
|
+
# @param [Hash] params parameters supplied by user
|
19
|
+
# @param [Hash] cookies cookies supplied by user
|
20
|
+
# @param [String] user_agent user-agent delivered by the client
|
11
21
|
def process(params = nil, cookies = nil, user_agent = nil)
|
12
22
|
params ||= {}
|
13
23
|
cookies ||= {}
|
@@ -2,9 +2,18 @@ require 'casino_core/processor'
|
|
2
2
|
require 'casino_core/helper'
|
3
3
|
require 'casino_core/model'
|
4
4
|
|
5
|
+
# The Logout processor should be used to process GET requests to /logout.
|
5
6
|
class CASinoCore::Processor::Logout < CASinoCore::Processor
|
6
7
|
include CASinoCore::Helper::TicketGrantingTickets
|
7
8
|
|
9
|
+
# This method will call `#user_logged_out` and may supply an URL that should be presented to the user.
|
10
|
+
# As per specification, the URL specified by "url" SHOULD be on the logout page with descriptive text.
|
11
|
+
# For example, "The application you just logged out of has provided a link it would like you to follow.
|
12
|
+
# Please click here to access http://www.go-back.edu/."
|
13
|
+
#
|
14
|
+
# @param [Hash] params parameters supplied by user
|
15
|
+
# @param [Hash] cookies cookies supplied by user
|
16
|
+
# @param [String] user_agent user-agent delivered by the client
|
8
17
|
def process(params = nil, cookies = nil, user_agent = nil)
|
9
18
|
params ||= {}
|
10
19
|
cookies ||= {}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: casino_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nils Caspar
|
@@ -219,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
219
219
|
requirements:
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
hash:
|
222
|
+
hash: -263623959609363885
|
223
223
|
segments:
|
224
224
|
- 0
|
225
225
|
version: "0"
|