Sha256: db3cdeb9acf637f41234db436da94e9debc9680bb949652a81d25d38f30f4c47

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

module Saml
  module Kit
    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

      # @deprecated Use 'Saml::Kit::Builders::ServiceProviderMetadata'.
      Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::ServiceProviderMetadata::Builder', 'Saml::Kit::Builders::ServiceProviderMetadata')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
saml-kit-0.2.17 lib/saml/kit/service_provider_metadata.rb
saml-kit-0.2.16 lib/saml/kit/service_provider_metadata.rb
saml-kit-0.2.15 lib/saml/kit/service_provider_metadata.rb