mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-18 09:48:38 +01:00
hack up arc patch to not differential.query if its not authenticated
Summary: 'cuz the method would fail without authentication! see D1604 for some discussion on approaches here Test Plan: ran arc patch and it worked Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley, johnduhart Maniphest Tasks: T856 Differential Revision: https://secure.phabricator.com/D1645
This commit is contained in:
parent
b24c228b5c
commit
298ed9cda5
2 changed files with 16 additions and 2 deletions
|
@ -158,7 +158,7 @@ abstract class ArcanistBaseWorkflow {
|
||||||
* @task conduit
|
* @task conduit
|
||||||
*/
|
*/
|
||||||
final public function setConduitCredentials(array $credentials) {
|
final public function setConduitCredentials(array $credentials) {
|
||||||
if ($this->conduitAuthenticated) {
|
if ($this->isConduitAuthenticated()) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"You may not set new credentials after authenticating conduit.");
|
"You may not set new credentials after authenticating conduit.");
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ abstract class ArcanistBaseWorkflow {
|
||||||
* @task conduit
|
* @task conduit
|
||||||
*/
|
*/
|
||||||
final public function authenticateConduit() {
|
final public function authenticateConduit() {
|
||||||
if ($this->conduitAuthenticated) {
|
if ($this->isConduitAuthenticated()) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +258,14 @@ abstract class ArcanistBaseWorkflow {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool True if conduit is authenticated, false otherwise.
|
||||||
|
* @task conduit
|
||||||
|
*/
|
||||||
|
final protected function isConduitAuthenticated() {
|
||||||
|
return (bool) $this->conduitAuthenticated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override this to return true if your workflow requires a conduit channel.
|
* Override this to return true if your workflow requires a conduit channel.
|
||||||
|
|
|
@ -770,6 +770,12 @@ EOTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadRevisionFromHash($hash) {
|
private function loadRevisionFromHash($hash) {
|
||||||
|
// TODO -- de-hack this as permissions become more clear with things
|
||||||
|
// like T848 (add scope to OAuth)
|
||||||
|
if (!$this->isConduitAuthenticated()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$conduit = $this->getConduit();
|
$conduit = $this->getConduit();
|
||||||
|
|
||||||
$revisions = $conduit->callMethodSynchronous(
|
$revisions = $conduit->callMethodSynchronous(
|
||||||
|
|
Loading…
Add table
Reference in a new issue