Sha256: a0ab5332e0dd1eec5620f7b592fa76c322c48645fbb444e02b51358131dcb099

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

# frozen_string_literal: true
module ShopifyApp
  module RedactJobParams
    private

    def args_info(job)
      log_disabled_classes = %w(ShopifyApp::ScripttagsManagerJob ShopifyApp::WebhooksManagerJob)
      return "" if log_disabled_classes.include?(job.class.name)
      super
    end
  end

  class Engine < Rails::Engine
    engine_name 'shopify_app'
    isolate_namespace ShopifyApp

    initializer "shopify_app.assets.precompile" do |app|
      app.config.assets.precompile += %w[
        shopify_app/redirect.js
        shopify_app/top_level.js
        shopify_app/enable_cookies.js
        shopify_app/request_storage_access.js
        storage_access.svg
      ]
    end

    initializer "shopify_app.middleware" do |app|
      app.config.middleware.insert_after(::Rack::Runtime, ShopifyApp::SameSiteCookieMiddleware)

      if ShopifyApp.configuration.allow_jwt_authentication
        app.config.middleware.insert_after(ShopifyApp::SameSiteCookieMiddleware, ShopifyApp::JWTMiddleware)
      end
    end

    initializer "shopify_app.redact_job_params" do
      ActiveSupport.on_load(:active_job) do
        if ActiveJob::Base.respond_to?(:log_arguments?)
          WebhooksManagerJob.log_arguments = false
          ScripttagsManagerJob.log_arguments = false
        elsif ActiveJob::Logging::LogSubscriber.private_method_defined?(:args_info)
          ActiveJob::Logging::LogSubscriber.prepend(RedactJobParams)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
shopify_app-18.0.0 lib/shopify_app/engine.rb
shopify_app-17.2.1 lib/shopify_app/engine.rb
shopify_app-17.2.0 lib/shopify_app/engine.rb
shopify_app-17.1.1 lib/shopify_app/engine.rb
shopify_app-17.1.0 lib/shopify_app/engine.rb
shopify_app-17.0.5 lib/shopify_app/engine.rb
shopify_app-17.0.4 lib/shopify_app/engine.rb
shopify_app-17.0.3 lib/shopify_app/engine.rb
shopify_app-17.0.2 lib/shopify_app/engine.rb
shopify_app-17.0.1 lib/shopify_app/engine.rb
shopify_app-17.0.0 lib/shopify_app/engine.rb
shopify_app-16.1.0 lib/shopify_app/engine.rb
shopify_app-16.0.0 lib/shopify_app/engine.rb
shopify_app-15.0.1 lib/shopify_app/engine.rb
shopify_app-15.0.0 lib/shopify_app/engine.rb
shopify_app-14.4.4 lib/shopify_app/engine.rb