Class: SignIn::RefreshToken
- Inherits:
-
Object
- Object
- SignIn::RefreshToken
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/sign_in/refresh_token.rb
Instance Attribute Summary collapse
-
#anti_csrf_token ⇒ Object
readonly
Returns the value of attribute anti_csrf_token.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#parent_refresh_token_hash ⇒ Object
readonly
Returns the value of attribute parent_refresh_token_hash.
-
#session_handle ⇒ Object
readonly
Returns the value of attribute session_handle.
-
#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
- #create_nonce ⇒ Object private
- #create_uuid ⇒ Object private
-
#initialize(session_handle:, user_uuid:, anti_csrf_token:, uuid: create_uuid, parent_refresh_token_hash: nil, nonce: create_nonce, version: Constants::RefreshToken::CURRENT_VERSION) ⇒ RefreshToken
constructor
rubocop:disable Metrics/ParameterLists.
-
#persisted? ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
- #to_s ⇒ Object
Constructor Details
#initialize(session_handle:, user_uuid:, anti_csrf_token:, uuid: create_uuid, parent_refresh_token_hash: nil, nonce: create_nonce, version: Constants::RefreshToken::CURRENT_VERSION) ⇒ RefreshToken
rubocop:disable Metrics/ParameterLists
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/models/sign_in/refresh_token.rb', line 13 def initialize(session_handle:, user_uuid:, anti_csrf_token:, uuid: create_uuid, parent_refresh_token_hash: nil, nonce: create_nonce, version: Constants::RefreshToken::CURRENT_VERSION) @user_uuid = user_uuid @uuid = uuid @session_handle = session_handle @parent_refresh_token_hash = parent_refresh_token_hash @anti_csrf_token = anti_csrf_token @nonce = nonce @version = version 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/refresh_token.rb', line 7 def anti_csrf_token @anti_csrf_token end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
7 8 9 |
# File 'app/models/sign_in/refresh_token.rb', line 7 def nonce @nonce end |
#parent_refresh_token_hash ⇒ Object (readonly)
Returns the value of attribute parent_refresh_token_hash.
7 8 9 |
# File 'app/models/sign_in/refresh_token.rb', line 7 def parent_refresh_token_hash @parent_refresh_token_hash end |
#session_handle ⇒ Object (readonly)
Returns the value of attribute session_handle.
7 8 9 |
# File 'app/models/sign_in/refresh_token.rb', line 7 def session_handle @session_handle end |
#user_uuid ⇒ Object (readonly)
Returns the value of attribute user_uuid.
7 8 9 |
# File 'app/models/sign_in/refresh_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/refresh_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/refresh_token.rb', line 7 def version @version end |
Instance Method Details
#create_nonce ⇒ Object (private)
51 52 53 |
# File 'app/models/sign_in/refresh_token.rb', line 51 def create_nonce SecureRandom.hex end |
#create_uuid ⇒ Object (private)
47 48 49 |
# File 'app/models/sign_in/refresh_token.rb', line 47 def create_uuid SecureRandom.uuid end |
#persisted? ⇒ Boolean
rubocop:enable Metrics/ParameterLists
32 33 34 |
# File 'app/models/sign_in/refresh_token.rb', line 32 def persisted? false end |
#to_s ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'app/models/sign_in/refresh_token.rb', line 36 def to_s { uuid:, user_uuid:, session_handle:, version: } end |