Sha256: 3c194b6ae0d215e55e471457515c3b0ecb7faac9961996e46029f6ae64139479

Contents?: true

Size: 863 Bytes

Versions: 1

Compression:

Stored size: 863 Bytes

Contents

# frozen_string_literal: true

require_relative '../../../common/banned_constants'

module Gitlab
  module Styles
    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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