Class: CASinoCore::Processor::ProxyTicketValidator

Inherits:
ServiceTicketValidator show all
Defined in:
lib/casino_core/processor/proxy_ticket_validator.rb

Overview

The ProxyTicketValidator processor should be used to handle GET requests to /proxyValidate

Constant Summary

Constants included from Helper::Tickets

Helper::Tickets::ALLOWED_TICKET_STRING_CHARACTERS

Constants included from Helper::ServiceTickets

Helper::ServiceTickets::RESERVED_CAS_PARAMETER_KEYS

Instance Method Summary collapse

Methods included from Helper::ProxyGrantingTickets

#acquire_proxy_granting_ticket

Methods included from Helper::Tickets

#random_ticket_string

Methods included from Helper::Logger

#logger

Methods included from Helper::ServiceTickets

#acquire_service_ticket, #clean_service_url

Methods included from Helper::ProxyTickets

#acquire_proxy_ticket, #ticket_valid_for_service?, #validate_ticket_for_service

Methods inherited from CASinoCore::Processor

#initialize

Constructor Details

This class inherits a constructor from CASinoCore::Processor

Instance Method Details

#process(params = nil) ⇒ Object

This method will call #validation_succeeded or #validation_failed. In both cases, it supplies a string as argument. The web application should present that string (and nothing else) to the requestor. The Content-Type should be set to ‘text/xml; charset=utf-8’

Parameters:

  • params (Hash) (defaults to: nil)

    parameters delivered by the client



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/casino_core/processor/proxy_ticket_validator.rb', line 14

def process(params = nil)
  params ||= {}
  if request_valid?(params)
    ticket = if params[:ticket].start_with?('PT-')
      CASinoCore::Model::ProxyTicket.where(ticket: params[:ticket]).first
    elsif params[:ticket].start_with?('ST-')
      CASinoCore::Model::ServiceTicket.where(ticket: params[:ticket]).first
    else
      nil
    end
    validate_ticket!(ticket, params)
  end
end