Sha256: bf6018d8faa9cf318567860bb99ab7f26951559dbcd950c9ab7cbd7855035336

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

require_relative '../../../gitlab/styles/common/banned_constants'

module Rubocop
  module Cop
    module Fips
      class SHA1 < RuboCop::Cop::Base
        include Gitlab::Styles::Common::BannedConstants

        MESSAGE_TEMPLATE = 'SHA1 is likely to become non-compliant in the near future. Use %{replacement} instead.'

        REPLACEMENTS = {
          'OpenSSL::Digest::SHA1' => 'OpenSSL::Digest::SHA256',
          'Digest::SHA1' => 'OpenSSL::Digest::SHA256'
        }.freeze

        def initialize(config = nil, options = nil)
          @message_template = MESSAGE_TEMPLATE
          @replacements = REPLACEMENTS
          @autocorrect = false
          super
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gitlab-styles-13.0.1 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-13.0.0 lib/rubocop/cop/fips/sha1.rb