Sha256: 69388454b31ac8587499336bcb3e62b9c6ab090322e77654ccec47012852a282

Contents?: true

Size: 1007 Bytes

Versions: 8

Compression:

Stored size: 1007 Bytes

Contents

module Saml
  module Kit
    class LogoutRequest < Document
      include Requestable
      validates_presence_of :single_logout_service, if: :expected_type?

      def initialize(xml, configuration: Saml::Kit.configuration)
        super(xml, name: "LogoutRequest", configuration: configuration)
      end

      def name_id
        to_h[name]['NameID']
      end

      def single_logout_service
        return if provider.nil?
        urls = provider.single_logout_services
        urls.first
      end

      def response_for(user, binding:, relay_state: nil)
        builder = Saml::Kit::LogoutResponse.builder(user, self) do |x|
          yield x if block_given?
        end
        response_binding = provider.single_logout_service_for(binding: binding)
        response_binding.serialize(builder, relay_state: relay_state)
      end

      Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::LogoutRequest::Builder', 'Saml::Kit::Builders::LogoutRequest')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
saml-kit-0.2.11 lib/saml/kit/logout_request.rb
saml-kit-0.2.10 lib/saml/kit/logout_request.rb
saml-kit-0.2.9 lib/saml/kit/logout_request.rb
saml-kit-0.2.8 lib/saml/kit/logout_request.rb
saml-kit-0.2.7 lib/saml/kit/logout_request.rb
saml-kit-0.2.6 lib/saml/kit/logout_request.rb
saml-kit-0.2.5 lib/saml/kit/logout_request.rb
saml-kit-0.2.4 lib/saml/kit/logout_request.rb