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



43
44
45
# 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) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# 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) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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) ⇒ Object



51
52
53
# 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) ⇒ Object



47
48
49
# 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) ⇒ Object



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

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