class RubyCAS::Server::Core::Tickets::ProxyGrantingTicket

Attributes

client_hostname[RW]
created_at[RW]
id[RW]
iou[RW]
proxy_tickets[RW]
service_ticket[RW]
ticket[RW]
updated_at[RW]

Public Class Methods

find_by_ticket(ticket) click to toggle source
# File lib/rubycas/server/memory/proxy_granting_ticket.rb, line 23
def self.find_by_ticket(ticket)
  @storage.each do |id,pgt|
    return pgt if pgt.ticket == ticket
  end
  return nil
end
new(pgt = {}) click to toggle source
Calls superclass method
# File lib/rubycas/server/memory/proxy_granting_ticket.rb, line 11
def initialize(pgt = {})
  @id = SecureRandom.uuid
  @ticket = pgt[:ticket]
  @client_hostname = pgt[:client_hostname]
  @created_at = DateTime.now
  @updated_at = DateTime.now
  @service_ticket = pgt[:service_ticket]
  @proxy_tickets = pgt[:proxy_tickets]
  super()
end

Public Instance Methods

expired?(max_lifetime = 100) click to toggle source
# File lib/rubycas/server/memory/proxy_granting_ticket.rb, line 30
def expired?(max_lifetime = 100)
  lifetime = Time.now.to_i - created_at.to_time.to_i
  lifetime > max_lifetime
end