1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-28 09:42:40 +01:00

Handle ERR-INVALID-AUTH responses from Conduit in patch workflow

Summary:
Conduit responds to requests with either `ERR-INVALID-SESSION` or `ERR-INVALID-AUTH` if the request wasn't sufficiently authenticated. Arcanist's `patch` workflow can automatically attempt to recover from situations in which Conduit responds to unauthenticated requests with `ERR-INVALID-SESSION` (by resending an authenticated version of the request), but not `ERR-INVALID-AUTH` - recover from `ERR-INVALID-AUTH` in the same way.

Closes T15333

Test Plan: The company I work for has been running a local clone of Arcanist containing this change in production for over 18 months now with no problems.

Reviewers: #blessed_committers, O1 Blessed Committers, valerio.bozzolan, avivey

Reviewed By: #blessed_committers, O1 Blessed Committers, valerio.bozzolan, avivey

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15333

Differential Revision: https://we.phorge.it/D25178
This commit is contained in:
Chris Novakovic 2021-09-13 13:19:15 +01:00
parent 82d1abd4ed
commit 12484acfc8

View file

@ -391,7 +391,8 @@ EOTEXT
break; break;
} }
} catch (ConduitClientException $ex) { } catch (ConduitClientException $ex) {
if ($ex->getErrorCode() == 'ERR-INVALID-SESSION') { if ($ex->getErrorCode() == 'ERR-INVALID-SESSION' ||
$ex->getErrorCode() == 'ERR-INVALID-AUTH') {
// Phabricator is not configured to allow anonymous access to // Phabricator is not configured to allow anonymous access to
// Differential. // Differential.
$this->authenticateConduit(); $this->authenticateConduit();