Class: RubyCAS::Server::Core::Tickets::ProxyGrantingTicket
- Defined in:
- lib/rubycas/server/memory/proxy_granting_ticket.rb
Instance Attribute Summary collapse
-
#client_hostname ⇒ Object
Returns the value of attribute client_hostname.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#iou ⇒ Object
Returns the value of attribute iou.
-
#proxy_tickets ⇒ Object
Returns the value of attribute proxy_tickets.
-
#service_ticket ⇒ Object
Returns the value of attribute service_ticket.
-
#ticket ⇒ Object
Returns the value of attribute ticket.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
- #expired?(max_lifetime = 100) ⇒ Boolean
-
#initialize(pgt = {}) ⇒ ProxyGrantingTicket
constructor
A new instance of ProxyGrantingTicket.
Methods inherited from Storage
Constructor Details
#initialize(pgt = {}) ⇒ ProxyGrantingTicket
Returns a new instance of ProxyGrantingTicket.
11 12 13 14 15 16 17 18 19 20 |
# 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 |
Instance Attribute Details
#client_hostname ⇒ Object
Returns the value of attribute client_hostname.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def client_hostname @client_hostname end |
#created_at ⇒ Object
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def id @id end |
#iou ⇒ Object
Returns the value of attribute iou.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def iou @iou end |
#proxy_tickets ⇒ Object
Returns the value of attribute proxy_tickets.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def proxy_tickets @proxy_tickets end |
#service_ticket ⇒ Object
Returns the value of attribute service_ticket.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def service_ticket @service_ticket end |
#ticket ⇒ Object
Returns the value of attribute ticket.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def ticket @ticket end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/rubycas/server/memory/proxy_granting_ticket.rb', line 7 def updated_at @updated_at end |
Class Method Details
.find_by_ticket(ticket) ⇒ Object
23 24 25 26 27 28 |
# 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 |
Instance Method Details
#expired?(max_lifetime = 100) ⇒ Boolean
30 31 32 33 |
# 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 |