Sha256: 35102f8a33d9a0db35144531321f61dd291ac17307789e6a8dd31129eb35b02c

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

module Saml
  module Kit
    module Builders
      # {include:file:lib/saml/kit/builders/templates/logout_request.builder}
      # {include:file:spec/saml/builders/logout_request_spec.rb}
      class LogoutRequest
        include XmlTemplatable
        attr_accessor :id, :destination, :issuer, :name_id_format, :now
        attr_accessor :version
        attr_reader :user, :configuration

        def initialize(user, configuration: Saml::Kit.configuration)
          @configuration = configuration
          @user = user
          @id = ::Xml::Kit::Id.generate
          @issuer = configuration.issuer
          @name_id_format = Saml::Kit::Namespaces::PERSISTENT
          @now = Time.now.utc
          @version = "2.0"
        end

        def build
          Saml::Kit::LogoutRequest.new(to_xml, configuration: configuration)
        end

        private

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

        def name_id_options
          {
            Format: name_id_format,
            xmlns: Namespaces::ASSERTION,
          }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saml-kit-0.3.5 lib/saml/kit/builders/logout_request.rb
saml-kit-0.3.4 lib/saml/kit/builders/logout_request.rb
saml-kit-0.3.3 lib/saml/kit/builders/logout_request.rb
saml-kit-0.3.2 lib/saml/kit/builders/logout_request.rb
saml-kit-0.3.1 lib/saml/kit/builders/logout_request.rb