Sha256: 88ffffee718de8839322ae90f5c642529a754b0fa0ee72f80be7f451d0981b17

Contents?: true

Size: 757 Bytes

Versions: 7

Compression:

Stored size: 757 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(config, options)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gitlab-styles-11.0.0 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-10.1.0 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-10.0.0 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-9.2.0 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-9.1.0 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-9.0.0 lib/rubocop/cop/fips/sha1.rb
gitlab-styles-8.0.0 lib/rubocop/cop/fips/sha1.rb