To use the Google API, after activating them from the Google Developers Console, you need to create credentials. In my case, I have a backend that should use the server API server. For this purpose, it is possible to generate what the Google page calls “Server Application Key”. So far, so good.
The problem is that to generate the key, you need to specify the IP addresses of the servers, which will be white. But GAE does not have a static IP address that I could use there.
It is possible to manually obtain an IP by doing:
dig -t TXT _netblocks.google.com @ns1.google.com
However, there is no guarantee that this list is static (moreover, it is known to change from time to time), and there is no programmatic way in which I could automate the use of adding the IP address that I get from copying to the Google Console developers.
This leaves me with two options:
- Forget about GAE for this project, ironically, GAE cannot be used as a backend for the Google API (it’s better to use Amazon or some other solution for this). or
- Program something like a watchdog on the output of the dig command, which will notify me of the change, and then I would manually update the whitelist (I won’t do this - it’s too dangerous) or allow all IP addresses to use the Google API, which has your API key. Not the safest solution, but it works.
Is there any other workaround? Maybe GAE does not support the use of the server side of the Google API?
source share