File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,19 @@ module RubySaml
1111 # SAML2 Message
1212 class SamlMessage
1313
14- # @return [Nokogiri::XML::Schema] Gets the schema object of the SAML 2.0 Protocol schema
15- #
14+ # @return [Nokogiri::XML::Schema] The SAML 2.0 Protocol schema
1615 def self . schema
17- path = File . expand_path ( 'schemas/saml-schema-protocol-2.0.xsd' , __dir__ )
18- File . open ( path ) do |file |
16+ @schema ||= File . open ( File . expand_path ( 'schemas/saml-schema-protocol-2.0.xsd' , __dir__ ) ) do |file |
1917 ::Nokogiri ::XML ::Schema ( file )
2018 end
2119 end
2220
2321 # @return [String|nil] Gets the Version attribute from the SAML Message if exists.
24- #
2522 def version ( document )
2623 @version ||= root_attribute ( document , 'Version' )
2724 end
2825
2926 # @return [String|nil] Gets the ID attribute from the SAML Message if exists.
30- #
3127 def id ( document )
3228 @id ||= root_attribute ( document , 'ID' )
3329 end
@@ -55,7 +51,6 @@ def root_attribute(document, attribute)
5551 # @param check_malformed_doc [Boolean] check_malformed_doc Enable or Disable the check for malformed XML
5652 # @return [Boolean] True if the XML is valid, otherwise False, if soft=True
5753 # @raise [ValidationError] if soft == false and validation fails
58- #
5954 def valid_saml? ( document , soft = true , check_malformed_doc : true )
6055 begin
6156 xml = RubySaml ::XML . safe_load_nokogiri ( document , check_malformed_doc : check_malformed_doc )
You can’t perform that action at this time.
0 commit comments