diff options
author | Matt Larraz <mlarraz@users.noreply.github.com> | 2021-08-19 16:12:04 -0400 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-08-31 19:06:14 +0900 |
commit | 2aed061384f68b10d8a4a973009512cb57999c63 (patch) | |
tree | f1998566e5a0031a4f30e4884f76b6a2d243b687 /spec/bundler/bundler | |
parent | f212b9d4f2eb7f94359778d0ec5f3e38f2d90461 (diff) |
[rubygems/rubygems] Correctly redact credentials when using x-oauth-basic
https://github.com/rubygems/rubygems/commit/290b6ab078
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'spec/bundler/bundler')
-rw-r--r-- | spec/bundler/bundler/env_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/bundler/bundler/env_spec.rb b/spec/bundler/bundler/env_spec.rb index 5d3aeec226..a6f4b2ba85 100644 --- a/spec/bundler/bundler/env_spec.rb +++ b/spec/bundler/bundler/env_spec.rb @@ -127,6 +127,20 @@ RSpec.describe Bundler::Env do end end + context "when there's bundler config with OAuth token credentials" do + before do + bundle "config set https://localgemserver.test/ api_token:x-oauth-basic" + end + + let(:output) { described_class.report(:print_gemfile => true) } + + it "prints the config with redacted values" do + expect(output).to include("https://localgemserver.test") + expect(output).to include("[REDACTED]:x-oauth-basic") + expect(output).to_not include("api_token:x-oauth-basic") + end + end + context "when Gemfile contains a gemspec and print_gemspecs is true" do let(:gemspec) do strip_whitespace(<<-GEMSPEC) |