Page MenuHomePhabricator

OAuth2 extension - update README.md on $wgRestAPIAdditionalRouteFiles
Closed, ResolvedPublic0.5 Estimated Story Points

Description

There is an instruction in the README.md file in the OAuth extension how to enable REST API endpoints:

$wgRestAPIAdditionalRouteFiles[] = "$wgExtensionDirectory/OAuth/experimentalRoutes.json";

But that will not work. Must be changed into:

$wgRestAPIAdditionalRouteFiles[] = "extensions/OAuth/experimentalRoutes.json";

Event Timeline

That seems correct though. Could your wiki be misconfigured somehow? What is the $wgRestAPIAdditionalRouteFiles entry you end up with?

Here's what I saw in code review of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/OAuth/+/597281, when I tried to use the original instructions (with $wgExtensionDirectory):

$wgExtensionDirectory is set to "{$IP}/extensions" in https://gerrit.wikimedia.org/g/mediawiki/core/+/a21774a72171af4044b53e4aea5ad66afafbd3b2/includes/DefaultSettings.php#251

However, in https://gerrit.wikimedia.org/g/mediawiki/core/+/a21774a72171af4044b53e4aea5ad66afafbd3b2/includes/Rest/EntryPoint.php#66, $IP is prepended to the value from $wgRestAPIAdditionalRouteFiles.

So $IP gets prepended twice, and the system ends up trying to load:
/var/www/mediawiki//var/www/mediawiki/extensions/OAuth/experimentalRoutes.json

Edit for clarity: the above describes the problem that this task is intended to fix. The proposed solution sounds fine to me, unless someone knows a better way.

Aklapper renamed this task from OAuth2 extension - update README.md to OAuth2 extension - update README.md on $wgRestAPIAdditionalRouteFiles.Aug 18 2020, 6:38 PM
Helga_sf set the point value for this task to 0.5.

Change 623172 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/extensions/OAuth@master] OAuth2 ext. - update README on $wgRestAPIAdditionalRouteFiles

https://gerrit.wikimedia.org/r/623172

Change 623172 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] OAuth2 ext. - update README on $wgRestAPIAdditionalRouteFiles

https://gerrit.wikimedia.org/r/623172