Sha256: 7932d4806c9093402b8359e3b53f026cc1299a42e5058120213bf47b9046ead6

Contents?: true

Size: 917 Bytes

Versions: 11

Compression:

Stored size: 917 Bytes

Contents

module Saml
  module Kit
    # {include:file:spec/examples/response_spec.rb}
    class Response < Document
      include Respondable
      extend Forwardable

      def_delegators :assertion, :name_id, :[], :attributes

      validate :must_be_valid_assertion

      def initialize(xml, request_id: nil, configuration: Saml::Kit.configuration)
        @request_id = request_id
        super(xml, name: "Response", configuration: configuration)
      end

      def assertion
        @assertion ||= Saml::Kit::Assertion.new(to_h, configuration: @configuration)
      end

      private

      def must_be_valid_assertion
        assertion.valid?
        assertion.errors.each do |attribute, error|
          self.errors[attribute] << error
        end
      end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
saml-kit-1.0.2 lib/saml/kit/response.rb
saml-kit-1.0.1 lib/saml/kit/response.rb
saml-kit-1.0.0 lib/saml/kit/response.rb
saml-kit-0.3.6 lib/saml/kit/response.rb
saml-kit-0.3.5 lib/saml/kit/response.rb
saml-kit-0.3.4 lib/saml/kit/response.rb
saml-kit-0.3.3 lib/saml/kit/response.rb
saml-kit-0.3.2 lib/saml/kit/response.rb
saml-kit-0.3.1 lib/saml/kit/response.rb
saml-kit-0.3.0 lib/saml/kit/response.rb
saml-kit-0.2.18 lib/saml/kit/response.rb