Page MenuHomePhabricator

Create mock provider for ipoid service requests
Closed, DeclinedPublic

Description

Since iPoid-Service isn't in production yet, and even once it is, developers won't have direct access to it in local environments or in beta cluster, it will be useful to have a static or on-wiki provider that can provide mock data responses for a given IP address.

One way to do that is to have a "OnWikiProvider" or something like that, which would read from "MediaWiki:IpoidServiceMock.json". That JSON page would contain an object with keys as the IP address and values simulating the API response we'll get from the iPoid-Service.

Another approach would be a static provider where we hardcode some entries in a JSON file in the repository.

In either of those approaches, IPInfo could then have a configuration setting for swapping the service used for fetching data from iPoid-Service: in production, it would use the service that makes HTTP requests to ipoid, while in development and in beta, it would use the static provider.