Sha256: 502b140537e79d654cd1755eb7b733e3676d880cf56359b1f02e4b60b7cd5e01

Contents?: true

Size: 777 Bytes

Versions: 17

Compression:

Stored size: 777 Bytes

Contents

# typed: false
# frozen_string_literal: true

# ActiveJob logs the arguments passed to the job. This initializer filters out sensitive information from the logs.
# cf. https://github.com/rails/rails/pull/34438#issuecomment-2336749226
Rails.application.config.after_initialize do
  require "active_job/log_subscriber"
  module ActiveJob
    class LogSubscriber < ActiveSupport::LogSubscriber
      alias_method :original_format, :format

      private def format(arg)
        if arg.is_a?(Hash)
          parameter_filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
          parameter_filter.filter(arg.transform_values { |value| original_format(value) })
        else
          original_format(arg)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
hephaestus-0.8.15.5 config/initializers/filter_job_params.rb
hephaestus-0.8.15.4 config/initializers/filter_job_params.rb
hephaestus-0.8.15.3 config/initializers/filter_job_params.rb
hephaestus-0.8.15.2 config/initializers/filter_job_params.rb
hephaestus-0.8.15.1 config/initializers/filter_job_params.rb
hephaestus-0.8.15 config/initializers/filter_job_params.rb
hephaestus-0.8.14 config/initializers/filter_job_params.rb
hephaestus-0.8.13 config/initializers/filter_job_params.rb
hephaestus-0.8.12.2 config/initializers/filter_job_params.rb
hephaestus-0.8.12.1 config/initializers/filter_job_params.rb
hephaestus-0.8.12 config/initializers/filter_job_params.rb
hephaestus-0.8.11 config/initializers/filter_job_params.rb
hephaestus-0.8.10 config/initializers/filter_job_params.rb
hephaestus-0.8.9.2 config/initializers/filter_job_params.rb
hephaestus-0.8.9.1 config/initializers/filter_job_params.rb
hephaestus-0.8.9 config/initializers/filter_job_params.rb
hephaestus-0.8.8 config/initializers/filter_job_params.rb