class Shibkit::MetaMeta::Federation
Class to represent a Shibboleth Federation
or collection of local metadata
Constants
- REQUIRED_QUACKS
- ROOT_ELEMENT
Element and attribute used to select XML for new objects
- TARGET_ATTR
Attributes
@return [Array] country codes for areas served by the federation
@return [String] Brief description of the federation or collection
The human-readable display name of the Federation
or collection of metadata
Array of entities within the federation or metadata collection
The URI name of the federation (may be missing for local collections)
@return [String] URL of the federation or collection’s home page
@return [Array] Array of languages supported by the federation or collection
The unique ID of the federation document (probably time/version based)
@return [String] the full name of the federation or collection
Time the Federation
metadata was parsed
@return [String, nil] URL of the federation’s Refeds wiki entry
Source
file for this federation
@return [String] Main contact email address for the federation
@return [String] :federation for proper federations, :collection for
simple collections of entities.
The URI name of the federation (may be missing for local collections)
Expiry date of the published metadata file
Public Instance Methods
# File lib/shibkit/meta_meta/federation.rb, line 114 def idps return entities.select { |e| e.idp? } end
# File lib/shibkit/meta_meta/federation.rb, line 108 def sps return entities.select { |e| e.sp? } end
# File lib/shibkit/meta_meta/federation.rb, line 85 def to_s return uri end
Private Instance Methods
Build a federation object out of metadata XML
# File lib/shibkit/meta_meta/federation.rb, line 132 def parse_xml self.metadata_id = @noko['ID'].to_s.strip self.federation_uri = @noko['Name'].to_s.strip self.valid_until = @noko['validUntil'].strip self.entities = Array.new ## Process XML chunk for each entity in turn log.info "Building entities for federation (#{uri})..." @noko.xpath("//xmlns:EntityDescriptor").each do |ex| entity = Entity.new(ex) entity.primary_federation_uri = self.federation_uri entity.tags << self.tags ## Collect this entity in the federation object self.entities << entity end log.debug "Derived federation #{self.uri} from XML" end
Special case for federation top-level nodes
# File lib/shibkit/meta_meta/federation.rb, line 123 def select_xml(target=nil, options={}) raise "No suitable XML was selected" unless @noko and @noko.kind_of?(Nokogiri::XML::Element) and @noko.name == ROOT_ELEMENT end