Class: CASino::API::ServiceTicketProviderProcessor

Inherits:
Processor
  • Object
show all
Includes:
ProcessorConcern::ServiceTickets, ProcessorConcern::TicketGrantingTickets
Defined in:
app/processors/casino/api/service_ticket_provider_processor.rb

Overview

The ServiceTicketProvider processor should be used to handle API calls: POST requests to /cas/v1/tickets/<ticket_granting_ticket>

Constant Summary

Constants included from ProcessorConcern::ServiceTickets

ProcessorConcern::ServiceTickets::RESERVED_CAS_PARAMETER_KEYS

Constants included from ProcessorConcern::Tickets

ProcessorConcern::Tickets::ALLOWED_TICKET_STRING_CHARACTERS

Instance Method Summary collapse

Methods included from ProcessorConcern::TicketGrantingTickets

#acquire_ticket_granting_ticket, #cleanup_expired_ticket_granting_tickets, #find_valid_ticket_granting_ticket, #load_or_initialize_user, #remove_ticket_granting_ticket

Methods included from ProcessorConcern::Browser

#browser_info, #same_browser?

Methods included from ProcessorConcern::ServiceTickets

#acquire_service_ticket, #clean_service_url

Methods included from ProcessorConcern::ProxyTickets

#acquire_proxy_ticket, #ticket_valid_for_service?, #validate_ticket_for_service

Methods included from ProcessorConcern::Tickets

#random_ticket_string

Methods inherited from Processor

#initialize

Constructor Details

This class inherits a constructor from CASino::Processor

Instance Method Details

#process(ticket_granting_ticket, parameters = nil, user_agent = nil) ⇒ Object

Use this method to process the request.

The method will call one of the following methods on the listener:

  • ‘#granted_service_ticket_via_api`: First and only argument is a String with the service ticket. The service ticket (and nothing else) should be displayed.

  • ‘#invalid_ticket_granting_ticket_via_api`: No argument. The application should respond with status “400 Bad Request”

  • ‘#no_service_provided_via_api`: No argument. The application should respond with status “400 Bad Request”

  • ‘#service_not_allowed_via_api`: The user tried to access a service that this CAS server is not allowed to serve.

Parameters:

  • ticket_granting_ticket (String)

    ticket_granting_ticket supplied by the user in the URL

  • parameters (Hash) (defaults to: nil)

    parameters supplied by user (‘service` in particular)

  • user_agent (String) (defaults to: nil)

    user-agent delivered by the client



18
19
20
21
22
23
24
25
26
# File 'app/processors/casino/api/service_ticket_provider_processor.rb', line 18

def process(ticket_granting_ticket, parameters = nil, user_agent = nil)
  parameters ||= {}
  @client_ticket_granting_ticket = ticket_granting_ticket
  @service_url = parameters[:service]
  @user_agent = user_agent

  fetch_valid_ticket_granting_ticket
  handle_ticket_granting_ticket
end