Sha256: c52b9c5190604ffb29991880b1e605f9fc3739858065ec86fd8d0ed3c8d69551

Contents?: true

Size: 1.51 KB

Versions: 8

Compression:

Stored size: 1.51 KB

Contents

module Saml
  module Kit
    module Builders
      class Assertion
        include Templatable
        extend Forwardable

        def_delegators :@response_builder, :encrypt, :embed_signature, :request, :issuer, :reference_id, :now, :configuration, :user, :version, :destination, :encryption_certificate

        def initialize(response_builder)
          @response_builder = response_builder
        end

        def name_id_format
          request.name_id_format
        end

        def name_id
          user.name_id_for(name_id_format)
        end

        def assertion_attributes
          user.assertion_attributes_for(request)
        end

        private

        def assertion_options
          {
            ID: reference_id,
            IssueInstant: now.iso8601,
            Version: version,
            xmlns: Namespaces::ASSERTION,
          }
        end

        def subject_confirmation_data_options
          {
            InResponseTo: request.id,
            NotOnOrAfter: 3.hours.since(now).utc.iso8601,
            Recipient: destination,
          }
        end

        def conditions_options
          {
            NotBefore: now.utc.iso8601,
            NotOnOrAfter: configuration.session_timeout.since(now).utc.iso8601,
          }
        end

        def authn_statement_options
          {
            AuthnInstant: now.iso8601,
            SessionIndex: reference_id,
            SessionNotOnOrAfter: configuration.session_timeout.since(now).utc.iso8601,
          }
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
saml-kit-0.3.0 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.18 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.17 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.16 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.15 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.14 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.13 lib/saml/kit/builders/assertion.rb
saml-kit-0.2.12 lib/saml/kit/builders/assertion.rb