Sha256: 1bd663a1cb252b5d8ab5593a7db6e26572ce5169774735ebce07074d0f44b84c

Contents?: true

Size: 1.18 KB

Versions: 18

Compression:

Stored size: 1.18 KB

Contents

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

module Contrast
  module Agent
    module Assess
      module Rule
        module Response
          module Framework
            # Rails 7 supports managing potential unsafe Headers
            # this module contains methods for checking if Rails 7 supersedes our rules
            module RailsSupport
              RAILS_VERSION = Gem::Version.new('7.0.0')

              # Some rules have features or settings that make them unsupported, meaning unnecessary or unavailable
              # in that framework. For now, the only distinction required is Rails 7 or not, so that's what we'll
              # report here.
              #
              # @return [Boolean] if the rule is unsupported by the framework
              def rails_seven?
                return false unless defined?(::Rails)

                rails_version = ::Rails.version
                return false unless !!rails_version

                Gem::Version.new(rails_version) >= RAILS_VERSION
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.6.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.5.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.4.1 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.4.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.3.2 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.3.1 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.3.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.2.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.1.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-7.0.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.15.3 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.15.2 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.15.1 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.15.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.14.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.13.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb
contrast-agent-6.12.0 lib/contrast/agent/assess/rule/response/framework/rails_support.rb