mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Feature #881
- Passwords in URIs will now be obscured (affects the commands show, merge, pull and push)
This commit is contained in:
parent
f20163ef7d
commit
edad4d2ee6
2 changed files with 23 additions and 5 deletions
|
@ -38,6 +38,7 @@
|
|||
#include <Directory.h>
|
||||
#include <ViewText.h>
|
||||
#include <CmdShow.h>
|
||||
#include <Uri.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
|
@ -276,9 +277,20 @@ int CmdShow::execute (std::string& output)
|
|||
else if (std::find (default_values.begin (), default_values.end (), *i) != default_values.end ())
|
||||
color = warning;
|
||||
|
||||
std::string value = context.config.get (*i);
|
||||
// hide sensible information
|
||||
if ( (i->substr (0, 5) == "push." ||
|
||||
i->substr (0, 5) == "pull." ||
|
||||
i->substr (0, 6) == "merge.") && (i->find (".uri") != std::string::npos) ) {
|
||||
|
||||
Uri uri (value);
|
||||
uri.parse ();
|
||||
value = uri.ToString ();
|
||||
}
|
||||
|
||||
int row = view.addRow ();
|
||||
view.set (row, 0, *i, color);
|
||||
view.set (row, 1, context.config.get (*i), color);
|
||||
view.set (row, 1, value, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue