Class: Session

Inherits:
Common::RedisStore show all
Includes:
SentryLogging
Defined in:
app/models/session.rb

Direct Known Subclasses

IAMSession

Constant Summary collapse

DEFAULT_TOKEN_LENGTH =
40
MAX_SESSION_LIFETIME =
12.hours

Constants inherited from Common::RedisStore

Common::RedisStore::REQ_CLASS_INSTANCE_VARS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Methods inherited from Common::RedisStore

create, delete, #destroy, #destroyed?, exists?, find, find_or_build, #initialize, #initialize_dup, keys, #persisted?, pop, redis_key, redis_store, redis_ttl, #save, #save!, #ttl, #update, #update!

Constructor Details

This class inherits a constructor from Common::RedisStore

Class Method Details

.obscure_token(token) ⇒ Object



32
33
34
# File 'app/models/session.rb', line 32

def self.obscure_token(token)
  Digest::SHA256.hexdigest(token)[0..20]
end

Instance Method Details

#authenticated_by_ssoeObject



46
47
48
# File 'app/models/session.rb', line 46

def authenticated_by_ssoe
  @ssoe_transactionid.present?
end

#expire(ttl) ⇒ Object



36
37
38
39
40
# File 'app/models/session.rb', line 36

def expire(ttl)
  return false if invalid?

  super(ttl)
end

#ttl_in_timeObject



42
43
44
# File 'app/models/session.rb', line 42

def ttl_in_time
  Time.current.utc + ttl
end