aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Rest/BasicAccess
Commit message (Collapse)AuthorAgeFilesLines
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-171-4/+1
| | | | | | | | | | | | | | | | Same as Ia294bf4 did for 1-line comments. This patch removes slightly more complex 2-line PHPDoc comments that don't add any new information to the code, but literally repeat what the code already says. They say "don't document the code, code the documentation", and we are doing this more and more. We just tend to forget to remove the obsolete comments. Note I'm also removing a line of text in a few cases when it's very short and literally says the same as the method name. Again, such comments add zero new information. Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
* Merge "Rest: Add missing documentation to class properties"jenkins-bot2024-09-121-0/+1
|\
| * Rest: Add missing documentation to class propertiesUmherirrender2024-09-071-0/+1
| | | | | | | | | | | | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: Idf17719c875466810313f0fbbf16bc67f3e40059
* | Use type declaration for class properties holding type hinted argumentsUmherirrender2024-09-111-2/+2
|/ | | | | | | Provided arguments already have type declaration on the construtor and it is safe to use the same type on the class property Change-Id: Ia8bbdc4dee59dfb487582dd514486ec8542951be
* Drop writeapi userrightReedy2024-07-311-1/+1
| | | | | | Bug: T294397 Depends-On: Ib34228a18917e404517d45e539bd786419d9c401 Change-Id: Ifad2edc782b36d21c8c67fecde7f011dce02c11b
* Use real type hints for services etc. in includes/Rest/Bartosz Dziewoński2024-06-112-4/+2
| | | | | | | | | | | | | | | | | Mostly used find-and-replace: Find: /\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|) Replace with: \3 \1 \4 More could be done, but to keep this patch reasonably sized, I only changed the most obvious and unambiguously correct cases. In some cases, I also removed redundant doc comments on the constructor, and re-ordered the properties to match the constructor. Change-Id: Ifa710fdf4d8d44a2d7244798b787a1b2a58c35a7
* Fix more PHPStorm inspections (#2)Tim Starling2023-03-251-1/+1
| | | | | | | | | | | | | | | * Illegal string offset and invalid argument supplied to foreach, due to incorrect type information * Array internal pointer reset is unnecessary * $hookData unused since MW 1.35 due to incomplete revert * array_push() with single element * Unnecessary sprintf() * for loop can be replaced with str_repeat() * preg_replace() can be replaced with rtrim() * array_values() call is redundant * Unnecessary cast to string * Unnecessary ternary. Often the result relies on short-circuit evaluation, but I find it more readable nonetheless. Change-Id: I4c45bdb59b51b243fa96286bec8b58deb097d707
* build: Updating dependencieslibraryupgrader2021-07-221-1/+1
| | | | | | | | | | | | | | 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
* Rest: inject Authority into HandlerPetr Pchelko2021-01-212-30/+16
| | | | | Bug: T239753 Change-Id: Iddde137c5a86786357d67458f28fe3e4d6e98710
* Introduce CompoundAuthorizer to pass multiple authorizersPetr Pchelko2020-09-221-0/+51
| | | | Change-Id: Icacad6fe95400e1ec9817fae0f9aa6edfe717b43
* Whitespace cleanup: Use tabs for indentation, avoid double spacesDannyS7122020-06-271-1/+1
| | | | Change-Id: I346073b59d283029bd6666356c62c81e687ea5e6
* Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUseJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
* Use UserIdentity instead of User in RESTPetr Pchelko2019-09-182-7/+7
| | | | Change-Id: Ia6a517c6a64664be2363492108f9497fc949f299
* REST: add write access checks to BasicAccessTim Starling2019-07-093-4/+18
| | | | | | | This is a stub implementation which just checks for the apiwrite permission. Change-Id: Ib84cd93e7f0f5e31cf620b2d30609035c4448c95
* REST: basic read restrictionsTim Starling2019-07-096-0/+203
Protect private wikis by providing basic read restrictions, closely following the example of the action API. The BasicAccess module provides a narrow interface for this functionality, without exposing the whole session/user concept to the router. Also, add RouterTest and fix a bug in Router::getRelativePath() thus discovered. Change-Id: I82319d56f08b2eec4a585ff6dbd348ccdbadc5b5