Class: SignIn::AccessToken
- Inherits:
-
Object
- Object
- SignIn::AccessToken
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/sign_in/access_token.rb
Instance Attribute Summary collapse
-
#anti_csrf_token ⇒ Object
readonly
Returns the value of attribute anti_csrf_token.
-
#audience ⇒ Object
readonly
Returns the value of attribute audience.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#created_time ⇒ Object
readonly
Returns the value of attribute created_time.
-
#expiration_time ⇒ Object
readonly
Returns the value of attribute expiration_time.
-
#last_regeneration_time ⇒ Object
readonly
Returns the value of attribute last_regeneration_time.
-
#parent_refresh_token_hash ⇒ Object
readonly
Returns the value of attribute parent_refresh_token_hash.
-
#refresh_token_hash ⇒ Object
readonly
Returns the value of attribute refresh_token_hash.
-
#session_handle ⇒ Object
readonly
Returns the value of attribute session_handle.
-
#user_attributes ⇒ Object
readonly
Returns the value of attribute user_attributes.
-
#user_uuid ⇒ Object
readonly
Returns the value of attribute user_uuid.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(session_handle:, client_id:, user_uuid:, audience:, refresh_token_hash:, anti_csrf_token:, last_regeneration_time:, uuid: nil, parent_refresh_token_hash: nil, version: nil, expiration_time: nil, created_time: nil, user_attributes: nil) ⇒ AccessToken
constructor
rubocop:disable Metrics/ParameterLists.
-
#persisted? ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
- #to_s ⇒ Object
Constructor Details
#initialize(session_handle:, client_id:, user_uuid:, audience:, refresh_token_hash:, anti_csrf_token:, last_regeneration_time:, uuid: nil, parent_refresh_token_hash: nil, version: nil, expiration_time: nil, created_time: nil, user_attributes: nil) ⇒ AccessToken
rubocop:disable Metrics/ParameterLists
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/models/sign_in/access_token.rb', line 41 def initialize(session_handle:, client_id:, user_uuid:, audience:, refresh_token_hash:, anti_csrf_token:, last_regeneration_time:, uuid: nil, parent_refresh_token_hash: nil, version: nil, expiration_time: nil, created_time: nil, user_attributes: nil) @uuid = uuid || create_uuid @session_handle = session_handle @client_id = client_id @user_uuid = user_uuid @audience = audience @refresh_token_hash = refresh_token_hash @anti_csrf_token = anti_csrf_token @last_regeneration_time = last_regeneration_time @parent_refresh_token_hash = parent_refresh_token_hash @version = version || Constants::AccessToken::CURRENT_VERSION @expiration_time = expiration_time || set_expiration_time @created_time = created_time || set_created_time @user_attributes = filter_user_attributes(user_attributes:) validate! end |
Instance Attribute Details
#anti_csrf_token ⇒ Object (readonly)
Returns the value of attribute anti_csrf_token.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def anti_csrf_token @anti_csrf_token end |
#audience ⇒ Object (readonly)
Returns the value of attribute audience.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def audience @audience end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def client_id @client_id end |
#created_time ⇒ Object (readonly)
Returns the value of attribute created_time.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def created_time @created_time end |
#expiration_time ⇒ Object (readonly)
Returns the value of attribute expiration_time.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def expiration_time @expiration_time end |
#last_regeneration_time ⇒ Object (readonly)
Returns the value of attribute last_regeneration_time.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def last_regeneration_time @last_regeneration_time end |
#parent_refresh_token_hash ⇒ Object (readonly)
Returns the value of attribute parent_refresh_token_hash.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def parent_refresh_token_hash @parent_refresh_token_hash end |
#refresh_token_hash ⇒ Object (readonly)
Returns the value of attribute refresh_token_hash.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def refresh_token_hash @refresh_token_hash end |
#session_handle ⇒ Object (readonly)
Returns the value of attribute session_handle.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def session_handle @session_handle end |
#user_attributes ⇒ Object (readonly)
Returns the value of attribute user_attributes.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def user_attributes @user_attributes end |
#user_uuid ⇒ Object (readonly)
Returns the value of attribute user_uuid.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def user_uuid @user_uuid end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def uuid @uuid end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'app/models/sign_in/access_token.rb', line 7 def version @version end |
Instance Method Details
#persisted? ⇒ Boolean
rubocop:enable Metrics/ParameterLists
72 73 74 |
# File 'app/models/sign_in/access_token.rb', line 72 def persisted? false end |
#to_s ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'app/models/sign_in/access_token.rb', line 76 def to_s { uuid:, user_uuid:, session_handle:, client_id:, audience:, version:, last_regeneration_time: last_regeneration_time.to_i, created_time: created_time.to_i, expiration_time: expiration_time.to_i } end |