Sha256: 7416434576c529723f89744eefa9a045dbb8b7b272da9e940d3673078c8b3ef7

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

module Saml
  module Kit
    module Builders
      # {include:file:lib/saml/kit/builders/templates/logout_response.builder}
      # {include:file:spec/saml/builders/logout_response_spec.rb}
      class LogoutResponse
        include XmlTemplatable
        attr_accessor :id, :issuer, :version, :status_code, :now, :destination
        attr_reader :request
        attr_reader :configuration

        def initialize(request, configuration: Saml::Kit.configuration)
          @configuration = configuration
          @id = ::Xml::Kit::Id.generate
          @issuer = configuration.entity_id
          @now = Time.now.utc
          @request = request
          @status_code = Namespaces::SUCCESS
          @version = '2.0'
        end

        def build
          Saml::Kit::LogoutResponse.new(to_xml, request_id: request.id)
        end

        private

        def logout_response_options
          {
            xmlns: Namespaces::PROTOCOL,
            ID: id,
            Version: version,
            IssueInstant: now.utc.iso8601,
            Destination: destination,
            InResponseTo: request.id,
          }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
saml-kit-1.0.9 lib/saml/kit/builders/logout_response.rb
saml-kit-1.0.8 lib/saml/kit/builders/logout_response.rb
saml-kit-1.0.7 lib/saml/kit/builders/logout_response.rb