Commit graph

4598 commits

Author SHA1 Message Date
Translation updater bot
d7096d396c Localisation updates from https://translatewiki.net.
Change-Id: I4174fc3bca40d45f06dd93af10d009d23acae375
2016-06-07 22:13:01 +02:00
jenkins-bot
9cbc779ae7 Merge "Call ChangeAuthenticationDataAudit from the API" 2016-06-07 14:02:16 +00:00
Gergő Tisza
8466e5c509 Call ChangeAuthenticationDataAudit from the API
Bug: T137193
Change-Id: I2f7a7da2eb9973ed8f946c52e9821ed962dcd7ba
2016-06-07 13:47:12 +00:00
Aaron Schulz
27e6e29888 Remove getOptions() checks from getStashKey() entirely
It only avoided a tiny edge case of options lag, which is
not worth the complexity.

Change-Id: I94bc35fc89eb46436a23b10aee1b7d339859c7ea
2016-06-06 17:27:37 -07:00
Aaron Schulz
58886b169a Make edit stash keys less preference sensitive
Only factor in the user ID/name/sig instead of anything that
might happen to touch the user row.

Bug: T136678
Change-Id: I004790a017c68cfcff6729f6fbfd0f79b6904c20
2016-06-06 22:03:11 +00:00
Translation updater bot
2da2c6eb1c Localisation updates from https://translatewiki.net.
Change-Id: I961120816132dc1a46f62e25b7223006a727aa32
2016-06-05 21:52:21 +02:00
Translation updater bot
b862718fc6 Localisation updates from https://translatewiki.net.
Change-Id: Ib2318bbccf83f08e9f32c97b6fea0c6baa6d1cd7
2016-06-03 22:47:23 +02:00
Erik Bernhardson
5e65ae8f64 Don't lose namespace when searching via api
A recent patch, I66be724d, introduced a regression that no longer
applied user selected namespaces to the search engine. Fix that up so we
give the correct responses to api rqeuests.

Change-Id: I8e5e180cb143ae3cddeb12f51bc7aae75b20fe58
2016-06-02 13:12:20 -07:00
Translation updater bot
bc789fd18c Localisation updates from https://translatewiki.net.
Change-Id: I1dc0bbb38277e8c24ace6b53e835d8d5020de50f
2016-06-02 21:55:40 +02:00
Translation updater bot
346e00bb7a Merge "Localisation updates from https://translatewiki.net." 2016-06-01 20:43:13 +00:00
jenkins-bot
ea41b271ee Merge "Expose SearchEngine specific profiles" 2016-06-01 20:36:03 +00:00
Translation updater bot
5fa1ba7e23 Localisation updates from https://translatewiki.net.
Change-Id: I58c9f2c935838e27afd48890da19fda98d6c792e
2016-06-01 22:34:22 +02:00
jenkins-bot
0eee510586 Merge "Return error message in users API cancreate field" 2016-05-31 17:01:07 +00:00
jenkins-bot
d9fab38793 Merge "AuthManager fixups around the login→RESTART→create flow" 2016-05-31 16:41:53 +00:00
Brad Jorsch
9bb2875e2e AuthManager fixups around the login→RESTART→create flow
* ApiQueryAuthManagerInfo will differentiate between preserved linking
  data and a preserved createRequest.
* ApiQueryAuthManagerInfo will indicate the preserved username, if any,
  because the client will have to pass that back to action=createaccount.
* ApiClientLogin won't tell about the confusing
  CreateFromLoginAuthenticationRequest returned on RESTART responses.
* Explain how 'preservestate' works in ApiAMCreateAccount's auto-doc.
* ConfirmLinkSecondaryAuthenticationProvider will filter out requests
  that can no longer be used (i.e. if it was for linking the account
  that got used for creation).
* All the complicated code in AuthManager::beginAccountCreation() was
  trying to deal with allowing the client to pass only the
  CreateFromLoginAuthenticationRequest. That was dumb, removed it.
* Added methods to CreateFromLoginAuthenticationRequest to indicate its
  status with respect to different kinds of preserved state.
* Increase accuracy of the AuthenticationResponse::$createRequest doc.

Change-Id: I726d79de18e739d6e60c1eea51453433c21ba207
2016-05-31 11:44:02 -04:00
Translation updater bot
d27ae619c5 Localisation updates from https://translatewiki.net.
Change-Id: Iafc12789c203b6b3d1ce0f81136f139a023ed972
2016-05-30 21:56:25 +02:00
dcausse
31680aaddc Expose SearchEngine specific profiles
This patch introduces a way for SearchEngine implementations to expose
specific search profiles useful to fine-tune the various behaviors related to
search.

A SearchEngine can expose a list of profiles by overriding
SearchEngine::getProfiles( $profileType ), profileType stands for the type of
profile being customized. Two types are added in this patch:
- completion: exposed by ApiQueryPrefixSearch and ApiOpenSearch to control
  the behavior of the algorithm behind "search as you type" suggestions.
- fulltext query independent profiles: exposed by ApiQuerySearch to customize
  query indpendent ranking profiles (e.g. boost by templates/incoming
  links/popularity/...)

This patch allows api consumers that might have been confused by fuzzy
suggestions to switch to stricter profiles and to officialize the behavior
behind the hidden param cirrusUseCompletionSuggester. Or to control the
fulltext ranking behaviors like cirrusBoostLinks=(yes|no).

The list of profiles can be discovered by using ApiSandbox/ApiHelp and is totally
controlled by search engine implementations.

Bug: T132477
Change-Id: I66be724d8975976c98c91badbf421f237e014f89
2016-05-30 20:43:53 +02:00
Gergő Tisza
43f4a05ec3 Return error message in users API cancreate field
That API field exposes AuthManager::canCreateAccount, where the error
message is important.

Change-Id: Idef441b311b94ff0cb6c4deaed1ac93959ee7ee8
2016-05-30 20:16:07 +02:00
Timo Tijhof
227f0c3902 Fix rvtoken=rollback in ApiQueryRevisions
Follows-up 9af38c0. Token must match ApiRollback, RollbackAction,
Linker, and WikiPage. (This should not be in different 5 places!)

This broke the "PILT" gadget.

Bug: T136375
Change-Id: Ia6b6879a952925ec52fa627ba57991bc87fd947a
2016-05-30 17:16:30 +01:00
jenkins-bot
f4a2198abf Merge "API: Fixes for AuthManager" 2016-05-30 12:37:34 +00:00
Brad Jorsch
e10f96cff1 API: Fixes for AuthManager
* Set API response metadata on the AuthenticationRequest metadata so it
  is output as an assoc generally.
* Remove the 'image' field in AuthenticationRequest::getFieldInfo()'s
  response, since we ended up not using it anywhere.
* Make it so meta=authmanagerinfo can be used on private wikis without
  logging in, so action=clientlogin can be used to log in.
** This generalizes the exception for meta=tokens that was added in
   I83dafb030.
* ApiAuthManagerInfo needs the "messageformat" parameter.
* ApiAuthManagerInfo shouldn't be publically cached, since the responses
  vary depending on session state.

Change-Id: Iea5ddb4ef9febed18f16a7ae8314968026f39148
2016-05-30 08:25:19 -04:00
Translation updater bot
0e961a8f6a Localisation updates from https://translatewiki.net.
Change-Id: I8038db5de26e5efb0b801902e8ce51536af5e47b
2016-05-28 21:54:09 +02:00
Translation updater bot
dd738aac80 Localisation updates from https://translatewiki.net.
Change-Id: I47fe8c2cc2ff6457d934627dbe71842a34e4c48d
2016-05-27 21:58:00 +02:00
Aaron Schulz
5051edd835 Send edit stash metrics for cache attempts
Change-Id: I22d5626cca55c2cc35e1b33fced5902e8d364d40
2016-05-26 21:02:39 +00:00
jenkins-bot
34a6750d1f Merge "Bail out in ApiStashEdit for bots for sanity" 2016-05-26 20:11:01 +00:00
Translation updater bot
beb90781c0 Localisation updates from https://translatewiki.net.
Change-Id: I04fc4e9de4d4d0f4c8a13d559d6eafa91f1d70ac
2016-05-26 21:59:57 +02:00
Aaron Schulz
d690083213 Bail out in ApiStashEdit for bots for sanity
checkCache() is disabled in this case anyway.

Change-Id: I1c18585eecc1a7c4c0e24546799c7ee448b3ea57
2016-05-26 19:59:16 +00:00
Aaron Schulz
cddfe0d98f Exclude bots from edit stash stats
Change-Id: Id309879eaaf039de7ac5f531930fa8e758a959c7
2016-05-26 11:36:40 -07:00
jenkins-bot
6843a4c844 Merge "Avoid DBPerformance warnings on PURGE/TRACE requests" 2016-05-26 16:45:07 +00:00
Aaron Schulz
7f8d016f5a Avoid DBPerformance warnings on PURGE/TRACE requests
The former sometimes show up in the logs as they were causing
CentralAuth to use the master but the expectations treated
the request as a GET request. This makes things more
consistent.

Bug: T92357
Change-Id: I55bf3139c68f5926fe67a51cf0eb1b2ffe55d17b
2016-05-25 18:22:26 -07:00
jenkins-bot
61ac2e2d0e Merge "Use correct module name for stats in executeActionWithErrorHandling()" 2016-05-25 23:31:53 +00:00
Translation updater bot
fcb200fd49 Localisation updates from https://translatewiki.net.
Change-Id: I7108f988a2c97e99bb3f889d0ecea55fceb0d95f
2016-05-25 21:59:28 +02:00
Aaron Schulz
542640f4e2 Use correct module name for stats in executeActionWithErrorHandling()
Change-Id: I7d300525c32877d6fcc940962c93b932dc4c9181
2016-05-25 12:31:19 -07:00
Translation updater bot
0a26e28db1 Localisation updates from https://translatewiki.net.
Change-Id: I3941ec39a42414aa051ab58922267e143c5b30f1
2016-05-24 22:21:58 +02:00
jenkins-bot
4bd688c442 Merge "RollbackAction: Implement AJAX interface and require POST" 2016-05-23 21:02:50 +00:00
Translation updater bot
5bff74281b Localisation updates from https://translatewiki.net.
Change-Id: I00c9bd3bf3a03e38b1cc2573212bfae257d3dc4c
2016-05-23 22:00:48 +02:00
Timo Tijhof
9af38c046c RollbackAction: Implement AJAX interface and require POST
Similar to WatchAction (converted in commit 77cdf1919).

* Make FormAction::getFormFields not abstract.
  In most cases this will just be an empty array.

* Convert RollbackAction from FormlessAction to FormAction and implement the
  required error handling scenarios (mostly moved out of from the old method, or
  duplicated from the WikiPage method where necessary).

* In most cases the in-between form is never used since a JavaScript handler
  takes over the link and uses the API over AJAX instead. In the no-js fallback
  (as well as for any existing tokenless rollback links) copy the GET parameters
  into the form for re-submission as POST (plus token, added by HTMLForm).

* Remove the distinction between WebUI and API tokens. This stronger token salt made it
  unnecessarily complex and was only there because it used GET until now. This streamlining of
  tokens matches what we already do for 'watch', 'edit', 'patrol' and other actions.

* Fix form submission bugs when 'from' query parameter is missing.

  - Ensure the required 'from' query parameter is present before showing a form.
    No need for the user to submit a form we know will fail.

  - Plain GET request to action=rollback (with no parameters) is now a 400 Bad Request
    instead of a form that would fail when submitted.

  - Submitting the form without 'form' field now correctly says why it failed.
    Previously it emitted a session error, which was a lie.

Bug: T88044
Change-Id: Ia457802fec2e90573c8e7d552bc1f3cee258f10b
2016-05-23 20:00:48 +01:00
jenkins-bot
67a97fced6 Merge "Language: Introduce new method equals( Language $lang )" 2016-05-23 16:03:50 +00:00
Translation updater bot
dfabb9e95f Localisation updates from https://translatewiki.net.
Change-Id: Icdeee9242c04b5417eb60a2c268e88d9c0a40896
2016-05-22 21:58:03 +02:00
Translation updater bot
88754ec791 Localisation updates from https://translatewiki.net.
Change-Id: I81eef8d9acdd8a2f0e0adeca28bfad36882e0fe9
2016-05-21 21:59:59 +02:00
Amire80
a2f838d9c1 Add missing samp tags and closing kbd tag
In:
* apihelp-clientlogin-example-login2
* api-help-authmanager-general-usage

Also fix a typo in api-help-authmanager-general-usage.

Change-Id: I2a9f6c46c992fda9a21068dd789043d5ef626311
2016-05-21 13:26:00 +03:00
Translation updater bot
81d862e34d Localisation updates from https://translatewiki.net.
Change-Id: Ia6f9b128f9747919c7263200b639ef8207079f3f
2016-05-20 21:56:30 +02:00
umherirrender
72632115d6 Fix various phpcs error from last security patches
Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-trusty/1069/console

Breaking merges

Change-Id: If01b94705cd7b939ac380053730b1b602c838a8e
2016-05-20 20:20:36 +02:00
Brad Jorsch
8a00ddbf35 SECURITY: Rate limit moves via the API
While rate limiting has been applied to moves via the web UI since rate
limiting was first added, it appears that it was overlooked when ApiMove
was created.

This follows the same model as is followed by the web UI: each
submission to ApiMove is one "hit" for the rate limiter, even though
that submission might result in multiple pages being moved (e.g. the
page, its talk page, and its subpages) depending on the options and user
rights.

Bug: T132874
Change-Id: I564d8bfcc7dd3ad6d92dbbc33519a589697c0d4e

Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
2016-05-20 09:49:33 -07:00
Brad Jorsch
f459c1aeca SECURITY: Improve cross-domain-policy mangling
Take into account that the tag might have parameters.

Bug: T123653
Change-Id: Ie9799f5ea45badfb4e7b4be7e7fbc1c35cc86f26

Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
2016-05-20 09:48:11 -07:00
Brad Jorsch
9ec1ef7308 API: Add "standard" header and hook for lacksSameOriginSecurity()
The header is intended for use with XMLHttpRequest when the request
might be part of an XSS. The hook is for extensions that might need to
add additional checks of some sort.

Bug: T98313
Change-Id: I0e5f2d3b29a79a12461dc33c90c812a56810f536

Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
2016-05-20 09:25:14 -07:00
Translation updater bot
b84928c66f Localisation updates from https://translatewiki.net.
Change-Id: I23caefae3374028db6475f66244c1ec3627f49ec
2016-05-19 21:57:18 +02:00
Brad Jorsch
a932d0c429 API: Handle shorthand "all groups" configuration in ApiQuerySiteInfo
In $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, and
$wgGroupsRemoveFromSelf, boolean true in place of an array of groups to
allow adding/removing is shorthand for "all groups". Handle this
appropriately in action=query&meta=siteinfo&siprop=usergroups.

Bug: T135467
Change-Id: I6ae61ef14ac7932e3369155c56bad60a9d72060d
2016-05-19 18:53:57 +00:00
jenkins-bot
cdc53ad15b Merge "API: Avoid duplicate IDs in API documentation" 2016-05-19 17:57:26 +00:00
Translation updater bot
cde7c422dc Localisation updates from https://translatewiki.net.
Change-Id: I8f24e94f2d29d5befd905c8e4cb5fa89002ecd38
2016-05-18 21:53:47 +02:00