1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +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:
Saulius Zemaitaitis 2013-11-22 11:22:25 -08:00 committed by epriestley
parent b154b07f0e
commit 4910a36563

View file

@ -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);
}