| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Still some more to go...
Bug: T254646
Change-Id: Ia117f01e443c35b4765f3275cab4f2707e1be96f
|
|
|
|
|
|
|
| |
It does the exact same. The resulting object is still an stdClass
instance.
Change-Id: Ief68609943ee30aa95732d24021c921dfbad166c
|
|
|
|
|
|
|
| |
The first parameter of assertSame() is the expected value, the second
one the actual value.
Change-Id: I5a411403443f18b30c93ab9552f625a70c75f75c
|
|
|
|
| |
Change-Id: I49cb151f64c578f41dc1236b2a8906694ca97b93
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This is done to allow a more easy transition away from UserRightsProxy.
Bug: T255309
Change-Id: I730d28c12ad389e001f18c12662d220cb74f998e
|
|/
|
|
|
|
|
|
| |
Since MediaWiki 1.36, this method is provisioned to replace creating
new instances of the services object. If one is already created and
seen by the service locator, just use it.
Change-Id: I9509497a8380194aa93310343b1896521070fc31
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These not only make the code more robust, but also help a lot when
writing unit tests: if a method is return-typehinted and its class is
mocked, the mock method will automatically return a mock of its declared
return type. Otherwise it will return null, and developers are forced to
manually mock the method if the return value is used by the SUT in a way
that doesn't accept null.
Depends-On: I628fcb1807133390c7b9b47984f512f5b1ae58d0
Depends-On: I7080bc505f5838b2f51a368da562104e206063b0
Change-Id: I59068cfed10aabf6c6002f9e9312a6ef6e7e9441
|
|
|
|
| |
Change-Id: I6e369fe37cecd783b1ed163ccb36cc5d4b5182a4
|
|
|
|
|
| |
Bug: T278254
Change-Id: I3f6d120b4426d8729b8db0336ce6db2b35163f71
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ia731415f627d72811cf7a354721bb0fb28b128eb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|/
|
|
|
|
|
|
|
| |
When an username cannot be a valid actor,
ActorStore::newUserIdentityByName() should return null instead of
throwing an Exception.
Bug: T283167
Change-Id: Id04978cf2a417f2354d5e336ed1b0b67462603e9
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don't actually know where is the given user name coming from
and whether it's been normalized before hitting the storage layer,
so always check if it's a valid user name.
Bug: T273933
Change-Id: Ie9848188c81c95bedff9d18e6398bd3511c459e4
|
|/
|
|
|
|
| |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|
|
|
|
|
|
|
|
|
| |
This is an extremely dangerous method, but it's needed
for the temporary users magic in translate extension.
At least going via ActorStore we can keep our in-process
caches consistent and get rid of some static methods
and caching in user object.
Change-Id: I8157f7ccee7d72aee405e9b6109dfc1838e1f380
|
|
|
|
|
|
|
| |
Multi-key in-memory keys for the actors is complicated
enough to have it's own small abstraction.
Change-Id: Id0e091504b71a44ce52d418c5737d64ac70495e9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While creating users, we have several interesting corner cases:
- When creating a new User, we actually rely on the 'unique'
constraint on actor_name. This is important if something calls
'User::createNew' with a name that is already occupied by an
existing anon actor with no user. This is quite a weird corner case,
but there's a test for that. We could probably assimilate this
nicly in actor store by checking whether the user id in the database
for the actor we found is the same as user id in the passed in user identity.
- Even more interesting use-case is 'subsuming' existing actors with
reserved user names. When we call User::newSystemUser, and there is
already an actor with the same reserved name, we 'subsume' that actor
and take over it's actor_id for our new system user. This can now be
done with an upsert. This state of having reserved actor with no user
is not easy to cause, but imports or updating from old MW versions
seem to be able to produce this state. Archeology revealed that
'subsuming' existing actor was added for installer.
Change-Id: I16b2f088217db0283215fc2ef5fb04a3742e1626
|
|
|
|
| |
Change-Id: I60e2dfef9f7c20c98b02f9fed341d4290ee6ca0b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Code that needs to store an actor ID in the database to
represent a UserIdentity, or needs to construct a UserIdentity based on
an actor ID loaded from the database, should use the ActorNormalization
service.
Note: The getActorId() method is removed from the UserIdentity interface,
but all concrete classes continue to support it for now.
UsererIdentityValue::getActorId() is hard deprecated and should
be removed in 1.37. It always returns 0.
User::getActorId() is not deprecated at this point.
Bug: T274179
Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237
Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: Ic9707c6b74180ef111d128f9f00de218d191c175
|
|/
|
|
|
|
|
|
|
|
|
| |
Surprizingly, PHP treats string "0" as false, so user name "0"
was unconditionally rejected by ActorStore. Even more surprizingly,
we actually have an actor with user name "0" [1], so we need to
explicitly check for nulls instead of just checking for falsy.
[1] https://en.wikipedia.org/wiki/User:0
Change-Id: I535c2aee3e109c3f535e40b747a1c7e4508171cb
|
|
|
|
|
|
|
|
|
|
| |
In case acquireActorId was called as a part of a larger
transaction and it gets rolled back, we need to clean in-process
caches in case something else would try to acquire actor ID
for the same actor again within the same request.
Bug: T277795
Change-Id: I912ebb380a1beead3043ac4c5653df947d613b99
|
|
|
|
|
|
|
| |
Note: User::getActorId() is not (yet) deprecated.
Bug: T274179
Change-Id: Ic2ca6d489db821fc2334e53bf2496c7b0d3ea5b1
|
|\ |
|
| |
| |
| |
| |
| |
| | |
This also introduces minimal instance caching into UserFactory
Change-Id: I594c5668c537477516dda4beecd11b8aa840ae62
|
|/
|
|
|
|
|
|
| |
ActorNormalization should only be used in contexts where a DB connection
is already being used, or at least easily available.
Bug: T276986
Change-Id: Ie8aadaffa4a30e63fcad0502d45b8ec364fc79ef
|
|
|
|
|
|
|
|
|
| |
Replace UserIdentity::getUserId with ::getId
Add $wikiId = self::LOCAL as an optinal parameter to User and
UserIdentity
Bug: T275482
Change-Id: I44494845c469a14284c3e23cb620e5a7cbf59cd5
|
|
|
|
|
|
|
| |
Adding this method was a mistake, there's no good use
for is really.
Change-Id: I0b2ecee7420573092f85f4e19da731a6bd56c50b
|
|
|
|
|
|
|
|
|
|
| |
The findActorIdByName method is intended to be used when we need to
select by actor ID, but all we have is a user name. We can't use
findActorId(), since it requires a UserIdentity, which would needlessly
force us to look up a user ID, resulting in two queries.
Bug: T274179
Change-Id: I0e65d3258fd3d23ebff793ae04d59e027eb51fba
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This introduces a specialized SelectQueryBuilder for
queries related to actor table. So far it's fairly basic,
but in future it is intended to grow.
This patch only introduces the new abstraction, using
it will be separated into separate patches.
Bug: T274223
Change-Id: Ibb1c58016e3956a46bfaf1a9f51f265114bb9ace
|
|\ \
| |/
|/| |
|
| |
| |
| |
| | |
Change-Id: Iba6c5d8fa15952cfef689f8f151f262aaff46417
|
|/
|
|
|
|
| |
Bug: T273974
Depends-On: I8c18d86fe42056fbb676467a6657fd2f62e9c998
Change-Id: Iff5e3f07ac5b1192dd7a9f7f37589d8eae09a746
|
|
|
|
|
|
|
|
|
| |
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
|
|
|
|
|
| |
Bug: T273290
Change-Id: Iff9b67455d337ea03cb728dd570c4ce760c39e49
|
|
|
|
|
|
|
|
|
| |
The order $userId, $name, $actorId is more consistent
with existing order of arguments in UIV constructor,
User::newFromAnyId etc. Even though it's not as logical
as placing the primary key argument first, it's more practical.
Change-Id: Ic36c0ee451cf6825976e374f0c2f721085c0a507
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ActorNormalization factory methods create
UserIdentityValue from the database rows, either via
fields of a joined table, or via a row from actor table.
They assume that the actor_id exist and throw othervise.
ActorNormalization is a storage-layer service providing
access to finding and acquiring actor_id.
The UserIdentityLookup methods do not instantiate new actor
on demand, they just find an appropriate row in the actor
table and return the result.
Bug: T272689
Depends-On: I74d81f3f0233efb17fc8df5178e4c477cc669c6f
Change-Id: Icfa1daca960c696a8cef8adab5eab53985802858
|
|
|
|
|
| |
Bug: T271460
Change-Id: If1038c94ccf8f3e59b5242f5c33b66f076c60816
|
|
|
|
|
|
| |
Bug: T253432
Depends-On: If5e76f2ae570ef4ae58cb77b5281c4446a1cadff
Change-Id: I9286d4a69911a84661cba40c55c0a4e3f1b7f7f3
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Convert everything that is protected to be private,
since the class is not stable to extend
* Remove PasswordReset::$hookContainer, unneeded
Additionally, add missing UserFactory::newFromRow,
for now just a wrapper for User::newFromRow
Bug: T253432
Change-Id: I1de57a08605ff6e0d2be8e276b7fcb08934fb5da
|
|
|
|
|
|
|
|
| |
Create a method in UserFactory to instantiate an anonymous
user with an optional IP address.
Bug: T257464
Change-Id: I557620f9bcd4b646288b4a76b26c4730fccbc3d8
|
|
|
|
|
|
|
|
|
|
|
| |
Makes it possible to mock static User methods in tests;
actually introducing dependency injection to the User class is left for
the future.
New class has 100% code coverage
Bug: T253432
Change-Id: I0b93da09124d95beafd84e932b214909ce920230
|
|
Replaces watchlist notification methods in Title and User classes:
* Title::getNotificationTimestamp -> ::getTitleNotificationTimestamp
* User::clearNotification -> ::clearTitleUserNotifications
* User::clearAllNotifications -> ::clearAllUserNotifications
New service has 67.90% code coverage with pure Unit tests; as well
as integration tests for the DeferredUpdates part
A follow-up patch will deprecate the replaced methods, as well
as document that the `UserClearNewTalkNotification` hook now only
provides a UserIdentity (typehint added in T253435 but until now
a full User was still provided).
Bug: T208777
Change-Id: I6f388c04cb9dc65b20ff028ece607c3dc131dfc5
|