diff options
author | Kosta Harlan <kharlan@wikimedia.org> | 2024-04-08 12:56:01 +0300 |
---|---|---|
committer | Kosta Harlan <kharlan@wikimedia.org> | 2024-04-23 13:33:57 +0000 |
commit | 6efd008f331c0d843306ad7b2f943e64e9d20485 (patch) | |
tree | 2c896e63bc93a6659d3f07afc9bf17789af708ea /tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php | |
parent | 75b00571a6e659d98b0df265b304bb953105292f (diff) | |
download | mediawikicore-6efd008f331c0d843306ad7b2f943e64e9d20485.tar.gz mediawikicore-6efd008f331c0d843306ad7b2f943e64e9d20485.zip |
TempAccounts: Rate limit acquisition of temp account names
Why:
- We don't want to allow unlimited acquisition of temp account names.
These should be rate limited in similar way to how we limit the
creation of temp accounts
What:
- Provide a TempAccountNameAcquisitionThrottle, and use it in the
acquireName() method
- Set a default that is 10 times the limit of
TempAccountNameCreationThrottle
Depends-On: If660aad1d0f04f366414084aff3f88484a19d416
Bug: T343101
Change-Id: I99d5973498a89ac227847de5837c0a8e895c28fb
Diffstat (limited to 'tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php')
-rw-r--r-- | tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php b/tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php index 9e2c5165b583..3d4fbe7599c2 100644 --- a/tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryImageInfoTest.php @@ -4,6 +4,7 @@ namespace MediaWiki\Tests\Api\Query; use ApiQueryImageInfo; use File; +use MediaWiki\Request\FauxRequest; use MediaWiki\Tests\Api\ApiTestCase; use MediaWiki\Tests\Unit\Permissions\MockAuthorityTrait; use MediaWiki\Tests\User\TempUser\TempUserTestTrait; @@ -114,7 +115,7 @@ class ApiQueryImageInfoTest extends ApiTestCase { $this->enableAutoCreateTempUser(); $this->tempUser = $this->getServiceContainer() ->getTempUserCreator() - ->create()->getUser(); + ->create( null, new FauxRequest() )->getUser(); $tempActorId = $this->getServiceContainer() ->getActorStore() ->acquireActorId( $this->tempUser, $this->db ); |