Page MenuHomePhabricator

D16091.diff
No OneTemporary

D16091.diff

diff --git a/scripts/arcanist.php b/scripts/arcanist.php
--- a/scripts/arcanist.php
+++ b/scripts/arcanist.php
@@ -284,7 +284,9 @@
$blind_key = 'https.blindly-trust-domains';
$blind_trust = $configuration_manager->getConfigFromAnySource($blind_key);
if ($blind_trust) {
- HTTPSFuture::setBlindlyTrustDomains($blind_trust);
+ $trust_extension = PhutilHTTPEngineExtension::requireExtension(
+ ArcanistBlindlyTrustHTTPEngineExtension::EXTENSIONKEY);
+ $trust_extension->setDomains($blind_trust);
}
if ($need_conduit) {
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -36,6 +36,7 @@
'ArcanistBinaryNumericScalarCasingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistBinaryNumericScalarCasingXHPASTLinterRuleTestCase.php',
'ArcanistBlacklistedFunctionXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistBlacklistedFunctionXHPASTLinterRule.php',
'ArcanistBlacklistedFunctionXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistBlacklistedFunctionXHPASTLinterRuleTestCase.php',
+ 'ArcanistBlindlyTrustHTTPEngineExtension' => 'configuration/ArcanistBlindlyTrustHTTPEngineExtension.php',
'ArcanistBookmarkWorkflow' => 'workflow/ArcanistBookmarkWorkflow.php',
'ArcanistBraceFormattingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistBraceFormattingXHPASTLinterRule.php',
'ArcanistBraceFormattingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistBraceFormattingXHPASTLinterRuleTestCase.php',
@@ -450,6 +451,7 @@
'ArcanistBinaryNumericScalarCasingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
'ArcanistBlacklistedFunctionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistBlacklistedFunctionXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
+ 'ArcanistBlindlyTrustHTTPEngineExtension' => 'PhutilHTTPEngineExtension',
'ArcanistBookmarkWorkflow' => 'ArcanistFeatureWorkflow',
'ArcanistBraceFormattingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistBraceFormattingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
diff --git a/src/configuration/ArcanistBlindlyTrustHTTPEngineExtension.php b/src/configuration/ArcanistBlindlyTrustHTTPEngineExtension.php
new file mode 100644
--- /dev/null
+++ b/src/configuration/ArcanistBlindlyTrustHTTPEngineExtension.php
@@ -0,0 +1,27 @@
+<?php
+
+final class ArcanistBlindlyTrustHTTPEngineExtension
+ extends PhutilHTTPEngineExtension {
+
+ const EXTENSIONKEY = 'arc.https.blind';
+
+ private $domains = array();
+
+ public function setDomains(array $domains) {
+ foreach ($domains as $domain) {
+ $this->domains[phutil_utf8_strtolower($domain)] = true;
+ }
+ return $this;
+ }
+
+ public function getExtensionName() {
+ return pht('Arcanist HTTPS Trusted Domains');
+ }
+
+ public function shouldTrustAnySSLAuthorityForURI(PhutilURI $uri) {
+ $domain = $uri->getDomain();
+ $domain = phutil_utf8_strtolower($domain);
+ return isset($this->domains[$domain]);
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 12:52 PM (10 h, 48 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6774837
Default Alt Text
D16091.diff (3 KB)

Event Timeline