Class: RubyCAS::Server::Core::Tickets::TicketGrantingTicket
- Defined in:
- lib/rubycas/server/memory/ticket_granting_ticket.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client_hostname ⇒ Object
Returns the value of attribute client_hostname.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#extra_attributes ⇒ Object
Returns the value of attribute extra_attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#proxy_tickets ⇒ Object
Returns the value of attribute proxy_tickets.
-
#remember_me ⇒ Object
Returns the value of attribute remember_me.
-
#service_tickets ⇒ Object
Returns the value of attribute service_tickets.
-
#ticket ⇒ Object
Returns the value of attribute ticket.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
- #expired?(max_lifetime) ⇒ Boolean
-
#initialize(tgt = {}) ⇒ TicketGrantingTicket
constructor
A new instance of TicketGrantingTicket.
Methods inherited from Storage
Constructor Details
#initialize(tgt = {}) ⇒ TicketGrantingTicket
Returns a new instance of TicketGrantingTicket.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 10 def initialize(tgt = {}) @id = SecureRandom.uuid @ticket = tgt[:ticket] @client_hostname = tgt[:client_hostname] @username = tgt[:username] @extra_attributes = tgt[:extra_attributes] @service_tickets = tgt[:service_tickets] @proxy_tickets = tgt[:proxy_tickets] @remember_me = tgt[:remember_me] @created_at = DateTime.now @updated_at = DateTime.now super() end |
Instance Attribute Details
#client_hostname ⇒ Object
Returns the value of attribute client_hostname.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def client_hostname @client_hostname end |
#created_at ⇒ Object
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def created_at @created_at end |
#extra_attributes ⇒ Object
Returns the value of attribute extra_attributes.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def extra_attributes @extra_attributes end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def id @id end |
#proxy_tickets ⇒ Object
Returns the value of attribute proxy_tickets.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def proxy_tickets @proxy_tickets end |
#remember_me ⇒ Object
Returns the value of attribute remember_me.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def remember_me @remember_me end |
#service_tickets ⇒ Object
Returns the value of attribute service_tickets.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def service_tickets @service_tickets end |
#ticket ⇒ Object
Returns the value of attribute ticket.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def ticket @ticket end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def updated_at @updated_at end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 6 def username @username end |
Class Method Details
.find_by_ticket(ticket) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 24 def self.find_by_ticket(ticket) @storage.each do |id, tgt| return tgt if tgt.ticket == ticket end return nil end |
Instance Method Details
#expired?(max_lifetime) ⇒ Boolean
31 32 33 34 |
# File 'lib/rubycas/server/memory/ticket_granting_ticket.rb', line 31 def expired?(max_lifetime) lifetime = Time.now.to_i - created_at.to_time.to_i lifetime > max_lifetime end |