Sha256: 01737fc47923c9b0658a1ef08ad69a047d727afd9b4741ac0019ce3c787540bd

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

module Saml
  module Kit
    class CompositeMetadata < Metadata # :nodoc:
      include Enumerable
      attr_reader :service_provider, :identity_provider

      def initialize(xml)
        super("IDPSSODescriptor", xml)
        @metadatum = [
          Saml::Kit::ServiceProviderMetadata.new(xml),
          Saml::Kit::IdentityProviderMetadata.new(xml),
        ]
      end

      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

      def certificates
        flat_map(&:certificates)
      end

      def each(&block)
        @metadatum.each(&block)
      end

      def method_missing(name, *args)
        if target = find { |x| x.respond_to?(name) }
          target.public_send(name, *args)
        else
          super
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
saml-kit-1.0.6 lib/saml/kit/composite_metadata.rb
saml-kit-1.0.5 lib/saml/kit/composite_metadata.rb
saml-kit-1.0.4 lib/saml/kit/composite_metadata.rb
saml-kit-1.0.3 lib/saml/kit/composite_metadata.rb
saml-kit-1.0.2 lib/saml/kit/composite_metadata.rb
saml-kit-1.0.1 lib/saml/kit/composite_metadata.rb
saml-kit-1.0.0 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.6 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.5 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.4 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.3 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.2 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.1 lib/saml/kit/composite_metadata.rb
saml-kit-0.3.0 lib/saml/kit/composite_metadata.rb
saml-kit-0.2.18 lib/saml/kit/composite_metadata.rb
saml-kit-0.2.17 lib/saml/kit/composite_metadata.rb
saml-kit-0.2.16 lib/saml/kit/composite_metadata.rb
saml-kit-0.2.15 lib/saml/kit/composite_metadata.rb
saml-kit-0.2.14 lib/saml/kit/composite_metadata.rb
saml-kit-0.2.13 lib/saml/kit/composite_metadata.rb