Class: Spid::Saml2::SamlParser

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/spid/saml2/saml_parser.rb

Overview

:nodoc:

Direct Known Subclasses

IdpLogoutRequest, LogoutResponse, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#certificate_from_encoded_der, #decode, #decode_and_inflate, #deflate, #deflate_and_encode, #encode, #escaped_params, #escaped_query_string, #inflate, #query_param, #query_params, #query_string

Constructor Details

#initialize(saml_message:) ⇒ SamlParser

Returns a new instance of SamlParser.



13
14
15
16
# File 'lib/spid/saml2/saml_parser.rb', line 13

def initialize(saml_message:)
  @saml_message = saml_message
  @document = REXML::Document.new(@saml_message)
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



11
12
13
# File 'lib/spid/saml2/saml_parser.rb', line 11

def document
  @document
end

#saml_messageObject (readonly)

Returns the value of attribute saml_message.



10
11
12
# File 'lib/spid/saml2/saml_parser.rb', line 10

def saml_message
  @saml_message
end

Instance Method Details

#element_from_xpath(xpath) ⇒ Object



18
19
20
# File 'lib/spid/saml2/saml_parser.rb', line 18

def element_from_xpath(xpath)
  document.elements[xpath]&.value&.strip
end