Module: Contrast::Framework::Rails::Patch::RailsApplicationConfiguration

Defined in:
lib/contrast/framework/rails/patch/rails_application_configuration.rb

Overview

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.

Class Method Summary collapse

Class Method Details

.instrumentObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/contrast/framework/rails/patch/rails_application_configuration.rb', line 14

def self.instrument
  @_instrument ||= begin
    ::Rails::Application::Configuration.class_eval do
      alias_method(:cs__patched_session_store, :session_store)
      def session_store *args, **kwargs
        ret = cs__patched_session_store(*args, **kwargs)
        Contrast::Framework::Rails::Patch::AssessConfiguration.analyze_session_store(*args, **kwargs)
        ret
      end
    end
    true
  end
end