Class: SignIn::TokenParamsValidator
- Inherits:
-
Object
- Object
- SignIn::TokenParamsValidator
- Includes:
- ActiveModel::Validations
- Defined in:
- app/services/sign_in/token_params_validator.rb
Instance Attribute Summary collapse
-
#actor_token ⇒ Object
readonly
Returns the value of attribute actor_token.
-
#actor_token_type ⇒ Object
readonly
Returns the value of attribute actor_token_type.
-
#assertion ⇒ Object
readonly
Returns the value of attribute assertion.
-
#client_assertion ⇒ Object
readonly
Returns the value of attribute client_assertion.
-
#client_assertion_type ⇒ Object
readonly
Returns the value of attribute client_assertion_type.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#code_verifier ⇒ Object
readonly
Returns the value of attribute code_verifier.
-
#grant_type ⇒ Object
readonly
Returns the value of attribute grant_type.
-
#subject_token ⇒ Object
readonly
Returns the value of attribute subject_token.
-
#subject_token_type ⇒ Object
readonly
Returns the value of attribute subject_token_type.
Instance Method Summary collapse
- #authorization_code_grant? ⇒ Boolean private
- #client_assertion_type_present? ⇒ Boolean private
-
#initialize(params:) ⇒ TokenParamsValidator
constructor
A new instance of TokenParamsValidator.
- #jwt_bearer_grant? ⇒ Boolean private
- #log_error_and_raise(message) ⇒ Object private
- #perform ⇒ Object
- #token_exchange_grant? ⇒ Boolean private
Constructor Details
permalink #initialize(params:) ⇒ TokenParamsValidator
Returns a new instance of TokenParamsValidator.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/services/sign_in/token_params_validator.rb', line 40 def initialize(params:) @grant_type = params[:grant_type] @code = params[:code] @code_verifier = params[:code_verifier] @client_assertion = params[:client_assertion] @client_assertion_type = params[:client_assertion_type] @assertion = params[:assertion] @subject_token = params[:subject_token] @subject_token_type = params[:subject_token_type] @actor_token = params[:actor_token] @actor_token_type = params[:actor_token_type] @client_id = params[:client_id] end |
Instance Attribute Details
permalink #actor_token ⇒ Object (readonly)
Returns the value of attribute actor_token.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def actor_token @actor_token end |
permalink #actor_token_type ⇒ Object (readonly)
Returns the value of attribute actor_token_type.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def actor_token_type @actor_token_type end |
permalink #assertion ⇒ Object (readonly)
Returns the value of attribute assertion.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def assertion @assertion end |
permalink #client_assertion ⇒ Object (readonly)
Returns the value of attribute client_assertion.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def client_assertion @client_assertion end |
permalink #client_assertion_type ⇒ Object (readonly)
Returns the value of attribute client_assertion_type.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def client_assertion_type @client_assertion_type end |
permalink #client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def client_id @client_id end |
permalink #code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def code @code end |
permalink #code_verifier ⇒ Object (readonly)
Returns the value of attribute code_verifier.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def code_verifier @code_verifier end |
permalink #grant_type ⇒ Object (readonly)
Returns the value of attribute grant_type.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def grant_type @grant_type end |
permalink #subject_token ⇒ Object (readonly)
Returns the value of attribute subject_token.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def subject_token @subject_token end |
permalink #subject_token_type ⇒ Object (readonly)
Returns the value of attribute subject_token_type.
7 8 9 |
# File 'app/services/sign_in/token_params_validator.rb', line 7 def subject_token_type @subject_token_type end |
Instance Method Details
permalink #authorization_code_grant? ⇒ Boolean (private)
64 65 66 |
# File 'app/services/sign_in/token_params_validator.rb', line 64 def grant_type == Constants::Auth::AUTH_CODE_GRANT end |
permalink #client_assertion_type_present? ⇒ Boolean (private)
76 77 78 |
# File 'app/services/sign_in/token_params_validator.rb', line 76 def client_assertion_type_present? client_assertion_type.present? end |
permalink #jwt_bearer_grant? ⇒ Boolean (private)
68 69 70 |
# File 'app/services/sign_in/token_params_validator.rb', line 68 def jwt_bearer_grant? grant_type == Constants::Auth::JWT_BEARER_GRANT end |
permalink #log_error_and_raise(message) ⇒ Object (private)
80 81 82 83 |
# File 'app/services/sign_in/token_params_validator.rb', line 80 def log_error_and_raise() Rails.logger.error('[SignIn][TokenParamsValidator] error', { errors: }) raise Errors::MalformedParamsError.new(message:) end |
permalink #perform ⇒ Object
[View source] [View on GitHub]
54 55 56 57 58 59 60 |
# File 'app/services/sign_in/token_params_validator.rb', line 54 def perform validate! rescue ActiveModel::ValidationError => e log_error_and_raise(e.model.errors..to_sentence) rescue => e log_error_and_raise(e.) end |
permalink #token_exchange_grant? ⇒ Boolean (private)
72 73 74 |
# File 'app/services/sign_in/token_params_validator.rb', line 72 def token_exchange_grant? grant_type == Constants::Auth::TOKEN_EXCHANGE_GRANT end |