class RubyCAS::Server::Core::Tickets::ServiceTicket
Attributes
client_hostname[RW]
consumed[RW]
created_at[RW]
id[RW]
proxy_granting_ticket[RW]
service[R]
ticket[RW]
ticket_granting_ticket[RW]
updated_at[RW]
username[RW]
Public Class Methods
find_by_ticket(ticket)
click to toggle source
# File lib/rubycas/server/memory/service_ticket.rb, line 27 def self.find_by_ticket(ticket) @storage.each do |id,st| return st if st.ticket == ticket end return nil end
new(st = {})
click to toggle source
Calls superclass method
RubyCAS::Server::Core::Tickets::TicketGrantingTicket::new
# File lib/rubycas/server/memory/service_ticket.rb, line 12 def initialize(st = {}) @id = SecureRandom.uuid @ticket = st[:ticket] @service = st[:service] @consumed = st[:consumed] @client_hostname = st[:client_hostname] @username = st[:username] @created_at = DateTime.now @updated_at = DateTime.now @proxy_granting_ticket = st[:proxy_granting_ticket] @ticket_granting_ticket = st[:ticket_granting_ticket] super() end
Public Instance Methods
consume!()
click to toggle source
# File lib/rubycas/server/memory/service_ticket.rb, line 38 def consume! self.consumed = true self.save end
consumed?()
click to toggle source
# File lib/rubycas/server/memory/service_ticket.rb, line 34 def consumed? self.consumed end
expired?(max_lifetime = 100)
click to toggle source
# File lib/rubycas/server/memory/service_ticket.rb, line 43 def expired?(max_lifetime = 100) lifetime = Time.now.to_i - created_at.to_time.to_i lifetime > max_lifetime end
service=(url)
click to toggle source
# File lib/rubycas/server/memory/service_ticket.rb, line 48 def service=(url) @service = RubyCAS::Server::Core::Util.clean_service_url(url) end