Class: SAML::Metadata::EntitiesDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/metadata/entities_descriptor.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entity_descriptorsObject (readonly)

Returns the value of attribute entity_descriptors.



5
6
7
# File 'lib/saml/metadata/entities_descriptor.rb', line 5

def entity_descriptors
  @entity_descriptors
end

Class Method Details

.from_xml(xml) ⇒ Object



7
8
9
# File 'lib/saml/metadata/entities_descriptor.rb', line 7

def self.from_xml(xml)
  allocate.from_xml(xml)
end

Instance Method Details

#from_xml(xml) ⇒ Object



11
12
13
14
15
16
# File 'lib/saml/metadata/entities_descriptor.rb', line 11

def from_xml(xml)
  @entity_descriptors = xml.get_elements('md:EntityDescriptor').map do |ed_node|
    EntityDescriptor.from_xml(ed_node)
  end
  self
end

#idpObject



25
26
27
28
29
30
# File 'lib/saml/metadata/entities_descriptor.rb', line 25

def idp
  @entity_descriptors.each do |entity|
    return entity if entity.idp?
  end
  nil
end

#idp_single_signon_serviceObject



40
41
42
# File 'lib/saml/metadata/entities_descriptor.rb', line 40

def idp_single_signon_service
  idp.idp_sso_descriptors.first.single_signon_services.first
end

#spObject



18
19
20
21
22
23
# File 'lib/saml/metadata/entities_descriptor.rb', line 18

def sp
  @entity_descriptors.each do |entity|
    return entity if entity.sp?
  end
  nil
end

#sp_assertion_consumer_serviceObject



32
33
34
# File 'lib/saml/metadata/entities_descriptor.rb', line 32

def sp_assertion_consumer_service
  sp.sp_sso_descriptors.first.assertion_consumer_services.first
end

#sp_single_logout_serviceObject



36
37
38
# File 'lib/saml/metadata/entities_descriptor.rb', line 36

def sp_single_logout_service
  sp.sp_sso_descriptors.first.single_logout_services.first
end