Page MenuHomePhabricator

Allow the Labs Google API proxy to handle multiple Google APIs
Closed, ResolvedPublic2 Estimated Story Points

Description

Bryan's Google Search API proxy is awesome, but we need to also use it for the Google Vision API requests (T142768) which use a different hostname: https://vision.googleapis.com. Let's come up with a way to support that (either by changing the hostname used to access the API proxy or via a parameter passed to the proxy).

Don't feel like you need to abstract this to support every possible API unless that's actually easier (per Rule of three).

Event Timeline

DannyH set the point value for this task to 2.
This comment was removed by kaldari.
kaldari renamed this task from Create an API proxy for the Google Vision (OCR) API on Tool Labs to Allow the Google API proxy on Tool Labs to handle different Google APIs.Aug 30 2016, 11:45 PM
kaldari reopened this task as Open.
kaldari updated the task description. (Show Details)
kaldari edited projects, added Community-Tech-Sprint; removed Community-Tech.

The 'right' way to do this is to probably run nginx as a transparent proxy.

bd808 renamed this task from Allow the Google API proxy on Tool Labs to handle different Google APIs to Allow the Labs Google API proxy to handle multiple Google APIs.Sep 1 2016, 5:54 PM

The 'right' way to do this is to probably run nginx as a transparent proxy.

As a completely transparent proxy? Yeah I suppose that would work. What I did thus far is make it a dedicated reverse proxy. My off the top of the head concept to extend that was to figure out how to vary the backend based on the incoming hostname.

Keep in mind this is blocking work on the Google OCR gadget, so I would favor whatever solution is relatively fast to implement.

Change 308111 had a related patch set uploaded (by BryanDavis):
google_api_proxy: Add role for Google-api-proxy Labs project

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

Change 308111 merged by Andrew Bogott:
google_api_proxy: Add role for Google-api-proxy Labs project

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

Change 308664 had a related patch set uploaded (by BryanDavis):
google_api_proxy: Add role for Google-api-proxy Labs project

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

Change 308664 merged by Yuvipanda:
google_api_proxy: Add role for Google-api-proxy Labs project

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

Change 308780 had a related patch set uploaded (by BryanDavis):
external_proxy: Respect XFF headers

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

A proxy is up and running at https://googlevision-api-proxy.wmflabs.org/ now. @Samwilson could you point your library at it and see if it works as expected? It should transparent proxy requests to https://vision.googleapis.com for any client originating inside of the Labs network.

kaldari claimed this task.

Seems to be working!

Change 308780 merged by Giuseppe Lavagetto:
external_proxy: Respect XFF headers

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