Sha256: 324ba6dc6d7ca5800f3a17a8262d69ab7d6f1f71547d3947946df57344b4f23b

Contents?: true

Size: 466 Bytes

Versions: 16

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

require "oga"

module Kiev
  module RequestBodyFilter
    class Xml
      def self.call(request_body, filtered_params, _ignored_params)
        document = Oga.parse_xml(request_body)
        filtered_params.each do |param|
          sensitive_param = document.at_xpath("//#{param}/text()")
          sensitive_param.text = FILTERED if sensitive_param.respond_to?(:text=)
        end
        document.to_xml
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
kiev-4.9.0 lib/kiev/request_body_filter/xml.rb
kiev-4.8.3 lib/kiev/request_body_filter/xml.rb
kiev-4.8.2 lib/kiev/request_body_filter/xml.rb
kiev-4.8.1 lib/kiev/request_body_filter/xml.rb
kiev-4.8.0 lib/kiev/request_body_filter/xml.rb
kiev-4.7.0 lib/kiev/request_body_filter/xml.rb
kiev-4.6.0 lib/kiev/request_body_filter/xml.rb
kiev-4.5.0 lib/kiev/request_body_filter/xml.rb
kiev-4.4.0 lib/kiev/request_body_filter/xml.rb
kiev-4.3.0 lib/kiev/request_body_filter/xml.rb
kiev-4.2.0 lib/kiev/request_body_filter/xml.rb
kiev-4.1.0 lib/kiev/request_body_filter/xml.rb
kiev-4.0.0 lib/kiev/request_body_filter/xml.rb
kiev-3.0.0 lib/kiev/request_body_filter/xml.rb
kiev-2.8.0 lib/kiev/request_body_filter/xml.rb
kiev-2.7.3 lib/kiev/request_body_filter/xml.rb