Class: RSAML::Protocol::IDPList

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

Overview

Specifies the identity providers trusted by the requester to authenticate the presenter.

Instance Method Summary collapse

Constructor Details

#initialize(*idp_entries) ⇒ IDPList

Initialize the IDP list



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

def initialize(*idp_entries)
  @idp_entries = idp_entries
end

Instance Method Details

#idp_entriesObject

Information about identity providers.



11
12
13
# File 'lib/rsaml/protocol/idp_list.rb', line 11

def idp_entries
  @idp_entries ||= []
end

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

Construct an XML fragment representing the idp list



21
22
23
24
25
# File 'lib/rsaml/protocol/idp_list.rb', line 21

def to_xml(xml=Builder::XmlMarkup.new)
  xml.tag!('samlp:IDPList') {
    idp_entries.each { |idp_entry| xml << idp_entry.to_xml }
  }
end

#validateObject

Validate the IDPList structure.

Raises:



16
17
18
# File 'lib/rsaml/protocol/idp_list.rb', line 16

def validate
  raise ValidationError, "At least one IDP entry is required" if idp_entries.empty?
end