Page MenuHomePhabricator

D19356.diff
No OneTemporary

D19356.diff

diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -431,10 +431,12 @@
$uri = $repository->getAlmanacServiceURI(
$viewer,
- $is_cluster_request,
array(
- 'http',
- 'https',
+ 'neverProxy' => $is_cluster_request,
+ 'protocols' => array(
+ 'http',
+ 'https',
+ ),
));
if ($uri) {
$future = $this->getRequest()->newClusterProxyFuture($uri);
diff --git a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
@@ -151,9 +151,11 @@
$is_cluster_request = $this->getIsClusterRequest();
$uri = $repository->getAlmanacServiceURI(
$viewer,
- $is_cluster_request,
array(
- 'ssh',
+ 'neverProxy' => $is_cluster_request,
+ 'protocols' => array(
+ 'ssh',
+ ),
));
if ($uri) {
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -1897,14 +1897,22 @@
* services, returning raw URIs.
*
* @param PhabricatorUser Viewing user.
- * @param bool `true` to throw if a remote URI would be returned.
- * @param list<string> List of allowable protocols.
+ * @param map<string, wild> Constraints on selectable services.
* @return string|null URI, or `null` for local repositories.
*/
public function getAlmanacServiceURI(
PhabricatorUser $viewer,
- $never_proxy,
- array $protocols) {
+ array $options) {
+
+ PhutilTypeSpec::checkMap(
+ $options,
+ array(
+ 'neverProxy' => 'bool',
+ 'protocols' => 'list<string>',
+ ));
+
+ $never_proxy = $options['neverProxy'];
+ $protocols = $options['protocols'];
$cache_key = $this->getAlmanacServiceCacheKey();
if (!$cache_key) {
@@ -2077,10 +2085,12 @@
$uri = $this->getAlmanacServiceURI(
$viewer,
- $never_proxy,
array(
- 'http',
- 'https',
+ 'neverProxy' => $never_proxy,
+ 'protocols' => array(
+ 'http',
+ 'https',
+ ),
));
if ($uri === null) {
return null;

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 19, 4:59 AM (3 d, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7386041
Default Alt Text
D19356.diff (2 KB)

Event Timeline