Sha256: 20bd56ebac50f74d311a28c728116ab1ceaa2105e89659deaf6c62551796d19a

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

module Saml
  module Kit
    # {include:file:spec/examples/service_provider_metadata_spec.rb}
    class ServiceProviderMetadata < Metadata
      def initialize(xml)
        super("SPSSODescriptor", xml)
      end

      # Returns each of the AssertionConsumerService bindings.
      def assertion_consumer_services
        services('AssertionConsumerService')
      end

      # Returns the AssertionConsumerService for the specified binding.
      #
      # @param binding [Symbol] can be either `:http_post` or `:http_redirect`
      def assertion_consumer_service_for(binding:)
        service_for(binding: binding, type: 'AssertionConsumerService')
      end

      # Returns true when the metadata demands that Assertions must be signed.
      def want_assertions_signed
        attribute = document.find_by("/md:EntityDescriptor/md:#{name}").attribute("WantAssertionsSigned")
        return true if attribute.nil?
        attribute.text.downcase == "true"
      end

      # @!visibility private
      def self.builder_class
        Saml::Kit::Builders::ServiceProviderMetadata
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
saml-kit-1.0.6 lib/saml/kit/service_provider_metadata.rb
saml-kit-1.0.5 lib/saml/kit/service_provider_metadata.rb
saml-kit-1.0.4 lib/saml/kit/service_provider_metadata.rb
saml-kit-1.0.3 lib/saml/kit/service_provider_metadata.rb
saml-kit-1.0.2 lib/saml/kit/service_provider_metadata.rb
saml-kit-1.0.1 lib/saml/kit/service_provider_metadata.rb
saml-kit-1.0.0 lib/saml/kit/service_provider_metadata.rb