Class: Saml::Kit::CompositeMetadata
- Includes:
- Enumerable
- Defined in:
- lib/saml/kit/composite_metadata.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Metadata
Metadata::METADATA_XSD, Metadata::NAMESPACES
Instance Attribute Summary collapse
-
#identity_provider ⇒ Object
readonly
Returns the value of attribute identity_provider.
-
#service_provider ⇒ Object
readonly
Returns the value of attribute service_provider.
Attributes inherited from Metadata
Instance Method Summary collapse
- #certificates ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(xml) ⇒ CompositeMetadata
constructor
A new instance of CompositeMetadata.
- #method_missing(name, *args) ⇒ Object
- #services(type) ⇒ Object
Methods inherited from Metadata
#contact_person_company, #encryption_certificates, #entity_id, from, #logout_request_for, #matches?, #name_id_formats, #organization_name, #organization_url, #service_for, #signing_certificates, #single_logout_service_for, #single_logout_services, #to_h, #to_s, #to_xml, #verify
Constructor Details
#initialize(xml) ⇒ CompositeMetadata
Returns a new instance of CompositeMetadata.
7 8 9 10 11 12 13 |
# File 'lib/saml/kit/composite_metadata.rb', line 7 def initialize(xml) super("IDPSSODescriptor", xml) = [ Saml::Kit::ServiceProviderMetadata.new(xml), Saml::Kit::IdentityProviderMetadata.new(xml), ] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/saml/kit/composite_metadata.rb', line 32 def method_missing(name, *args) if target = find { |x| x.respond_to?(name) } target.public_send(name, *args) else super end end |
Instance Attribute Details
#identity_provider ⇒ Object (readonly)
Returns the value of attribute identity_provider.
5 6 7 |
# File 'lib/saml/kit/composite_metadata.rb', line 5 def identity_provider @identity_provider end |
#service_provider ⇒ Object (readonly)
Returns the value of attribute service_provider.
5 6 7 |
# File 'lib/saml/kit/composite_metadata.rb', line 5 def service_provider @service_provider end |
Instance Method Details
#certificates ⇒ Object
24 25 26 |
# File 'lib/saml/kit/composite_metadata.rb', line 24 def certificates flat_map(&:certificates) end |
#each(&block) ⇒ Object
28 29 30 |
# File 'lib/saml/kit/composite_metadata.rb', line 28 def each(&block) .each(&block) end |
#services(type) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/saml/kit/composite_metadata.rb', line 15 def services(type) xpath = map { |x| "//md:EntityDescriptor/md:#{x.name}/md:#{type}" }.join("|") document.find_all(xpath).map do |item| binding = item.attribute("Binding").value location = item.attribute("Location").value Saml::Kit::Bindings.create_for(binding, location) end end |