Class: Saml::Kit::Response

Inherits:
Document show all
Extended by:
Forwardable
Includes:
Respondable
Defined in:
lib/saml/kit/response.rb

Overview

Constant Summary

Constants inherited from Document

Document::NAMESPACES, Document::PROTOCOL_XSD, Document::XPATH

Instance Attribute Summary

Attributes included from Respondable

#request_id

Instance Method Summary collapse

Methods included from Respondable

#in_response_to, #status_code, #success?

Methods inherited from Document

#destination, #id, #issue_instant, #issuer, #to_h, #to_s, to_saml_document, #to_xhtml, #to_xml, #version

Methods included from Trustable

#signed?, #trusted?

Constructor Details

#initialize(xml, request_id: nil, configuration: Saml::Kit.configuration) ⇒ Response

Returns a new instance of Response.



13
14
15
16
# File 'lib/saml/kit/response.rb', line 13

def initialize(xml, request_id: nil, configuration: Saml::Kit.configuration)
  @request_id = request_id
  super(xml, name: 'Response', configuration: configuration)
end

Instance Method Details

#assertion(private_keys = configuration.private_keys(use: :encryption)) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/saml/kit/response.rb', line 18

def assertion(private_keys = configuration.private_keys(use: :encryption))
  @assertion ||=
    begin
      node = assertion_nodes.last
      if node.nil?
        Saml::Kit::NullAssertion.new
      else
        Saml::Kit::Assertion.new(node, configuration: @configuration, private_keys: private_keys)
      end
    end
end