# File lib/shibkit/meta_meta/entity.rb, line 120 def primary? return @primary ? true : false end
class Shibkit::MetaMeta::Entity
Constants
- HR_CHAR
- LINE_END
- LINE_START
- REQUIRED_QUACKS
- ROOT_ELEMENT
Element and attribute used to select XML for new objects
- TARGET_ATTR
Attributes
Is the entity accountable?
Is the entity accountable?
Contact
object containing technical contact details
Is the entity using Athens?
Is the entity using Athens?
The URI of the entity
The URI of the entity
Show in normal WAYFs?
Show in normal WAYFs?
Is the entity an IDP
?
The ID of the entity with the metadata file (not globally unique)
Organisation
object for the owner of the entity
Organisation
object for the owner of the entity
The URI of the entity’s parent federation
Has this entity object been selected to represent the service?
The URI of the entity’s parent federation
The URI of the entity’s parent federation
Is the entity an SP
?
Contact
object containing user support contact details
Contact
object containing technical contact details
Is the entity part of the UK Access Management Federation
?
Is the entity part of the UK Access Management Federation
?
The URI of the entity
Public Instance Methods
All federations that this entity is a member of
# File lib/shibkit/meta_meta/entity.rb, line 133 def federation_uris ## All unique federations, making sure we include primary all_fed_uris = [primary_federation_uri].concat other_federation_uris return all_fed_uris.uniq end
# File lib/shibkit/meta_meta/entity.rb, line 101 def idp? return idp.kind_of?(::Shibkit::MetaMeta::IDP) end
# File lib/shibkit/meta_meta/entity.rb, line 126 def multi_federated? return other_federation_uris.size > 0 ? true : false end
# File lib/shibkit/meta_meta/entity.rb, line 107 def sp? return sp.kind_of?(::Shibkit::MetaMeta::SP) end
# File lib/shibkit/meta_meta/entity.rb, line 95 def to_s return uri end
# File lib/shibkit/meta_meta/entity.rb, line 113 def urn? return uri.strip.downcase[0..3] == 'urn:' end
# File lib/shibkit/meta_meta/entity.rb, line 163 def xml_comment out = "\n" + LINE_START + (HR_CHAR * 71) + LINE_END + "\n" out << LINE_START + " " + uri + " " + LINE_END + "\n" out << LINE_START + (HR_CHAR * 71) + LINE_END + "\n\n" return out end
Private Instance Methods
# File lib/shibkit/meta_meta/entity.rb, line 175 def parse_xml self.entity_uri = @noko['entityID'].to_s.strip self.metadata_id = @noko['ID'].to_s.strip @other_federation_uris ||= Array.new ## Boolean flags for common/useful info self.accountable = @noko.xpath('xmlns:Extensions/ukfedlabel:AccountableUsers').size > 0 ? true : false self.ukfm = @noko.xpath('xmlns:Extensions/ukfedlabel:UKFederationMember').size > 0 ? true : false self.athens = @noko.xpath('xmlns:Extensions/elab:AthensPUIDAuthority').size > 0 ? true : false self.hide = @noko.xpath('xmlns:Extensions/wayf:HideFromWAYF').size > 0 ? true : false @scopes = @noko.xpath('xmlns:Extensions/shibmd:Scope').collect do |sx| sx['regexp'] == 'true' ? Regexp.new(sx.text) : sx.text end ## IDP and SP objects, if available. Based on the same XML as their parent/entity object self.idp = Shibkit::MetaMeta::IDP.new(@noko).filter self.sp = Shibkit::MetaMeta::SP.new(@noko).filter ## Include Contact objects self.support_contact = Contact.new(@noko.xpath("xmlns:ContactPerson[@contactType='support'][1]")[0]).filter self.technical_contact = Contact.new(@noko.xpath("xmlns:ContactPerson[@contactType='technical'][1]")[0]).filter self.admin_contact = Contact.new(@noko.xpath("xmlns:ContactPerson[@contactType='administrative'][1]")[0]).filter ## Include an organisation object self.organisation = Organisation.new(@noko.xpath("xmlns:Organization[1]")[0]).filter self.idp.organisation = self.organisation if idp? self.sp.organisation = self.organisation if sp? self.tags ||= [] log.debug " Derived entity #{self.uri} from XML" end