1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Set base-uri as User-Agent for OAuth1 and Github authentication

Summary: Closes T15848

Test Plan: Unclear.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15848

Differential Revision: https://we.phorge.it/D25758
This commit is contained in:
Andre Klapper 2024-08-01 16:29:41 +02:00
parent 0fe0b9f681
commit 39237c0854
2 changed files with 4 additions and 1 deletions

View file

@ -55,7 +55,8 @@ final class PhutilGitHubAuthAdapter extends PhutilOAuthAuthAdapter {
$future = new HTTPSFuture($uri);
// NOTE: GitHub requires a User-Agent string.
$future->addHeader('User-Agent', __CLASS__);
$future->addHeader('User-Agent',
PhabricatorEnv::getEnvConfig('phabricator.base-uri'));
// See T13485. Circa early 2020, GitHub has deprecated use of the
// "access_token" URI parameter.

View file

@ -100,6 +100,8 @@ abstract class PhutilOAuth1AuthAdapter extends PhutilAuthAdapter {
protected function newOAuth1Future($uri, $data = array()) {
$future = id(new PhutilOAuth1Future($uri, $data))
->addHeader('User-Agent',
PhabricatorEnv::getEnvConfig('phabricator.base-uri'))
->setMethod('POST')
->setSignatureMethod($this->getSignatureMethod());