Sha256: e76d5752637ad6bcb9b0a8a8dcbfbbf3503a8b122010aec9f112f598ac4f828e

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/framework/rails/patch/assess_configuration'
module Contrast
  module Framework
    module Rails
      module Patch
        # Our patch into the Rails::Application::Configuration Class, allowing
        # for the runtime detection of insecure configurations on individual
        # ActionDispatch::Session::AbstractStore instances within the
        # application.
        module RailsApplicationConfiguration
          def self.instrument
            @_instrument ||= begin
              ::Rails::Application::Configuration.class_eval do
                alias_method :cs__patched_session_store, :session_store
                def session_store *args
                  ret = cs__patched_session_store(*args)
                  Contrast::Framework::Rails::Patch::AssessConfiguration.analyze_session_store(*args)
                  ret
                end
              end
              true
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
contrast-agent-4.4.1 lib/contrast/framework/rails/patch/rails_application_configuration.rb
contrast-agent-4.4.0 lib/contrast/framework/rails/patch/rails_application_configuration.rb
contrast-agent-4.3.2 lib/contrast/framework/rails/patch/rails_application_configuration.rb
contrast-agent-4.3.1 lib/contrast/framework/rails/patch/rails_application_configuration.rb
contrast-agent-4.3.0 lib/contrast/framework/rails/patch/rails_application_configuration.rb