Class: RSAML::Evidence

Inherits:
Object
  • Object
show all
Defined in:
lib/rsaml/evidence.rb

Overview

Contains one or more assertions or assertion references that the SAML authority relied on in issuing the authorization decision.

Instance Method Summary collapse

Instance Method Details

#assertionsObject

Specifies an assertion either by reference or by value.



6
7
8
# File 'lib/rsaml/evidence.rb', line 6

def assertions
  @assertions ||= []
end

#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object

Construct an XML fragment representing the authentication statement



15
16
17
18
19
# File 'lib/rsaml/evidence.rb', line 15

def to_xml(xml=Builder::XmlMarkup.new)
  xml.tag!('saml:Evidence') {
    assertions.each { |assertion| xml << assertion.to_xml }
  }
end

#validateObject

Raises:



10
11
12
# File 'lib/rsaml/evidence.rb', line 10

def validate
  raise ValidationError, "At least one assertion is required" if assertions.empty?
end