diff options
author | José Iván Vargas López <jvargas@gitlab.com> | 2018-08-24 18:31:39 +0000 |
---|---|---|
committer | Jose Vargas <jvargas@gitlab.com> | 2018-08-24 14:46:03 -0500 |
commit | ebcd24f375cfb7f146d9deee5cfa313d58ce0fe5 (patch) | |
tree | 49126ed406db70558ba90a97183f0f00668245cb | |
parent | 42becff534b1d322f103942da856a8bf521415e9 (diff) | |
download | gitlab-ce-ebcd24f375cfb7f146d9deee5cfa313d58ce0fe5.tar.gz |
Merge branch 'security-filter_creds_during_project_import-11-1' into 'security-11-1'
[11.1] Filter out credentials from Sidekiq logs during project import
See merge request gitlab/gitlabhq!2450
-rw-r--r-- | app/services/projects/import_service.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml | 5 | ||||
-rw-r--r-- | spec/services/projects/import_service_spec.rb | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/app/services/projects/import_service.rb b/app/services/projects/import_service.rb index 1781a01cbd4..6c3db925d06 100644 --- a/app/services/projects/import_service.rb +++ b/app/services/projects/import_service.rb @@ -23,7 +23,7 @@ module Projects success rescue => e - error("Error importing repository #{project.import_url} into #{project.full_path} - #{e.message}") + error("Error importing repository #{project.safe_import_url} into #{project.full_path} - #{e.message}") end private diff --git a/changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml b/changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml new file mode 100644 index 00000000000..c757e55f1cd --- /dev/null +++ b/changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml @@ -0,0 +1,5 @@ +--- +title: Sanitize git URL in import errors +merge_request: +author: Jamie Schembri +type: fixed diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb index b3815045792..e2a600d12d1 100644 --- a/spec/services/projects/import_service_spec.rb +++ b/spec/services/projects/import_service_spec.rb @@ -69,7 +69,7 @@ describe Projects::ImportService do result = subject.execute expect(result[:status]).to eq :error - expect(result[:message]).to eq "Error importing repository #{project.import_url} into #{project.full_path} - The repository could not be created." + expect(result[:message]).to eq "Error importing repository #{project.safe_import_url} into #{project.full_path} - The repository could not be created." end context 'when repository creation succeeds' do @@ -141,7 +141,7 @@ describe Projects::ImportService do result = subject.execute expect(result[:status]).to eq :error - expect(result[:message]).to eq "Error importing repository #{project.import_url} into #{project.full_path} - Failed to import the repository" + expect(result[:message]).to eq "Error importing repository #{project.safe_import_url} into #{project.full_path} - Failed to import the repository" end context 'when repository import scheduled' do |