Module: Saml::Kit::Trustable

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

Instance Method Summary collapse

Instance Method Details

#provider ⇒ Object



27
28
29
# File 'lib/saml/kit/trustable.rb', line 27

def provider
  configuration.registry.(issuer)
end

#signature ⇒ Object



16
17
18
19
# File 'lib/saml/kit/trustable.rb', line 16

def signature
  xml_hash = to_h.fetch(name, {}).fetch('Signature', nil)
  xml_hash ? Signature.new(xml_hash) : nil
end

#signature_verified! ⇒ Object



31
32
33
# File 'lib/saml/kit/trustable.rb', line 31

def signature_verified!
  @signature_manually_verified = true
end

#signed? ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/saml/kit/trustable.rb', line 12

def signed?
  signature_manually_verified || signature.present?
end

#trusted? ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'lib/saml/kit/trustable.rb', line 21

def trusted?
  return true if signature_manually_verified
  return false unless signed?
  signature.trusted?(provider)
end