Sha256: da20da41cb125d50ccc5fc086eb4cf3b4b4634d2698f48015c3529b0358a6708
Contents?: true
Size: 899 Bytes
Versions: 7
Compression:
Stored size: 899 Bytes
Contents
# frozen_string_literal: true require 'elastic_apm/filters/request_body_filter' require 'elastic_apm/filters/secrets_filter' module ElasticAPM # @api private module Filters def self.new(config) Container.new(config) end # @api private class Container def initialize(config) @config = config @filters = { request_body: RequestBodyFilter.new(config), secrets: SecretsFilter.new(config) } end attr_reader :config def add(key, filter) @filters[key] = filter end def remove(key) @filters.delete(key) end def apply(payload) @filters.reduce(payload) do |result, (_key, filter)| result = filter.call(result) break if result.nil? result end end def length @filters.length end end end end
Version data entries
7 entries across 7 versions & 1 rubygems