Skip to content

Commit 43410e5

Browse files
committed
Move Response's private method assertion_encrypted? to public
1 parent 5f9dcd9 commit 43410e5

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

lib/onelogin/ruby-saml/response.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,17 @@ def allowed_clock_drift
341341
return options[:allowed_clock_drift].to_f
342342
end
343343

344+
# Checks if the SAML Response contains or not an EncryptedAssertion element
345+
# @return [Boolean] True if the SAML Response contains an EncryptedAssertion element
346+
#
347+
def assertion_encrypted?
348+
! REXML::XPath.first(
349+
document,
350+
"(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)",
351+
{ "p" => PROTOCOL, "a" => ASSERTION }
352+
).nil?
353+
end
354+
344355
private
345356

346357
# Validates the SAML Response (calls several validation methods)
@@ -967,17 +978,6 @@ def decrypt_assertion_from_document(document_copy)
967978
XMLSecurity::SignedDocument.new(response_node.to_s)
968979
end
969980

970-
# Checks if the SAML Response contains or not an EncryptedAssertion element
971-
# @return [Boolean] True if the SAML Response contains an EncryptedAssertion element
972-
#
973-
def assertion_encrypted?
974-
! REXML::XPath.first(
975-
document,
976-
"(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)",
977-
{ "p" => PROTOCOL, "a" => ASSERTION }
978-
).nil?
979-
end
980-
981981
# Decrypts an EncryptedAssertion element
982982
# @param encrypted_assertion_node [REXML::Element] The EncryptedAssertion element
983983
# @return [REXML::Document] The decrypted EncryptedAssertion element

0 commit comments

Comments
 (0)