summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsamisalamiws <62200850+samisalamiws@users.noreply.github.com>2022-01-17 13:47:27 +0200
committergit <svn-admin@ruby-lang.org>2024-11-08 12:15:31 +0000
commitfbe35bcc825fbae215f6ff283731f5e2f4a55a88 (patch)
tree07180b692783c62780f64dfaf0a8257d1446acfa /lib
parent10d694a1ffdcdaae67a693bb68c4bd658ec2d157 (diff)
[rubygems/rubygems] Fix private registry credentials being written to logs
https://github.com/rubygems/rubygems/commit/d070fa10c1 Co-authored-by: Artem Ignatyev <zazubrik@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/rubygems_integration.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 86396b01e4..6576330f7a 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -393,7 +393,9 @@ module Bundler
def download_gem(spec, uri, cache_dir, fetcher)
require "rubygems/remote_fetcher"
uri = Bundler.settings.mirror_for(uri)
- Bundler::Retry.new("download gem from #{uri}").attempts do
+ redacted_uri = Gem::Uri.redact(uri)
+
+ Bundler::Retry.new("download gem from #{redacted_uri}").attempts do
gem_file_name = spec.file_name
local_gem_path = File.join cache_dir, gem_file_name
return if File.exist? local_gem_path
@@ -415,7 +417,7 @@ module Bundler
end
end
rescue Gem::RemoteFetcher::FetchError => e
- raise Bundler::HTTPError, "Could not download gem from #{uri} due to underlying error <#{e.message}>"
+ raise Bundler::HTTPError, "Could not download gem from #{redacted_uri} due to underlying error <#{e.message}>"
end
def build(spec, skip_validation = false)