Class: HubSsoLib::SessionBase

Inherits:
Object
  • Object
show all
Defined in:
lib/hub_sso_lib.rb

Overview

A dumpable base class that can be used for undumpable proxies, where a change made in an object passed to a client is reflected on the server where the object actually lives; or for dumpable clones of sessions sent as read-only copies to clients which won’t disppear due to server side deletion from key rotation, expiry or admin-driven deletion.

Direct Known Subclasses

Session, SessionCopy

Constant Summary collapse

ATTRIBUTES =
%i{
  session_last_used
  session_flash
  session_user
  session_rotated_key
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(copying_session: nil) ⇒ SessionBase

Returns a new instance of SessionBase.



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/hub_sso_lib.rb', line 429

def initialize(copying_session: nil)
  if copying_session.nil?
    self.session_last_used   = Time.now.utc
    self.session_flash       = {}
    self.session_user        = HubSsoLib::User.new
    self.session_rotated_key = nil
  else
    ATTRIBUTES.each do | attr |
      self.send("#{attr}=", copying_session.send(attr))
    end
  end

rescue => e
  Sentry.capture_exception(e) if defined?(Sentry) && Sentry.respond_to?(:capture_exception)
  raise
end

Instance Attribute Details

#session_return_toObject (readonly)

DEPRECATED



427
428
429
# File 'lib/hub_sso_lib.rb', line 427

def session_return_to
  @session_return_to
end