google-api-python-client icon indicating copy to clipboard operation
google-api-python-client copied to clipboard

Firewall requirements (Domains, ports, and protocols) for the python Gmail API and authentication.

Open Stephen-Bartel opened this issue 3 years ago • 4 comments

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe. I would like to know what the domain, port, and protocol firewall requirements are for the python Gmail API. I would need to know for example:

  • Site/domain requirements
  • Port requirements
  • Protocol type (UDP or TCP)

The Gmail API is used to perform a variety of operations. It would be good to have the requirements for all of those features and functionality. If there are different requirements for different features that some users may use or may not use, then a breakdown would also be good. For example, some users may want to send emails, while others may want to read emails from the Inbox. If there are different requirements, that would be good to know for those just wanting to send emails. Some examples:

  • Authentication
  • Refresh credentials
  • Send email
  • Fetch emails (messages.list, messages.get, threads.list etc.)

Describe the solution you'd like Page with a clear list of domain, port, and protocol requirements to use the python Gmail API. If there are different requirements for different features, then separation by category would also be useful. Describe alternatives you've considered I have tried searching for a list of domain, port, and protocol requirements. Here are two lists that I have come across and would be good to have for the python Gmail API:

  • https://support.google.com/a/answer/2589954?hl=en
  • https://stackoverflow.com/questions/50252712/how-to-catch-the-url-that-cause-ssl-certificate-verify-failed-in-python/50252843#50252843

Additional context Knowing specific firewall requirements are an important part of IT policies. In order to utilize the Python Gmail API behind a managed network, developers need to provide the exact requirements that need to be whitelisted in the firewall.

Stephen-Bartel avatar Mar 22 '22 18:03 Stephen-Bartel

In addition to the above, would someone be able to confirm if this list is accurate and enough for the Gmail API and all of its features? Or am I missing a domain, port, or protocol?

Oauth server

  • accounts.google.com:443/HTTPS

Gmail API requirements

  • apis.google.com:443/HTTPS
  • *.clients[N].google.com:443/HTTPS
  • *.googleapis.com:443/HTTPS
  • gmail.googleapis.com:443/HTTPS
  • script.google.com:443/HTTPS

This was obtained from here

Stephen-Bartel avatar Mar 22 '22 18:03 Stephen-Bartel

Hello Stephen-Bartel, The official support page that you shared captures the broader Google Workspace firewall settings. This specific client library uses the endpoints defined in in the discovery document for the Gmail V1 API here. The base url is https://gmail.googleapis.com/ which is included in your last reply. If you have specific questions about the Gmail API , please visit the Workspace support page where you can get better quality answers directly from the Gmail API team. I'm going to close this issue but please feel free to re-open it if you have additional questions about the client library.

parthea avatar Mar 24 '22 10:03 parthea

Thank you.

Stephen-Bartel avatar Mar 24 '22 14:03 Stephen-Bartel