@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Censor credentials possibly present in Git remote URIs when pulls fail because of a URI mismatch

Summary: Fixes T12945.

Test Plan:
Mostly faked this, got a censored error:

```
$ ./bin/repository update R38
[2017-07-31 19:40:13] EXCEPTION: (Exception) Working copy at "/Users/epriestley/dev/core/repo/local/38/" has a mismatched origin URI, "https://********@example.com/". The expected origin URI is "https://github.com/phacility/libphutil.git". Fix your configuration, or set the remote URI correctly. To avoid breaking anything, Phabricator will not automatically fix this. at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryEngine.php:186]
```

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12945

Differential Revision: https://secure.phabricator.com/D18304

+7 -2
+7 -2
src/applications/repository/engine/PhabricatorRepositoryEngine.php
··· 135 135 $exists = true; 136 136 } 137 137 138 + // These URIs may have plaintext HTTP credentials. If they do, censor 139 + // them for display. See T12945. 140 + $display_remote = phutil_censor_credentials($remote_uri); 141 + $display_expect = phutil_censor_credentials($expect_remote); 142 + 138 143 if (!$valid) { 139 144 if (!$exists) { 140 145 // If there's no "origin" remote, just create it regardless of how ··· 172 177 'set the remote URI correctly. To avoid breaking anything, '. 173 178 'Phabricator will not automatically fix this.', 174 179 $repository->getLocalPath(), 175 - $remote_uri, 176 - $expect_remote); 180 + $display_remote, 181 + $display_expect); 177 182 throw new Exception($message); 178 183 } 179 184 }