Changes to the use statements done automatically via script
Addition of missing use statements done manually
Change-Id: Iad87245bf8082193be72f7e482f29e9f1bad11fc
getCsrfToken() previously did the requests to every wiki with the same
'centralauthtoken'. Luckily this wasn't causing any bugs in practice,
because all users of ForeignWikiRequest that need CSRF tokens always
use it with a single wiki.
Change-Id: Ib1c0b9c13a34e38f85faed519c46cabd3b77e61e
Otherwise the parameters are copied from the local API request.
That mostly works fine, but browsing the errors logged for T342201
is a bit confusing when they're in different formats.
Change-Id: I5c361d6c0f7d635d3063290dec25f18bc6417e08
Error messages included a non-existent 'code' parameter; use the
curl error message instead. Also log the error status (which is
there somewhere in 'response' but logstash doesn't manipulate JSON
fields well).
Bug: T328128
Change-Id: If295d7a3b397b22301986a226a54df908c2ccf4d
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().
Bug: T298059
Change-Id: Ia8cbc992eb80ee6d531cf11bdf2bc06181bce8b0
Fixes mapper parsing errors in Logstash because most other producers
generate the response field as an object.
Bug: T239458
Change-Id: I95436dce23efde7f4aa460007187a7544cc36462
This reverts commit 393aace621.
Reason for revert: namespacing reverted in I1d358d178a3999e82e7a25e17851c3cf60d7ddaa.
Change-Id: If4f7ddf51cbd63dc782e61b389b3f45effc13299
This partially reverts commit 83a181ce9c
and fully reverts 82896eff62
To avoid regressing to the errors from T139665, check if the user
retrieved from RequestContext::getMain()->getUser() is safe to load
instead of $wgUser, still in addition to the other checks that
EchoForeignWikiRequest::$user is safe to load.
Bug: T243732
Change-Id: I22c4918fc7e8b3d1364a95de3958c055059971b8
Use the globally configured request timeout instead of MultiHttpClient's
hard-coded default. This means that the request timeout for
ForeignWikiRequest will typically be reduced from 900s to 25s.
Bug: T245170
Depends-On: I8252f6c854b98059f4916d5460ea71cf4b580149
Change-Id: I1c3d96720709253ad15bb8528cdd132571de2e4e
This code improvements seeks to improve on code readability, consistency,
maintainability and efficiency.
Change-Id: I4f07886044e9a75824f9e7ddad039f3112b1c4a1
Add support for POST requests and tokens to EchoForeignRequest
and ApiCrossWiki, and add the ApiCrossWiki trait to ApiEchoMarkRead.
Change-Id: Idadaacd0d0c4a957bf2499049fc105a60c73bc52
There are about 200 of such generic "array" type hints in this code base,
the majority in @param tags. I started with what I found most relevant:
@var and @return tags. I might continue working on this later, but
wanted to stop for now to keep this patch moderately small.
Change-Id: Iff0d9590a794ae0f885466ef6bb336b0b42a6cd3
Explaining that a variable named "$username" contains a "username" is
not helpful. One have to read this comment first to understand that it
does not add anything to what's already obvious from the variable name
and the type.
Change-Id: I9a43866498d0c94422caf16233f502320a8e36c9
Check it for both $wgUser and $this->user because they
could theoretically be different.
Bug: T139665
Change-Id: I59cb4f0122a9fccb32ca165fda065dee2467b1da
If we have a central ID, in theory it should not trigger
CA failures when getting a token. However, it is, so maybe:
* This is the wrong way of checking attached-ness.
* It is somehow losing the central ID later.
or something else is going on.
Bug: T140144
Bug: T119736
Change-Id: I71c6f121a728e503aa9d62778e64c650cd8d46af
Attempting to get a CentralAuth token for an unattached
user (or a user mid-attachment) throws an exception.
Bug: T119736
Change-Id: I2a34754f55b952f5bcd4da6c6f89a32ebc29ecf1