Class: OpenidUser

Inherits:
User show all
Defined in:
app/models/openid_user.rb

Overview

Subclasses the ‘User` model in order to override the redis namespace and thereby partition user sessions for va.gov from openid client applications.

Constant Summary

Constants inherited from User

User::ID_CARD_ALLOWED_STATUSES

Constants inherited from Common::RedisStore

Common::RedisStore::REQ_CLASS_INSTANCE_VARS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from User

#account, #account_id, #account_uuid, #active_mhv_ids, #address, #all_emails, #birth_date, #birth_date_mpi, #can_access_id_card?, #can_access_user_profile?, #can_access_vet360?, #common_name, #credential_lock, #deceased_date, #destroy, #edipi, #edipi_mpi, #first_name, #first_name_mpi, #flipper_id, #full_name_normalized, #gender, #gender_mpi, #given_names, #home_phone, #icn, #in_progress_forms, #inherited_proof_verified, #invalidate_mpi_cache, #last_name, #last_name_mpi, #loa, #mhv_account_state, #mhv_account_type, #mhv_correlation_id, #mhv_ids, #middle_name, #middle_name_mpi, #military_information, #mpi_gcids, #mpi_profile?, #needs_accepted_terms_of_use, #normalized_suffix, #pciu_alternate_phone, #pciu_email, #pciu_primary_phone, #postal_code, #power_of_attorney, #recache, #relationships, #sec_id, #served_in_military?, #set_mhv_ids, #ssn, #ssn_mismatch?, #ssn_mpi, #ssn_normalized, #suffix, #user_account, #user_account_uuid, #user_verification, #user_verification_id, #va_patient?, #va_profile_email, #va_treatment_facility_ids, #vet360_contact_info, #veteran_status, #vha_facility_hash, #vha_facility_ids

Methods included from Authorization

#authorize

Methods inherited from Common::RedisStore

create, delete, #destroy, #destroyed?, exists?, #expire, 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

.build_from_identity(identity:, ttl:) ⇒ Object



14
15
16
17
18
# File 'app/models/openid_user.rb', line 14

def self.build_from_identity(identity:, ttl:)
  user = new(identity.attributes)
  user.expire(ttl)
  user
end

Instance Method Details

#identityObject



10
11
12
# File 'app/models/openid_user.rb', line 10

def identity
  @identity ||= OpenidUserIdentity.find(uuid)
end