Module: Saml::Kit::Trustable

Extended by:
ActiveSupport::Concern
Included in:
Document
Defined in:
lib/saml/kit/concerns/trustable.rb

Overview

This module is responsible for validating the trustworthiness of a saml document.

Instance Method Summary collapse

Instance Method Details

#signature_required?Boolean

Returns true when this document must carry a signature to be valid.

Returns:

  • (Boolean)


19
20
21
# File 'lib/saml/kit/concerns/trustable.rb', line 19

def signature_required?
  configuration.signature_required && signature_required_by_type?
end

#signed?Boolean

Returns true when the document has an embedded XML Signature or has been verified externally.

Returns:

  • (Boolean)


25
26
27
# File 'lib/saml/kit/concerns/trustable.rb', line 25

def signed?
  signature_verified || signature.present?
end

#trusted?Boolean

Returns true when documents is signed and the signing certificate belongs to a known service entity.

Returns:

  • (Boolean)


36
37
38
39
40
41
# File 'lib/saml/kit/concerns/trustable.rb', line 36

def trusted?
  return true if signature_verified
  return false unless signed?

  signature.trusted?(provider)
end