Sha256: 2465036e87e149219f1b9aea8a0b3ff418ebde767a13d6372e08d51524ea7d87

Contents?: true

Size: 812 Bytes

Versions: 6

Compression:

Stored size: 812 Bytes

Contents

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

cs__scoped_require 'contrast/components/interface'

module Rack
  module Session
    # Our patch into the Rack::Session::Cookie Class, allowing for the
    # runtime detection of insecure configurations on individual cookies
    # within the application
    class Cookie
      include Contrast::Utils::InvalidConfigurationUtil
      include Contrast::Components::Interface

      access_component :scope

      alias_method :cs__patched_initialize, :initialize
      def initialize app, options = {}
        Contrast::Utils::RackAssessSessionCookie.analyze_cookie_initialization(options)
        cs__patched_initialize(app, options)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
contrast-agent-3.11.0 lib/contrast/extensions/framework/rack/cookie.rb
contrast-agent-3.10.2 lib/contrast/extensions/framework/rack/cookie.rb
contrast-agent-3.10.1 lib/contrast/extensions/framework/rack/cookie.rb
contrast-agent-3.10.0 lib/contrast/extensions/framework/rack/cookie.rb
contrast-agent-3.9.1 lib/contrast/extensions/framework/rack/cookie.rb
contrast-agent-3.9.0 lib/contrast/extensions/framework/rack/cookie.rb