Class: Spid::Saml2::LogoutResponseValidator
- Inherits:
-
Object
- Object
- Spid::Saml2::LogoutResponseValidator
- Defined in:
- lib/spid/saml2/logout_response_validator.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#request_uuid ⇒ Object
readonly
Returns the value of attribute request_uuid.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #call ⇒ Object
- #destination ⇒ Object
-
#initialize(response:, settings:, request_uuid:) ⇒ LogoutResponseValidator
constructor
A new instance of LogoutResponseValidator.
- #issuer ⇒ Object
- #matches_request_uuid ⇒ Object
Constructor Details
#initialize(response:, settings:, request_uuid:) ⇒ LogoutResponseValidator
Returns a new instance of LogoutResponseValidator.
11 12 13 14 15 16 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 11 def initialize(response:, settings:, request_uuid:) @response = response @settings = settings @request_uuid = request_uuid @errors = {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
9 10 11 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 9 def errors @errors end |
#request_uuid ⇒ Object (readonly)
Returns the value of attribute request_uuid.
8 9 10 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 8 def request_uuid @request_uuid end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 6 def response @response end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
7 8 9 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 7 def settings @settings end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 18 def call [ matches_request_uuid, destination, issuer ].all? end |
#destination ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 34 def destination return true if response.destination == settings.sp_slo_service_url @errors["destination"] = begin "Response Destination is '#{response.destination}'" \ " but was expected '#{settings.sp_slo_service_url}'" end false end |
#issuer ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 45 def issuer return true if response.issuer == settings.idp_entity_id @errors["issuer"] = begin "Response Issuer is '#{response.issuer}'" \ " but was expected '#{settings.idp_entity_id}'" end false end |
#matches_request_uuid ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/spid/saml2/logout_response_validator.rb', line 26 def matches_request_uuid return true if response.in_response_to == request_uuid @errors["request_uuid_mismatch"] = "Request uuid not belongs to current session" false end |