PhutilOAuth1Future does not contain a default User Agent

IMPORTANT

  • Bug reports MUST include reproduction instructions which allow someone who does not have access to your environment to reproduce the issue you’re encountering.
  • Bug reports MUST be against a recent version of Phabricator, and include version information. You can find version information in “Config > Version Information” in the web UI, or arc version from the CLI.

Reproduction Instructions
Complete steps which allow someone else who does not have access to your environment to reproduce the bug.

When using PhutilOAuth1Future to connect to a oauth server (e.g for us we are using mediawiki), the user argent is empty (or “-” in nginx). Digging, we see that there is a default UA for HTTPFuture but none for PhutilOAuth1Future. I think a default UA should be added to FutureProxy or at least make it customisable (extensionable using a extension).

Request:

xxxx - - [03/Aug/2020:19:02:28 +0000] “POST https://meta.miraheze.org/w/index.php?oauth_callback=https://phabricator.miraheze.org/auth/login/mediawiki:mediawiki.meta/xxx/&title=Special:OAuth/initiate” 200 126 “-” “-” 0.085 TLSv1.3/TLS_AES_256_GCM_SHA384.

Hacking https://github.com/phacility/arcanist/blob/9b74cb4ee6412aca411f4698a70eb9b0dadbe13f/src/future/oauth/PhutilOAuth1Future.php#L141 to add it, worked.

Phabricator/Arcanist Version
Output from Config > Version Information or arc version.

8f9ba4852861/65cda1596f25

Please let me know if you need more info, I filed this under “bug” because I think this is unintended behaviour. We only noticed this after blocking empty user agents due to a incident.

This is intended.