Class: CASClient::Tickets::Storage::AbstractTicketStore

Inherits:
Object
  • Object
show all
Defined in:
lib/casclient/tickets/storage.rb

Direct Known Subclasses

ActiveRecordTicketStore, LocalDirTicketStore

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#logObject

Returns the value of attribute log.



6
7
8
# File 'lib/casclient/tickets/storage.rb', line 6

def log
  @log
end

Instance Method Details

#cleanup_service_session_lookup(st) ⇒ Object



40
41
42
# File 'lib/casclient/tickets/storage.rb', line 40

def cleanup_service_session_lookup(st)
  raise 'Implement this in a subclass!'
end

#get_session_for_service_ticket(st) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/casclient/tickets/storage.rb', line 26

def get_session_for_service_ticket(st)
  session_id = read_service_session_lookup(si)
  if session_id
    session = ActiveRecord::SessionStore::Session.find_by_session_id(session_id)
  else
    log.warn("Couldn't destroy session with SessionIndex #{si} because no corresponding session id could be looked up.")
  end
  [session_id, session]
end

#process_single_sign_out(si) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/casclient/tickets/storage.rb', line 9

def process_single_sign_out(si)

  session_id, session = get_session_for_service_ticket(si)
  if session
    session.destroy
    log.debug("Destroyed #{session.inspect} for session #{session_id.inspect} corresponding to service ticket #{si.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 #{si}")
  end
end

#retrieve_pgt(pgt_iou) ⇒ Object



48
49
50
# File 'lib/casclient/tickets/storage.rb', line 48

def retrieve_pgt(pgt_iou)
  raise 'Implement this in a subclass!'
end

#save_pgt_iou(pgt_iou, pgt) ⇒ Object



44
45
46
# File 'lib/casclient/tickets/storage.rb', line 44

def save_pgt_iou(pgt_iou, pgt)
  raise 'Implement this in a subclass!'
end

#store_service_session_lookup(st, controller) ⇒ Object



36
37
38
# File 'lib/casclient/tickets/storage.rb', line 36

def store_service_session_lookup(st, controller)
  raise 'Implement this in a subclass!'
end