class CASClient::Tickets::Storage::AbstractTicketStore

Attributes

log[RW]

Public Instance Methods

cleanup_service_session_lookup(st) click to toggle source
# File lib/casclient/tickets/storage.rb, line 43
def cleanup_service_session_lookup(st)
  raise 'Implement this in a subclass!'
end
get_session_for_service_ticket(st) click to toggle source
# File lib/casclient/tickets/storage.rb, line 28
def get_session_for_service_ticket(st)
  session_id = read_service_session_lookup(st)
  unless session_id.nil?
    # This feels a bit hackish, but there isn't really a better way to go about it that I am aware of yet
    session = ActiveRecord::SessionStore.session_class.find_by_session_id(session_id)
  else
    log.warn("Couldn't destroy session service ticket #{st} because no corresponding session id could be found.")
  end
  [session_id, session]
end
process_single_sign_out(st) click to toggle source
# File lib/casclient/tickets/storage.rb, line 11
def process_single_sign_out(st)

  session_id, session = get_session_for_service_ticket(st)
  if session
    session.destroy
    log.debug("Destroyed #{session.inspect} for session #{session_id.inspect} corresponding to service ticket #{st.inspect}.")
  else
    log.debug("Data for session #{session_id.inspect} was not found. It may have already been cleared by a local CAS logout request.")
  end

  if session_id
    log.info("Single-sign-out for service ticket #{session_id.inspect} completed successfuly.")
  else
    log.debug("No session id found for CAS ticket #{st}")
  end
end
retrieve_pgt(pgt_iou) click to toggle source
# File lib/casclient/tickets/storage.rb, line 51
def retrieve_pgt(pgt_iou)
  raise 'Implement this in a subclass!'
end
save_pgt_iou(pgt_iou, pgt) click to toggle source
# File lib/casclient/tickets/storage.rb, line 47
def save_pgt_iou(pgt_iou, pgt)
  raise 'Implement this in a subclass!'
end
store_service_session_lookup(st, controller) click to toggle source
# File lib/casclient/tickets/storage.rb, line 39
def store_service_session_lookup(st, controller)
  raise 'Implement this in a subclass!'
end

Protected Instance Methods

read_service_session_lookup(st) click to toggle source
# File lib/casclient/tickets/storage.rb, line 56
def read_service_session_lookup(st)
  raise 'Implement this in a subclass!'
end
session_id_from_controller(controller) click to toggle source
# File lib/casclient/tickets/storage.rb, line 60
def session_id_from_controller(controller)
  session_id = controller.request.session_options[:id] || controller.session.session_id
  raise CASClient::CASException, "Failed to extract session_id from controller" if session_id.nil?
  session_id
end