Class: SignIn::StatePayload
- Inherits:
-
Object
- Object
- SignIn::StatePayload
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/sign_in/state_payload.rb
Instance Attribute Summary collapse
-
#acr ⇒ Object
readonly
Returns the value of attribute acr.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_state ⇒ Object
readonly
Returns the value of attribute client_state.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#code_challenge ⇒ Object
readonly
Returns the value of attribute code_challenge.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #confirm_client_id ⇒ Object private
-
#initialize(acr:, client_id:, type:, code:, scope: nil, code_challenge: nil, client_state: nil, created_at: nil) ⇒ StatePayload
constructor
rubocop:disable Metrics/ParameterLists.
-
#persisted? ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
Constructor Details
#initialize(acr:, client_id:, type:, code:, scope: nil, code_challenge: nil, client_state: nil, created_at: nil) ⇒ StatePayload
rubocop:disable Metrics/ParameterLists
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/sign_in/state_payload.rb', line 26 def initialize(acr:, client_id:, type:, code:, scope: nil, code_challenge: nil, client_state: nil, created_at: nil) @acr = acr @client_id = client_id @type = type @code_challenge = code_challenge @client_state = client_state @code = code @scope = scope @created_at = created_at || Time.zone.now.to_i validate! end |
Instance Attribute Details
#acr ⇒ Object (readonly)
Returns the value of attribute acr.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def acr @acr end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def client_id @client_id end |
#client_state ⇒ Object (readonly)
Returns the value of attribute client_state.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def client_state @client_state end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def code @code end |
#code_challenge ⇒ Object (readonly)
Returns the value of attribute code_challenge.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def code_challenge @code_challenge end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def created_at @created_at end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def scope @scope end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'app/models/sign_in/state_payload.rb', line 7 def type @type end |
Instance Method Details
#confirm_client_id ⇒ Object (private)
53 54 55 |
# File 'app/models/sign_in/state_payload.rb', line 53 def confirm_client_id errors.add(:base, 'Client id must map to a configuration') unless ClientConfig.valid_client_id?(client_id:) end |
#persisted? ⇒ Boolean
rubocop:enable Metrics/ParameterLists
47 48 49 |
# File 'app/models/sign_in/state_payload.rb', line 47 def persisted? false end |