summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_printable_uri.rb
AgeCommit message (Collapse)Author
2021-08-31[rubygems/rubygems] Merge `Gem::UriParser` and `Gem::PrintableUri` into a ↵David Rodríguez
`Gem::Uri` class The new class is a wrapper on top of an URI. And then, when you want credentials redacted, you call `#redacted` that returns a copy of itself, but with credentials redacted. https://github.com/rubygems/rubygems/commit/9581c2740a Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove unnecessary testsDaniel Niknam
We will be passing string to this class so there is no need to be defensive about it. https://github.com/rubygems/rubygems/commit/30bd52a977 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove @credential_redacted instance variableDaniel Niknam
https://github.com/rubygems/rubygems/commit/c3bb52eb5c Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove defensive guardsDaniel Niknam
https://github.com/rubygems/rubygems/commit/dba130cd80 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Rename `Gem::PrintableUri#parsed_uri?` to ↵Daniel Niknam
`Gem::PrintableUri#valid_uri?` https://github.com/rubygems/rubygems/commit/a5177709c9 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Introduce `Gem::PrintableUri` that would redact URIs to ↵Daniel Niknam
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://my-secure-token@example.com` => `http://REDACTED@example.com` - Username & Password: `http://my-username:my-secure-password@example.com` => `http://my-username:REDACTED@example.com` - x-oauth-basic: `http://my-secure-token:x-oauth-basic@example.com` => `http://REDACTED:x-oauth-basic@example.com` https://github.com/rubygems/rubygems/commit/f1e45d3a89 Notes: Merged: https://github.com/ruby/ruby/pull/4789