diff options
author | Daniel Niknam <[email protected]> | 2021-08-22 01:31:03 +1000 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2021-08-31 19:06:14 +0900 |
commit | b41802421ac7e790a98ed59be67631687fc5808f (patch) | |
tree | 87886d29e29bec9f30790ea7cd12a89befc4f746 /lib/rubygems/commands/install_command.rb | |
parent | 14a9e24f7ea161056b56f4833fd8bbecd7718905 (diff) |
[rubygems/rubygems] Introduce `Gem::PrintableUri` that would redact URIs to be used on outputs
We need to redact URI credential in several places and copy pasting the code into each part of it is not ideal. This class is responsible for parsing URI strings and redacting credential from it. Also, it will handle URI object in the same manner. We will be reusing this class whenever we need to print/display a URI to users.
URI with the following format will be redacted:
- Token: `http://[email protected]` => `http://[email protected]`
- Username & Password: `http://my-username:[email protected]` => `http://my-username:[email protected]`
- x-oauth-basic: `http://my-secure-token:[email protected]` => `http://REDACTED:[email protected]`
https://github.com/rubygems/rubygems/commit/f1e45d3a89
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib/rubygems/commands/install_command.rb')
0 files changed, 0 insertions, 0 deletions