Class: Shibkit::MetaMeta::Entity
- Inherits:
-
MetadataItem
- Object
- MetadataItem
- Shibkit::MetaMeta::Entity
- Defined in:
- lib/shibkit/meta_meta/entity.rb
Overview
Class to represent the metadata of a Shibboleth IDP or SP
Constant Summary collapse
- ROOT_ELEMENT =
Element and attribute used to select XML for new objects
'EntityDescriptor'
- TARGET_ATTR =
'entityID'
- REQUIRED_QUACKS =
[:entity_uri]
- LINE_START =
"<!--"
- LINE_END =
"-->"
- HR_CHAR =
"="
Constants inherited from MetadataItem
Instance Attribute Summary collapse
-
#accountable ⇒ Object
(also: #accountable?)
Is the entity accountable?.
-
#admin_contact ⇒ Object
Contact object containing technical contact details.
-
#athens ⇒ Object
(also: #athens?)
Is the entity using Athens?.
-
#entity_uri ⇒ Object
(also: #uri, #entity_id)
The URI of the entity.
-
#hide ⇒ Object
(also: #hide?)
Show in normal WAYFs?.
-
#idp ⇒ Object
Is the entity an IDP?.
-
#metadata_id ⇒ Object
The ID of the entity with the metadata file (not globally unique).
-
#organisation ⇒ Object
(also: #organization)
Organisation object for the owner of the entity.
-
#other_federation_uris ⇒ Object
(also: #secondary_federation_uris)
The URI of the entity’s parent federation.
-
#primary ⇒ Object
Has this entity object been selected to represent the service?.
-
#primary_federation_uri ⇒ Object
The URI of the entity’s parent federation.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
-
#sp ⇒ Object
Is the entity an SP?.
-
#support_contact ⇒ Object
Contact object containing user support contact details.
-
#technical_contact ⇒ Object
Contact object containing technical contact details.
-
#ukfm ⇒ Object
(also: #ukfm?)
Is the entity part of the UK Access Management Federation?.
Attributes inherited from MetadataItem
Instance Method Summary collapse
-
#federation_uris ⇒ Object
All federations that this entity is a member of.
- #idp? ⇒ Boolean
- #multi_federated? ⇒ Boolean
- #primary? ⇒ Boolean
- #sp? ⇒ Boolean
- #tags ⇒ Object
- #tags=(tags) ⇒ Object
- #to_s ⇒ Object
- #urn? ⇒ Boolean
- #xml_comment ⇒ Object
Methods inherited from MetadataItem
#filter, #from_xml, #hashed_id, #initialize, #parsed_xml, #purge_xml, #source_xml, #textify_xml, #to_hash, #to_rdf, #to_xml
Constructor Details
This class inherits a constructor from Shibkit::MetaMeta::MetadataItem
Instance Attribute Details
#accountable ⇒ Object Also known as: accountable?
Is the entity accountable?
57 58 59 |
# File 'lib/shibkit/meta_meta/entity.rb', line 57 def accountable @accountable end |
#admin_contact ⇒ Object
Contact object containing technical contact details
80 81 82 |
# File 'lib/shibkit/meta_meta/entity.rb', line 80 def admin_contact @admin_contact end |
#athens ⇒ Object Also known as: athens?
Is the entity using Athens?
63 64 65 |
# File 'lib/shibkit/meta_meta/entity.rb', line 63 def athens @athens end |
#entity_uri ⇒ Object Also known as: uri, entity_id
The URI of the entity
40 41 42 |
# File 'lib/shibkit/meta_meta/entity.rb', line 40 def entity_uri @entity_uri end |
#hide ⇒ Object Also known as: hide?
Show in normal WAYFs?
66 67 68 |
# File 'lib/shibkit/meta_meta/entity.rb', line 66 def hide @hide end |
#idp ⇒ Object
Is the entity an IDP?
83 84 85 |
# File 'lib/shibkit/meta_meta/entity.rb', line 83 def idp @idp end |
#metadata_id ⇒ Object
The ID of the entity with the metadata file (not globally unique)
54 55 56 |
# File 'lib/shibkit/meta_meta/entity.rb', line 54 def @metadata_id end |
#organisation ⇒ Object Also known as: organization
Organisation object for the owner of the entity
71 72 73 |
# File 'lib/shibkit/meta_meta/entity.rb', line 71 def organisation @organisation end |
#other_federation_uris ⇒ Object Also known as: secondary_federation_uris
The URI of the entity’s parent federation
47 48 49 |
# File 'lib/shibkit/meta_meta/entity.rb', line 47 def other_federation_uris @other_federation_uris end |
#primary ⇒ Object
Has this entity object been selected to represent the service?
51 52 53 |
# File 'lib/shibkit/meta_meta/entity.rb', line 51 def primary @primary end |
#primary_federation_uri ⇒ Object
The URI of the entity’s parent federation
44 45 46 |
# File 'lib/shibkit/meta_meta/entity.rb', line 44 def primary_federation_uri @primary_federation_uri end |
#scopes ⇒ Object
Returns the value of attribute scopes.
68 69 70 |
# File 'lib/shibkit/meta_meta/entity.rb', line 68 def scopes @scopes end |
#sp ⇒ Object
Is the entity an SP?
86 87 88 |
# File 'lib/shibkit/meta_meta/entity.rb', line 86 def sp @sp end |
#support_contact ⇒ Object
Contact object containing user support contact details
74 75 76 |
# File 'lib/shibkit/meta_meta/entity.rb', line 74 def support_contact @support_contact end |
#technical_contact ⇒ Object
Contact object containing technical contact details
77 78 79 |
# File 'lib/shibkit/meta_meta/entity.rb', line 77 def technical_contact @technical_contact end |
#ukfm ⇒ Object Also known as: ukfm?
Is the entity part of the UK Access Management Federation?
60 61 62 |
# File 'lib/shibkit/meta_meta/entity.rb', line 60 def ukfm @ukfm end |
Instance Method Details
#federation_uris ⇒ Object
All federations that this entity is a member of
133 134 135 136 137 138 139 140 |
# 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 |
#idp? ⇒ Boolean
101 102 103 104 105 |
# File 'lib/shibkit/meta_meta/entity.rb', line 101 def idp? return idp.kind_of?(::Shibkit::MetaMeta::IDP) end |
#multi_federated? ⇒ Boolean
126 127 128 129 130 |
# File 'lib/shibkit/meta_meta/entity.rb', line 126 def multi_federated? return other_federation_uris.size > 0 ? true : false end |
#primary? ⇒ Boolean
120 121 122 123 124 |
# File 'lib/shibkit/meta_meta/entity.rb', line 120 def primary? return @primary ? true : false end |
#sp? ⇒ Boolean
107 108 109 110 111 |
# File 'lib/shibkit/meta_meta/entity.rb', line 107 def sp? return sp.kind_of?(::Shibkit::MetaMeta::SP) end |
#tags ⇒ Object
157 158 159 160 161 |
# File 'lib/shibkit/meta_meta/entity.rb', line 157 def return @tags.nil? ? [] : @tags.collect { |t| t.to_sym } end |
#tags=(tags) ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/shibkit/meta_meta/entity.rb', line 142 def () @tags ||= [] if Shibkit::MetaMeta.config.auto_tag? @tags << :idp if idp? @tags << :sp if sp? end @tags = @tags.concat([].flatten).uniq end |
#to_s ⇒ Object
95 96 97 98 99 |
# File 'lib/shibkit/meta_meta/entity.rb', line 95 def to_s return uri end |
#urn? ⇒ Boolean
113 114 115 116 117 |
# File 'lib/shibkit/meta_meta/entity.rb', line 113 def urn? return uri.strip.downcase[0..3] == 'urn:' end |
#xml_comment ⇒ Object
163 164 165 166 167 168 169 170 171 |
# 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 |