Last modified: 2011-03-13 18:04:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T16024, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14024 - Cross-wiki API
Cross-wiki API
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Lowest enhancement with 2 votes (vote)
: ---
Assigned To: Roan Kattouw
: schema-change
: 2463 15469 (view as bug list)
Depends on:
Blocks: 15159
  Show dependency treegraph
 
Reported: 2008-05-07 20:10 UTC by Roan Kattouw
Modified: 2011-03-13 18:04 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Basic implementation (9.12 KB, patch)
2008-08-21 21:12 UTC, Chad H.
Details

Description Roan Kattouw 2008-05-07 20:10:23 UTC
It should be possible to e.g. query the French wiki through the English wiki API, like

en.wikipedia.org/w/api.php?interwiki=fr&action=query&...

This is needed for scripts using XHR, which can't go off-domain. An implementation should preferably add a table mapping interwiki prefixes to api.php URLs (maybe use the existing interwiki table for this?), then kind of forward the request by acting as a proxy (send an HTTP request to fr.wikipedia.org and spitting the output back out to the user). 302 and friends probably (?) won't work here (XHR's gotta be smarter than that).
Comment 1 Brion Vibber 2008-05-07 20:26:26 UTC
I'm a bit leery of this for several reasons:

* authentication
* private wikis
* backend issues (are they hosted together, etc)
Comment 2 Roan Kattouw 2008-05-07 20:28:37 UTC
(In reply to comment #1)
> I'm a bit leery of this for several reasons:
> 
> * authentication
Yeah, this could get nasty with passing cookies around and stuff like that.

> * private wikis
> * backend issues (are they hosted together, etc)
> 
I see no problem there. The first wiki just forwards the request to the second wiki, and the second wiki's api.php decides what to output (whether the user has the needed rights, etc.)

Comment 3 Daniel Friesen 2008-05-07 23:30:23 UTC
I don't think one api.php should call another api.php.

This would probably be better handled with a column for storing an api url for an interwiki if that interwiki site is a MediaWiki site and does have an api.

And so the client could query the interwiki tables to know of any other API's that they can access. If there is one for the interwiki they queried for, then they can query from that API.

The Client shouldn't be using the API as a proxy, that's what we have JSON callback support for.
Comment 4 Roan Kattouw 2008-08-07 12:04:26 UTC
Dunno why I made this depend on bug 14418, we need a schema change to the interwiki table here, not to the redirect table.
Comment 5 Roan Kattouw 2008-08-18 16:05:14 UTC
To implement this, we'd need an iw_api field in the interwiki table containing the URL of the wiki's api.php
Comment 6 Chad H. 2008-08-21 21:11:05 UTC
Preliminary implementation. Needs a lot of work still (output needs formatting, so setReturnType() actually _does_ something). However, it does work :-)
Comment 7 Chad H. 2008-08-21 21:12:30 UTC
Created attachment 5206 [details]
Basic implementation

Ignore the previous comment *smack*.

Basic implementation works in this patch. Ran some basic test queries against enwiki and got the results I was expecting. Needs the cleanup I mentioned above.
Comment 8 Roan Kattouw 2008-09-04 13:36:31 UTC
*** Bug 15469 has been marked as a duplicate of this bug. ***
Comment 9 Bryan Tong Minh 2008-09-05 07:12:55 UTC
I don't really see a particular use for this. If you want ot bypass Javascript's same origin policy, you could as well use the document.write hack. Is there another use for this feature?

Suggest WONTFIX
Comment 10 Nathan Larson 2008-09-05 17:23:41 UTC
Supposedly it would help with https://bugzilla.wikimedia.org/show_bug.cgi?id=15159
Comment 11 Bryan Tong Minh 2008-09-05 19:18:49 UTC
(In reply to comment #10)
> Supposedly it would help with
> https://bugzilla.wikimedia.org/show_bug.cgi?id=15159
> 

You don't have a same origin policy in PHP.
Comment 12 Roan Kattouw 2008-09-07 18:48:50 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > Supposedly it would help with
> > https://bugzilla.wikimedia.org/show_bug.cgi?id=15159
> > 
> 
> You don't have a same origin policy in PHP.
> 

No, but you still need to map interwiki prefixes to api.php URLs.
Comment 13 Daniel Friesen 2008-09-07 20:46:48 UTC
Allowing MediaWiki to access the api of something from an interwiki prefix is a different bug. This bug is about letting non-mediawiki things use the local API to access the API of another wiki through interwiki.
Comment 14 Roan Kattouw 2008-09-07 20:54:53 UTC
(In reply to comment #13)
> Allowing MediaWiki to access the api of something from an interwiki prefix is a
> different bug. This bug is about letting non-mediawiki things use the local API
> to access the API of another wiki through interwiki.
> 

Yeah, maybe we should split this bug into:
* creating a table that maps fr: -> http://fr.wikipedia.org/w/api.php and making that table retrievable through the API
* allowing proxying through the API using the aforementioned feature
Comment 15 Mike.lifeguard 2008-09-07 20:57:55 UTC
see bug 15469 too - a possible duplicate?
Comment 16 Roan Kattouw 2008-09-07 21:30:16 UTC
(In reply to comment #15)
> see bug 15469 too - a possible duplicate?
> 

I marked that one as a dupe yesterday or the day before.
Comment 17 Roan Kattouw 2009-03-30 17:17:44 UTC
*** Bug 2463 has been marked as a duplicate of this bug. ***
Comment 18 Bryan Tong Minh 2009-07-12 20:22:49 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Allowing MediaWiki to access the api of something from an interwiki prefix is a
> > different bug. This bug is about letting non-mediawiki things use the local API
> > to access the API of another wiki through interwiki.
> > 
> 
> Yeah, maybe we should split this bug into:
> * creating a table that maps fr: -> http://fr.wikipedia.org/w/api.php and
> making that table retrievable through the API
> * allowing proxying through the API using the aforementioned feature
> 

This bug clearly concentrates on the second point. I still see no reason for this feature, so I'm closing this as WONTFIX.
Comment 19 Alex Z. 2009-07-12 23:12:01 UTC
Is there an open bug for the other point?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links