mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Set reasonable defaults when displaying remote repository URIs.
Summary: Show SSH user on git-over-ssh repositories and hide both username and password for other repos. Test Plan: View repository details page in diffusion, Clone URI should appear with a username (taken from repo config) and any http(s) repos should be without usernames. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4147 Differential Revision: https://secure.phabricator.com/D7631
This commit is contained in:
parent
b154b07f0e
commit
4910a36563
1 changed files with 4 additions and 8 deletions
|
@ -580,14 +580,10 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
|||
// Make sure we don't leak anything if this repo is using HTTP Basic Auth
|
||||
// with the credentials in the URI or something zany like that.
|
||||
|
||||
if ($uri instanceof PhutilGitURI) {
|
||||
if (!$this->getDetail('show-user', false)) {
|
||||
$uri->setUser(null);
|
||||
}
|
||||
} else {
|
||||
if (!$this->getDetail('show-user', false)) {
|
||||
$uri->setUser(null);
|
||||
}
|
||||
// If repository is not accessed over SSH we remove both username and
|
||||
// password.
|
||||
if (!$this->shouldUseSSH()) {
|
||||
$uri->setUser(null);
|
||||
$uri->setPass(null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue