Sha256: 275d47f159c2e04871502c8c401f2a491886ace1b6da90bcaf726d21558983fd

Contents?: true

Size: 865 Bytes

Versions: 13

Compression:

Stored size: 865 Bytes

Contents

module Saml
  module Kit
    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

13 entries across 13 versions & 1 rubygems

Version Path
saml-kit-0.2.17 lib/saml/kit/response.rb
saml-kit-0.2.16 lib/saml/kit/response.rb
saml-kit-0.2.15 lib/saml/kit/response.rb
saml-kit-0.2.14 lib/saml/kit/response.rb
saml-kit-0.2.13 lib/saml/kit/response.rb
saml-kit-0.2.12 lib/saml/kit/response.rb
saml-kit-0.2.11 lib/saml/kit/response.rb
saml-kit-0.2.10 lib/saml/kit/response.rb
saml-kit-0.2.9 lib/saml/kit/response.rb
saml-kit-0.2.8 lib/saml/kit/response.rb
saml-kit-0.2.7 lib/saml/kit/response.rb
saml-kit-0.2.6 lib/saml/kit/response.rb
saml-kit-0.2.5 lib/saml/kit/response.rb