class Shibkit::MetaMeta::SP

Class to represent an SP

Constants

MDUI_ROOT
REQUIRED_QUACKS
ROOT_ELEMENT

Element and attribute used to select XML for new objects

TARGET_ATTR

Attributes

default_service[RW]
protocols[RW]
services[RW]

Private Instance Methods

parse_xml() click to toggle source
Calls superclass method Shibkit::MetaMeta::Provider#parse_xml
# File lib/shibkit/meta_meta/sp.rb, line 46
def parse_xml
  
  super
  
  @valid = @noko.xpath('xmlns:SPSSODescriptor[1]').empty?  ? false : true

  proto_set = @noko.xpath('xmlns:SPSSODescriptor/@protocolSupportEnumeration')[0]
  @protocols = proto_set.value.split(' ') if proto_set 
  
  ## Include services objects
  @services ||= Array.new
  @noko.xpath("xmlns:SPSSODescriptor/xmlns:AttributeConsumingService").each do |sx|
    
    service = Shibkit::MetaMeta::Service.new(sx).filter

    next unless service
    
    @services << service
    @default_service = service if service.default?
    
  end
  
  @services.sort! { |a,b| a.index <=> b.index }
  @default_service = @services[0] unless @default_service
  
  log.debug "  Derived SP from XML" if filter
  
end