Commit 428d8a39 authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch '329233-2-rename-import-uploader-extension-allowlist-constant' into 'master'

Rename Import Uploader Extension Allowlist Constant

See merge request gitlab-org/gitlab!63236
parents 83feb9b4 27bf3056
......@@ -38,6 +38,6 @@ module WorkhorseAuthorization
end
def file_extension_whitelist
ImportExportUploader::EXTENSION_WHITELIST
ImportExportUploader::EXTENSION_ALLOWLIST
end
end
......@@ -2,6 +2,6 @@
module BulkImports
class ExportUploader < ImportExportUploader
EXTENSION_WHITELIST = %w[ndjson.gz].freeze
EXTENSION_ALLOWLIST = %w[ndjson.gz].freeze
end
end
# frozen_string_literal: true
class ImportExportUploader < AttachmentUploader
EXTENSION_WHITELIST = %w[tar.gz gz].freeze
EXTENSION_ALLOWLIST = %w[tar.gz gz].freeze
def self.workhorse_local_upload_path
File.join(options.storage_path, 'uploads', TMP_UPLOAD_PATH)
end
def extension_whitelist
EXTENSION_WHITELIST
EXTENSION_ALLOWLIST
end
def move_to_cache
......
......@@ -5,7 +5,7 @@ module API
module FileUploadHelpers
def file_is_valid?
filename = params[:file]&.original_filename
filename && ImportExportUploader::EXTENSION_WHITELIST.include?(File.extname(filename).delete('.'))
filename && ImportExportUploader::EXTENSION_ALLOWLIST.include?(File.extname(filename).delete('.'))
end
def validate_file!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment